diff options
author | Shaohua Li <shli@fb.com> | 2017-07-12 14:49:56 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2017-07-29 11:00:03 -0400 |
commit | 35fe6d763229e8fc0eb5f9b93a401673cfcb5e1e (patch) | |
tree | ea38b526a62121671ef7bfff76f7d23e29804b42 /block/cfq-iosched.c | |
parent | 69fd5c391763bd94a40dd152bc72a7f230137150 (diff) |
block: use standard blktrace API to output cgroup info for debug notes
Currently cfq/bfq/blk-throttle output cgroup info in trace in their own
way. Now we have standard blktrace API for this, so convert them to use
it.
Note, this changes the behavior a little bit. cgroup info isn't output
by default, we only do this with 'blk_cgroup' option enabled. cgroup
info isn't output as a string by default too, we only do this with
'blk_cgname' option enabled. Also cgroup info is output in different
position of the note string. I think these behavior changes aren't a big
issue (actually we make trace data shorter which is good), since the
blktrace note is solely for debugging.
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r-- | block/cfq-iosched.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 3d5c28945719..0fb78fb3c03c 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -656,20 +656,17 @@ static inline void cfqg_put(struct cfq_group *cfqg) | |||
656 | } | 656 | } |
657 | 657 | ||
658 | #define cfq_log_cfqq(cfqd, cfqq, fmt, args...) do { \ | 658 | #define cfq_log_cfqq(cfqd, cfqq, fmt, args...) do { \ |
659 | char __pbuf[128]; \ | 659 | blk_add_cgroup_trace_msg((cfqd)->queue, \ |
660 | \ | 660 | cfqg_to_blkg((cfqq)->cfqg)->blkcg, \ |
661 | blkg_path(cfqg_to_blkg((cfqq)->cfqg), __pbuf, sizeof(__pbuf)); \ | 661 | "cfq%d%c%c " fmt, (cfqq)->pid, \ |
662 | blk_add_trace_msg((cfqd)->queue, "cfq%d%c%c %s " fmt, (cfqq)->pid, \ | ||
663 | cfq_cfqq_sync((cfqq)) ? 'S' : 'A', \ | 662 | cfq_cfqq_sync((cfqq)) ? 'S' : 'A', \ |
664 | cfqq_type((cfqq)) == SYNC_NOIDLE_WORKLOAD ? 'N' : ' ',\ | 663 | cfqq_type((cfqq)) == SYNC_NOIDLE_WORKLOAD ? 'N' : ' ',\ |
665 | __pbuf, ##args); \ | 664 | ##args); \ |
666 | } while (0) | 665 | } while (0) |
667 | 666 | ||
668 | #define cfq_log_cfqg(cfqd, cfqg, fmt, args...) do { \ | 667 | #define cfq_log_cfqg(cfqd, cfqg, fmt, args...) do { \ |
669 | char __pbuf[128]; \ | 668 | blk_add_cgroup_trace_msg((cfqd)->queue, \ |
670 | \ | 669 | cfqg_to_blkg(cfqg)->blkcg, fmt, ##args); \ |
671 | blkg_path(cfqg_to_blkg(cfqg), __pbuf, sizeof(__pbuf)); \ | ||
672 | blk_add_trace_msg((cfqd)->queue, "%s " fmt, __pbuf, ##args); \ | ||
673 | } while (0) | 670 | } while (0) |
674 | 671 | ||
675 | static inline void cfqg_stats_update_io_add(struct cfq_group *cfqg, | 672 | static inline void cfqg_stats_update_io_add(struct cfq_group *cfqg, |