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
1548 1548
1549static enum print_line_t blk_tracer_print_line(struct trace_iterator *iter)1549static enum print_line_t blk_tracer_print_line(struct trace_iterator *iter)
1550{1550{
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))
1552 return TRACE_TYPE_UNHANDLED;1553 return TRACE_TYPE_UNHANDLED;
1553 1554
1554 return print_one_line(iter, true);1555 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