mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 22:02:02 +00:00
blktrace: Fix output non-blktrace event when blk_classic option enabled
[ Upstream commitf596da3efa
] When the blk_classic option is enabled, non-blktrace events must be filtered out. Otherwise, events of other types are output in the blktrace classic format, which is unexpected. The problem can be triggered in the following ways: # echo 1 > /sys/kernel/debug/tracing/options/blk_classic # echo 1 > /sys/kernel/debug/tracing/events/enable # echo blk > /sys/kernel/debug/tracing/current_tracer # cat /sys/kernel/debug/tracing/trace_pipe Fixes:c71a896154
("blktrace: add ftrace plugin") Signed-off-by: Yang Jihong <yangjihong1@huawei.com> Link: https://lore.kernel.org/r/20221122040410.85113-1-yangjihong1@huawei.com Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
60157bb4bf
commit
7349d943ea
1 changed files with 2 additions and 1 deletions
|
@ -1594,7 +1594,8 @@ blk_trace_event_print_binary(struct trace_iterator *iter, int flags,
|
|||
|
||||
static enum print_line_t blk_tracer_print_line(struct trace_iterator *iter)
|
||||
{
|
||||
if (!(blk_tracer_flags.val & TRACE_BLK_OPT_CLASSIC))
|
||||
if ((iter->ent->type != TRACE_BLK) ||
|
||||
!(blk_tracer_flags.val & TRACE_BLK_OPT_CLASSIC))
|
||||
return TRACE_TYPE_UNHANDLED;
|
||||
|
||||
return print_one_line(iter, true);
|
||||
|
|
Loading…
Reference in a new issue