blob: a68aa6041a10dc616ca2bca43a3bb4588f4baf8c [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Omar Sandovald173a252017-05-04 00:31:30 -07002#ifndef INT_BLK_MQ_DEBUGFS_H
3#define INT_BLK_MQ_DEBUGFS_H
4
5#ifdef CONFIG_BLK_DEBUG_FS
Omar Sandovald332ce02017-05-04 08:24:40 -06006
7#include <linux/seq_file.h>
8
9struct 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 Sandovaldaaadb32017-05-04 00:31:34 -070018int __blk_mq_debugfs_rq_show(struct seq_file *m, struct request *rq);
Omar Sandoval16b738f2017-05-04 00:31:33 -070019int blk_mq_debugfs_rq_show(struct seq_file *m, void *v);
20
Greg Kroah-Hartman6cfc0082019-06-12 14:30:19 +020021void blk_mq_debugfs_register(struct request_queue *q);
Omar Sandovald173a252017-05-04 00:31:30 -070022void blk_mq_debugfs_unregister(struct request_queue *q);
Greg Kroah-Hartman6cfc0082019-06-12 14:30:19 +020023void blk_mq_debugfs_register_hctx(struct request_queue *q,
24 struct blk_mq_hw_ctx *hctx);
Omar Sandoval9c1051a2017-05-04 08:17:21 -060025void blk_mq_debugfs_unregister_hctx(struct blk_mq_hw_ctx *hctx);
Greg Kroah-Hartman6cfc0082019-06-12 14:30:19 +020026void blk_mq_debugfs_register_hctxs(struct request_queue *q);
Omar Sandoval9c1051a2017-05-04 08:17:21 -060027void blk_mq_debugfs_unregister_hctxs(struct request_queue *q);
Omar Sandovald332ce02017-05-04 08:24:40 -060028
Greg Kroah-Hartman6cfc0082019-06-12 14:30:19 +020029void blk_mq_debugfs_register_sched(struct request_queue *q);
Omar Sandovald332ce02017-05-04 08:24:40 -060030void blk_mq_debugfs_unregister_sched(struct request_queue *q);
Greg Kroah-Hartman6cfc0082019-06-12 14:30:19 +020031void blk_mq_debugfs_register_sched_hctx(struct request_queue *q,
Omar Sandovald332ce02017-05-04 08:24:40 -060032 struct blk_mq_hw_ctx *hctx);
33void blk_mq_debugfs_unregister_sched_hctx(struct blk_mq_hw_ctx *hctx);
Ming Leicc566942018-12-17 09:46:00 +080034
Greg Kroah-Hartman6cfc0082019-06-12 14:30:19 +020035void blk_mq_debugfs_register_rqos(struct rq_qos *rqos);
Ming Leicc566942018-12-17 09:46:00 +080036void blk_mq_debugfs_unregister_rqos(struct rq_qos *rqos);
37void blk_mq_debugfs_unregister_queue_rqos(struct request_queue *q);
Omar Sandovald173a252017-05-04 00:31:30 -070038#else
Greg Kroah-Hartman6cfc0082019-06-12 14:30:19 +020039static inline void blk_mq_debugfs_register(struct request_queue *q)
Omar Sandovald173a252017-05-04 00:31:30 -070040{
Omar Sandovald173a252017-05-04 00:31:30 -070041}
42
43static inline void blk_mq_debugfs_unregister(struct request_queue *q)
44{
45}
46
Greg Kroah-Hartman6cfc0082019-06-12 14:30:19 +020047static inline void blk_mq_debugfs_register_hctx(struct request_queue *q,
48 struct blk_mq_hw_ctx *hctx)
Omar Sandovald173a252017-05-04 00:31:30 -070049{
Omar Sandovald173a252017-05-04 00:31:30 -070050}
51
Omar Sandoval9c1051a2017-05-04 08:17:21 -060052static inline void blk_mq_debugfs_unregister_hctx(struct blk_mq_hw_ctx *hctx)
53{
54}
55
Greg Kroah-Hartman6cfc0082019-06-12 14:30:19 +020056static inline void blk_mq_debugfs_register_hctxs(struct request_queue *q)
Omar Sandoval9c1051a2017-05-04 08:17:21 -060057{
Omar Sandoval9c1051a2017-05-04 08:17:21 -060058}
59
60static inline void blk_mq_debugfs_unregister_hctxs(struct request_queue *q)
Omar Sandovald173a252017-05-04 00:31:30 -070061{
62}
Omar Sandovald332ce02017-05-04 08:24:40 -060063
Greg Kroah-Hartman6cfc0082019-06-12 14:30:19 +020064static inline void blk_mq_debugfs_register_sched(struct request_queue *q)
Omar Sandovald332ce02017-05-04 08:24:40 -060065{
Omar Sandovald332ce02017-05-04 08:24:40 -060066}
67
68static inline void blk_mq_debugfs_unregister_sched(struct request_queue *q)
69{
70}
71
Greg Kroah-Hartman6cfc0082019-06-12 14:30:19 +020072static inline void blk_mq_debugfs_register_sched_hctx(struct request_queue *q,
73 struct blk_mq_hw_ctx *hctx)
Omar Sandovald332ce02017-05-04 08:24:40 -060074{
Omar Sandovald332ce02017-05-04 08:24:40 -060075}
76
77static inline void blk_mq_debugfs_unregister_sched_hctx(struct blk_mq_hw_ctx *hctx)
78{
79}
Ming Leicc566942018-12-17 09:46:00 +080080
Greg Kroah-Hartman6cfc0082019-06-12 14:30:19 +020081static inline void blk_mq_debugfs_register_rqos(struct rq_qos *rqos)
Ming Leicc566942018-12-17 09:46:00 +080082{
Ming Leicc566942018-12-17 09:46:00 +080083}
84
85static inline void blk_mq_debugfs_unregister_rqos(struct rq_qos *rqos)
86{
87}
88
89static inline void blk_mq_debugfs_unregister_queue_rqos(struct request_queue *q)
90{
91}
Omar Sandovald173a252017-05-04 00:31:30 -070092#endif
93
Bart Van Assche6a5ac982018-06-15 14:55:21 -070094#ifdef CONFIG_BLK_DEBUG_FS_ZONED
95int queue_zone_wlock_show(void *data, struct seq_file *m);
96#else
97static inline int queue_zone_wlock_show(void *data, struct seq_file *m)
98{
99 return 0;
100}
101#endif
102
Omar Sandovald173a252017-05-04 00:31:30 -0700103#endif