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 | 16b738f | 2017-05-04 00:31:33 -0700 | [diff] [blame^] | 17 | int blk_mq_debugfs_rq_show(struct seq_file *m, void *v); |
| 18 | |
Omar Sandoval | d173a25 | 2017-05-04 00:31:30 -0700 | [diff] [blame] | 19 | int blk_mq_debugfs_register(struct request_queue *q); |
| 20 | void blk_mq_debugfs_unregister(struct request_queue *q); |
Omar Sandoval | 9c1051a | 2017-05-04 08:17:21 -0600 | [diff] [blame] | 21 | int blk_mq_debugfs_register_hctx(struct request_queue *q, |
| 22 | struct blk_mq_hw_ctx *hctx); |
| 23 | void blk_mq_debugfs_unregister_hctx(struct blk_mq_hw_ctx *hctx); |
| 24 | int blk_mq_debugfs_register_hctxs(struct request_queue *q); |
| 25 | void blk_mq_debugfs_unregister_hctxs(struct request_queue *q); |
Omar Sandoval | d332ce0 | 2017-05-04 08:24:40 -0600 | [diff] [blame] | 26 | |
| 27 | int blk_mq_debugfs_register_sched(struct request_queue *q); |
| 28 | void blk_mq_debugfs_unregister_sched(struct request_queue *q); |
| 29 | int blk_mq_debugfs_register_sched_hctx(struct request_queue *q, |
| 30 | struct blk_mq_hw_ctx *hctx); |
| 31 | 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] | 32 | #else |
| 33 | static inline int blk_mq_debugfs_register(struct request_queue *q) |
| 34 | { |
| 35 | return 0; |
| 36 | } |
| 37 | |
| 38 | static inline void blk_mq_debugfs_unregister(struct request_queue *q) |
| 39 | { |
| 40 | } |
| 41 | |
Omar Sandoval | 9c1051a | 2017-05-04 08:17:21 -0600 | [diff] [blame] | 42 | static inline int blk_mq_debugfs_register_hctx(struct request_queue *q, |
| 43 | struct blk_mq_hw_ctx *hctx) |
Omar Sandoval | d173a25 | 2017-05-04 00:31:30 -0700 | [diff] [blame] | 44 | { |
| 45 | return 0; |
| 46 | } |
| 47 | |
Omar Sandoval | 9c1051a | 2017-05-04 08:17:21 -0600 | [diff] [blame] | 48 | static inline void blk_mq_debugfs_unregister_hctx(struct blk_mq_hw_ctx *hctx) |
| 49 | { |
| 50 | } |
| 51 | |
| 52 | static inline int blk_mq_debugfs_register_hctxs(struct request_queue *q) |
| 53 | { |
| 54 | return 0; |
| 55 | } |
| 56 | |
| 57 | static inline void blk_mq_debugfs_unregister_hctxs(struct request_queue *q) |
Omar Sandoval | d173a25 | 2017-05-04 00:31:30 -0700 | [diff] [blame] | 58 | { |
| 59 | } |
Omar Sandoval | d332ce0 | 2017-05-04 08:24:40 -0600 | [diff] [blame] | 60 | |
| 61 | static inline int blk_mq_debugfs_register_sched(struct request_queue *q) |
| 62 | { |
| 63 | return 0; |
| 64 | } |
| 65 | |
| 66 | static inline void blk_mq_debugfs_unregister_sched(struct request_queue *q) |
| 67 | { |
| 68 | } |
| 69 | |
| 70 | static inline int blk_mq_debugfs_register_sched_hctx(struct request_queue *q, |
| 71 | struct blk_mq_hw_ctx *hctx) |
| 72 | { |
| 73 | return 0; |
| 74 | } |
| 75 | |
| 76 | static inline void blk_mq_debugfs_unregister_sched_hctx(struct blk_mq_hw_ctx *hctx) |
| 77 | { |
| 78 | } |
Omar Sandoval | d173a25 | 2017-05-04 00:31:30 -0700 | [diff] [blame] | 79 | #endif |
| 80 | |
| 81 | #endif |