blob: a182e6f975657d2afa30671ccf0388ea5dd1b52e [file] [log] [blame]
Omar Sandovald173a252017-05-04 00:31:30 -07001#ifndef INT_BLK_MQ_DEBUGFS_H
2#define INT_BLK_MQ_DEBUGFS_H
3
4#ifdef CONFIG_BLK_DEBUG_FS
Omar Sandovald332ce02017-05-04 08:24:40 -06005
6#include <linux/seq_file.h>
7
8struct 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 Sandovaldaaadb32017-05-04 00:31:34 -070017int __blk_mq_debugfs_rq_show(struct seq_file *m, struct request *rq);
Omar Sandoval16b738f2017-05-04 00:31:33 -070018int blk_mq_debugfs_rq_show(struct seq_file *m, void *v);
19
Omar Sandovald173a252017-05-04 00:31:30 -070020int blk_mq_debugfs_register(struct request_queue *q);
21void blk_mq_debugfs_unregister(struct request_queue *q);
Omar Sandoval9c1051a2017-05-04 08:17:21 -060022int blk_mq_debugfs_register_hctx(struct request_queue *q,
23 struct blk_mq_hw_ctx *hctx);
24void blk_mq_debugfs_unregister_hctx(struct blk_mq_hw_ctx *hctx);
25int blk_mq_debugfs_register_hctxs(struct request_queue *q);
26void blk_mq_debugfs_unregister_hctxs(struct request_queue *q);
Omar Sandovald332ce02017-05-04 08:24:40 -060027
28int blk_mq_debugfs_register_sched(struct request_queue *q);
29void blk_mq_debugfs_unregister_sched(struct request_queue *q);
30int blk_mq_debugfs_register_sched_hctx(struct request_queue *q,
31 struct blk_mq_hw_ctx *hctx);
32void blk_mq_debugfs_unregister_sched_hctx(struct blk_mq_hw_ctx *hctx);
Omar Sandovald173a252017-05-04 00:31:30 -070033#else
34static inline int blk_mq_debugfs_register(struct request_queue *q)
35{
36 return 0;
37}
38
39static inline void blk_mq_debugfs_unregister(struct request_queue *q)
40{
41}
42
Omar Sandoval9c1051a2017-05-04 08:17:21 -060043static inline int blk_mq_debugfs_register_hctx(struct request_queue *q,
44 struct blk_mq_hw_ctx *hctx)
Omar Sandovald173a252017-05-04 00:31:30 -070045{
46 return 0;
47}
48
Omar Sandoval9c1051a2017-05-04 08:17:21 -060049static inline void blk_mq_debugfs_unregister_hctx(struct blk_mq_hw_ctx *hctx)
50{
51}
52
53static inline int blk_mq_debugfs_register_hctxs(struct request_queue *q)
54{
55 return 0;
56}
57
58static inline void blk_mq_debugfs_unregister_hctxs(struct request_queue *q)
Omar Sandovald173a252017-05-04 00:31:30 -070059{
60}
Omar Sandovald332ce02017-05-04 08:24:40 -060061
62static inline int blk_mq_debugfs_register_sched(struct request_queue *q)
63{
64 return 0;
65}
66
67static inline void blk_mq_debugfs_unregister_sched(struct request_queue *q)
68{
69}
70
71static 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
77static inline void blk_mq_debugfs_unregister_sched_hctx(struct blk_mq_hw_ctx *hctx)
78{
79}
Omar Sandovald173a252017-05-04 00:31:30 -070080#endif
81
82#endif