History

blktrace: Fix output non-blktrace event when blk_classic option enabled

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

Yang Jihong committed 3 years ago

Commit f596da31 parent 56fb8d91 file · +2 −1Browse files

Unified · Split

kernel/trace/blktrace.c+2−1
@@ -1548,7 +1548,8 @@ blk_trace_event_print_binary(struct trace_iterator *iter, int flags, · 1547 unmodified lines
15481548
15491549 static enum print_line_t blk_tracer_print_line(struct trace_iterator *iter)
15501550 {
1551− if (!(blk_tracer_flags.val & TRACE_BLK_OPT_CLASSIC))
1551+ if ((iter->ent->type != TRACE_BLK) ||
1552+ !(blk_tracer_flags.val & TRACE_BLK_OPT_CLASSIC))
15521553 return TRACE_TYPE_UNHANDLED;
15531554
15541555 return print_one_line(iter, true);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t