Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Omar Sandoval | d173a25 | 2017-05-04 00:31:30 -0700 | [diff] [blame] | 2 | #ifndef INT_BLK_MQ_DEBUGFS_H |
| 3 | #define INT_BLK_MQ_DEBUGFS_H |
| 4 | |
| 5 | #ifdef CONFIG_BLK_DEBUG_FS |
Omar Sandoval | d332ce0 | 2017-05-04 08:24:40 -0600 | [diff] [blame] | 6 | |
| 7 | #include <linux/seq_file.h> |
| 8 | |
| 9 | struct blk_mq_debugfs_attr { |
| 10 | const char *name; |
| 11 | umode_t mode; |
| 12 | int (*show)(void *, struct seq_file *); |
| 13 | ssize_t (*write)(void *, const char __user *, size_t, loff_t *); |
| 14 | /* Set either .show or .seq_ops. */ |
| 15 | const struct seq_operations *seq_ops; |
| 16 | }; |
| 17 | |
Omar Sandoval | daaadb3 | 2017-05-04 00:31:34 -0700 | [diff] [blame] | 18 | 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] | 19 | int blk_mq_debugfs_rq_show(struct seq_file *m, void *v); |
| 20 | |
Greg Kroah-Hartman | 6cfc008 | 2019-06-12 14:30:19 +0200 | [diff] [blame] | 21 | void blk_mq_debugfs_register(struct request_queue *q); |
Omar Sandoval | d173a25 | 2017-05-04 00:31:30 -0700 | [diff] [blame] | 22 | void blk_mq_debugfs_unregister(struct request_queue *q); |
Greg Kroah-Hartman | 6cfc008 | 2019-06-12 14:30:19 +0200 | [diff] [blame] | 23 | void blk_mq_debugfs_register_hctx(struct request_queue *q, |
| 24 | struct blk_mq_hw_ctx *hctx); |
Omar Sandoval | 9c1051a | 2017-05-04 08:17:21 -0600 | [diff] [blame] | 25 | void blk_mq_debugfs_unregister_hctx(struct blk_mq_hw_ctx *hctx); |
Greg Kroah-Hartman | 6cfc008 | 2019-06-12 14:30:19 +0200 | [diff] [blame] | 26 | void blk_mq_debugfs_register_hctxs(struct request_queue *q); |
Omar Sandoval | 9c1051a | 2017-05-04 08:17:21 -0600 | [diff] [blame] | 27 | void blk_mq_debugfs_unregister_hctxs(struct request_queue *q); |
Omar Sandoval | d332ce0 | 2017-05-04 08:24:40 -0600 | [diff] [blame] | 28 | |
Greg Kroah-Hartman | 6cfc008 | 2019-06-12 14:30:19 +0200 | [diff] [blame] | 29 | void blk_mq_debugfs_register_sched(struct request_queue *q); |
Omar Sandoval | d332ce0 | 2017-05-04 08:24:40 -0600 | [diff] [blame] | 30 | void blk_mq_debugfs_unregister_sched(struct request_queue *q); |
Greg Kroah-Hartman | 6cfc008 | 2019-06-12 14:30:19 +0200 | [diff] [blame] | 31 | void blk_mq_debugfs_register_sched_hctx(struct request_queue *q, |
Omar Sandoval | d332ce0 | 2017-05-04 08:24:40 -0600 | [diff] [blame] | 32 | struct blk_mq_hw_ctx *hctx); |
| 33 | void blk_mq_debugfs_unregister_sched_hctx(struct blk_mq_hw_ctx *hctx); |
Ming Lei | cc56694 | 2018-12-17 09:46:00 +0800 | [diff] [blame] | 34 | |
Greg Kroah-Hartman | 6cfc008 | 2019-06-12 14:30:19 +0200 | [diff] [blame] | 35 | void blk_mq_debugfs_register_rqos(struct rq_qos *rqos); |
Ming Lei | cc56694 | 2018-12-17 09:46:00 +0800 | [diff] [blame] | 36 | void blk_mq_debugfs_unregister_rqos(struct rq_qos *rqos); |
| 37 | void blk_mq_debugfs_unregister_queue_rqos(struct request_queue *q); |
Omar Sandoval | d173a25 | 2017-05-04 00:31:30 -0700 | [diff] [blame] | 38 | #else |
Greg Kroah-Hartman | 6cfc008 | 2019-06-12 14:30:19 +0200 | [diff] [blame] | 39 | static inline void blk_mq_debugfs_register(struct request_queue *q) |
Omar Sandoval | d173a25 | 2017-05-04 00:31:30 -0700 | [diff] [blame] | 40 | { |
Omar Sandoval | d173a25 | 2017-05-04 00:31:30 -0700 | [diff] [blame] | 41 | } |
| 42 | |
| 43 | static inline void blk_mq_debugfs_unregister(struct request_queue *q) |
| 44 | { |
| 45 | } |
| 46 | |
Greg Kroah-Hartman | 6cfc008 | 2019-06-12 14:30:19 +0200 | [diff] [blame] | 47 | static inline void blk_mq_debugfs_register_hctx(struct request_queue *q, |
| 48 | struct blk_mq_hw_ctx *hctx) |
Omar Sandoval | d173a25 | 2017-05-04 00:31:30 -0700 | [diff] [blame] | 49 | { |
Omar Sandoval | d173a25 | 2017-05-04 00:31:30 -0700 | [diff] [blame] | 50 | } |
| 51 | |
Omar Sandoval | 9c1051a | 2017-05-04 08:17:21 -0600 | [diff] [blame] | 52 | static inline void blk_mq_debugfs_unregister_hctx(struct blk_mq_hw_ctx *hctx) |
| 53 | { |
| 54 | } |
| 55 | |
Greg Kroah-Hartman | 6cfc008 | 2019-06-12 14:30:19 +0200 | [diff] [blame] | 56 | static inline void blk_mq_debugfs_register_hctxs(struct request_queue *q) |
Omar Sandoval | 9c1051a | 2017-05-04 08:17:21 -0600 | [diff] [blame] | 57 | { |
Omar Sandoval | 9c1051a | 2017-05-04 08:17:21 -0600 | [diff] [blame] | 58 | } |
| 59 | |
| 60 | static inline void blk_mq_debugfs_unregister_hctxs(struct request_queue *q) |
Omar Sandoval | d173a25 | 2017-05-04 00:31:30 -0700 | [diff] [blame] | 61 | { |
| 62 | } |
Omar Sandoval | d332ce0 | 2017-05-04 08:24:40 -0600 | [diff] [blame] | 63 | |
Greg Kroah-Hartman | 6cfc008 | 2019-06-12 14:30:19 +0200 | [diff] [blame] | 64 | static inline void blk_mq_debugfs_register_sched(struct request_queue *q) |
Omar Sandoval | d332ce0 | 2017-05-04 08:24:40 -0600 | [diff] [blame] | 65 | { |
Omar Sandoval | d332ce0 | 2017-05-04 08:24:40 -0600 | [diff] [blame] | 66 | } |
| 67 | |
| 68 | static inline void blk_mq_debugfs_unregister_sched(struct request_queue *q) |
| 69 | { |
| 70 | } |
| 71 | |
Greg Kroah-Hartman | 6cfc008 | 2019-06-12 14:30:19 +0200 | [diff] [blame] | 72 | static inline void blk_mq_debugfs_register_sched_hctx(struct request_queue *q, |
| 73 | struct blk_mq_hw_ctx *hctx) |
Omar Sandoval | d332ce0 | 2017-05-04 08:24:40 -0600 | [diff] [blame] | 74 | { |
Omar Sandoval | d332ce0 | 2017-05-04 08:24:40 -0600 | [diff] [blame] | 75 | } |
| 76 | |
| 77 | static inline void blk_mq_debugfs_unregister_sched_hctx(struct blk_mq_hw_ctx *hctx) |
| 78 | { |
| 79 | } |
Ming Lei | cc56694 | 2018-12-17 09:46:00 +0800 | [diff] [blame] | 80 | |
Greg Kroah-Hartman | 6cfc008 | 2019-06-12 14:30:19 +0200 | [diff] [blame] | 81 | static inline void blk_mq_debugfs_register_rqos(struct rq_qos *rqos) |
Ming Lei | cc56694 | 2018-12-17 09:46:00 +0800 | [diff] [blame] | 82 | { |
Ming Lei | cc56694 | 2018-12-17 09:46:00 +0800 | [diff] [blame] | 83 | } |
| 84 | |
| 85 | static inline void blk_mq_debugfs_unregister_rqos(struct rq_qos *rqos) |
| 86 | { |
| 87 | } |
| 88 | |
| 89 | static inline void blk_mq_debugfs_unregister_queue_rqos(struct request_queue *q) |
| 90 | { |
| 91 | } |
Omar Sandoval | d173a25 | 2017-05-04 00:31:30 -0700 | [diff] [blame] | 92 | #endif |
| 93 | |
Bart Van Assche | 6a5ac98 | 2018-06-15 14:55:21 -0700 | [diff] [blame] | 94 | #ifdef CONFIG_BLK_DEBUG_FS_ZONED |
| 95 | int queue_zone_wlock_show(void *data, struct seq_file *m); |
| 96 | #else |
| 97 | static inline int queue_zone_wlock_show(void *data, struct seq_file *m) |
| 98 | { |
| 99 | return 0; |
| 100 | } |
| 101 | #endif |
| 102 | |
Omar Sandoval | d173a25 | 2017-05-04 00:31:30 -0700 | [diff] [blame] | 103 | #endif |