Omar Sandoval | d173a25 | 2017-05-04 00:31:30 -0700 | [diff] [blame] | 1 | #ifndef INT_BLK_MQ_DEBUGFS_H |
| 2 | #define INT_BLK_MQ_DEBUGFS_H |
| 3 | |
| 4 | #ifdef CONFIG_BLK_DEBUG_FS |
Omar Sandoval | d332ce0 | 2017-05-04 08:24:40 -0600 | [diff] [blame] | 5 | |
| 6 | #include <linux/seq_file.h> |
| 7 | |
| 8 | struct blk_mq_debugfs_attr { |
| 9 | const char *name; |
| 10 | umode_t mode; |
| 11 | int (*show)(void *, struct seq_file *); |
| 12 | ssize_t (*write)(void *, const char __user *, size_t, loff_t *); |
| 13 | /* Set either .show or .seq_ops. */ |
| 14 | const struct seq_operations *seq_ops; |
| 15 | }; |
| 16 | |
Omar Sandoval | daaadb3 | 2017-05-04 00:31:34 -0700 | [diff] [blame] | 17 | int __blk_mq_debugfs_rq_show(struct seq_file *m, struct request *rq); |
Omar Sandoval | 16b738f | 2017-05-04 00:31:33 -0700 | [diff] [blame] | 18 | int blk_mq_debugfs_rq_show(struct seq_file *m, void *v); |
| 19 | |
Omar Sandoval | d173a25 | 2017-05-04 00:31:30 -0700 | [diff] [blame] | 20 | int blk_mq_debugfs_register(struct request_queue *q); |
| 21 | void blk_mq_debugfs_unregister(struct request_queue *q); |
Omar Sandoval | 9c1051a | 2017-05-04 08:17:21 -0600 | [diff] [blame] | 22 | int blk_mq_debugfs_register_hctx(struct request_queue *q, |
| 23 | struct blk_mq_hw_ctx *hctx); |
| 24 | void blk_mq_debugfs_unregister_hctx(struct blk_mq_hw_ctx *hctx); |
| 25 | int blk_mq_debugfs_register_hctxs(struct request_queue *q); |
| 26 | void blk_mq_debugfs_unregister_hctxs(struct request_queue *q); |
Omar Sandoval | d332ce0 | 2017-05-04 08:24:40 -0600 | [diff] [blame] | 27 | |
| 28 | int blk_mq_debugfs_register_sched(struct request_queue *q); |
| 29 | void blk_mq_debugfs_unregister_sched(struct request_queue *q); |
| 30 | int blk_mq_debugfs_register_sched_hctx(struct request_queue *q, |
| 31 | struct blk_mq_hw_ctx *hctx); |
| 32 | void blk_mq_debugfs_unregister_sched_hctx(struct blk_mq_hw_ctx *hctx); |
Omar Sandoval | d173a25 | 2017-05-04 00:31:30 -0700 | [diff] [blame] | 33 | #else |
| 34 | static inline int blk_mq_debugfs_register(struct request_queue *q) |
| 35 | { |
| 36 | return 0; |
| 37 | } |
| 38 | |
| 39 | static inline void blk_mq_debugfs_unregister(struct request_queue *q) |
| 40 | { |
| 41 | } |
| 42 | |
Omar Sandoval | 9c1051a | 2017-05-04 08:17:21 -0600 | [diff] [blame] | 43 | static inline int blk_mq_debugfs_register_hctx(struct request_queue *q, |
| 44 | struct blk_mq_hw_ctx *hctx) |
Omar Sandoval | d173a25 | 2017-05-04 00:31:30 -0700 | [diff] [blame] | 45 | { |
| 46 | return 0; |
| 47 | } |
| 48 | |
Omar Sandoval | 9c1051a | 2017-05-04 08:17:21 -0600 | [diff] [blame] | 49 | static inline void blk_mq_debugfs_unregister_hctx(struct blk_mq_hw_ctx *hctx) |
| 50 | { |
| 51 | } |
| 52 | |
| 53 | static inline int blk_mq_debugfs_register_hctxs(struct request_queue *q) |
| 54 | { |
| 55 | return 0; |
| 56 | } |
| 57 | |
| 58 | static inline void blk_mq_debugfs_unregister_hctxs(struct request_queue *q) |
Omar Sandoval | d173a25 | 2017-05-04 00:31:30 -0700 | [diff] [blame] | 59 | { |
| 60 | } |
Omar Sandoval | d332ce0 | 2017-05-04 08:24:40 -0600 | [diff] [blame] | 61 | |
| 62 | static inline int blk_mq_debugfs_register_sched(struct request_queue *q) |
| 63 | { |
| 64 | return 0; |
| 65 | } |
| 66 | |
| 67 | static inline void blk_mq_debugfs_unregister_sched(struct request_queue *q) |
| 68 | { |
| 69 | } |
| 70 | |
| 71 | static inline int blk_mq_debugfs_register_sched_hctx(struct request_queue *q, |
| 72 | struct blk_mq_hw_ctx *hctx) |
| 73 | { |
| 74 | return 0; |
| 75 | } |
| 76 | |
| 77 | static inline void blk_mq_debugfs_unregister_sched_hctx(struct blk_mq_hw_ctx *hctx) |
| 78 | { |
| 79 | } |
Omar Sandoval | d173a25 | 2017-05-04 00:31:30 -0700 | [diff] [blame] | 80 | #endif |
| 81 | |
| 82 | #endif |