• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef INT_BLK_MQ_DEBUGFS_H
3 #define INT_BLK_MQ_DEBUGFS_H
4 
5 #ifdef CONFIG_BLK_DEBUG_FS
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 
18 void blk_mq_debugfs_init(void);
19 
20 int __blk_mq_debugfs_rq_show(struct seq_file *m, struct request *rq);
21 int blk_mq_debugfs_rq_show(struct seq_file *m, void *v);
22 
23 void blk_mq_debugfs_register(struct request_queue *q);
24 void blk_mq_debugfs_unregister(struct request_queue *q);
25 void blk_mq_debugfs_register_hctx(struct request_queue *q,
26 				  struct blk_mq_hw_ctx *hctx);
27 void blk_mq_debugfs_unregister_hctx(struct blk_mq_hw_ctx *hctx);
28 void blk_mq_debugfs_register_hctxs(struct request_queue *q);
29 void blk_mq_debugfs_unregister_hctxs(struct request_queue *q);
30 
31 void blk_mq_debugfs_register_sched(struct request_queue *q);
32 void blk_mq_debugfs_unregister_sched(struct request_queue *q);
33 void blk_mq_debugfs_register_sched_hctx(struct request_queue *q,
34 				       struct blk_mq_hw_ctx *hctx);
35 void blk_mq_debugfs_unregister_sched_hctx(struct blk_mq_hw_ctx *hctx);
36 
37 void blk_mq_debugfs_register_rqos(struct rq_qos *rqos);
38 void blk_mq_debugfs_unregister_rqos(struct rq_qos *rqos);
39 void blk_mq_debugfs_unregister_queue_rqos(struct request_queue *q);
40 #else
blk_mq_debugfs_init(void)41 static inline void blk_mq_debugfs_init(void)
42 {
43 }
44 
blk_mq_debugfs_register(struct request_queue * q)45 static inline void blk_mq_debugfs_register(struct request_queue *q)
46 {
47 }
48 
blk_mq_debugfs_unregister(struct request_queue * q)49 static inline void blk_mq_debugfs_unregister(struct request_queue *q)
50 {
51 }
52 
blk_mq_debugfs_register_hctx(struct request_queue * q,struct blk_mq_hw_ctx * hctx)53 static inline void blk_mq_debugfs_register_hctx(struct request_queue *q,
54 						struct blk_mq_hw_ctx *hctx)
55 {
56 }
57 
blk_mq_debugfs_unregister_hctx(struct blk_mq_hw_ctx * hctx)58 static inline void blk_mq_debugfs_unregister_hctx(struct blk_mq_hw_ctx *hctx)
59 {
60 }
61 
blk_mq_debugfs_register_hctxs(struct request_queue * q)62 static inline void blk_mq_debugfs_register_hctxs(struct request_queue *q)
63 {
64 }
65 
blk_mq_debugfs_unregister_hctxs(struct request_queue * q)66 static inline void blk_mq_debugfs_unregister_hctxs(struct request_queue *q)
67 {
68 }
69 
blk_mq_debugfs_register_sched(struct request_queue * q)70 static inline void blk_mq_debugfs_register_sched(struct request_queue *q)
71 {
72 }
73 
blk_mq_debugfs_unregister_sched(struct request_queue * q)74 static inline void blk_mq_debugfs_unregister_sched(struct request_queue *q)
75 {
76 }
77 
blk_mq_debugfs_register_sched_hctx(struct request_queue * q,struct blk_mq_hw_ctx * hctx)78 static inline void blk_mq_debugfs_register_sched_hctx(struct request_queue *q,
79 						      struct blk_mq_hw_ctx *hctx)
80 {
81 }
82 
blk_mq_debugfs_unregister_sched_hctx(struct blk_mq_hw_ctx * hctx)83 static inline void blk_mq_debugfs_unregister_sched_hctx(struct blk_mq_hw_ctx *hctx)
84 {
85 }
86 
blk_mq_debugfs_register_rqos(struct rq_qos * rqos)87 static inline void blk_mq_debugfs_register_rqos(struct rq_qos *rqos)
88 {
89 }
90 
blk_mq_debugfs_unregister_rqos(struct rq_qos * rqos)91 static inline void blk_mq_debugfs_unregister_rqos(struct rq_qos *rqos)
92 {
93 }
94 
blk_mq_debugfs_unregister_queue_rqos(struct request_queue * q)95 static inline void blk_mq_debugfs_unregister_queue_rqos(struct request_queue *q)
96 {
97 }
98 #endif
99 
100 #ifdef CONFIG_BLK_DEBUG_FS_ZONED
101 int queue_zone_wlock_show(void *data, struct seq_file *m);
102 #else
queue_zone_wlock_show(void * data,struct seq_file * m)103 static inline int queue_zone_wlock_show(void *data, struct seq_file *m)
104 {
105 	return 0;
106 }
107 #endif
108 
109 #endif
110