Skip to content

Commit 4b66ff4

Browse files
James-A-ClarkPeter Zijlstra
authored andcommitted
perf: Fix missing raw data on tracepoint events
Since commit 838d9bb ("perf: Use sample_flags for raw_data") raw data is not being output on tracepoints due to the PERF_SAMPLE_RAW field not being set. Fix this by setting it for tracepoint events. This fixes the following test failure: perf test "sched_switch" -vvv 35: Track with sched_switch --- start --- test child forked, pid 1828 ... Using CPUID 0x00000000410fd400 sched_switch: cpu: 2 prev_tid -14687 next_tid 0 sched_switch: cpu: 2 prev_tid -14687 next_tid 0 Missing sched_switch events 4613 events recorded test child finished with -1 ---- end ---- Track with sched_switch: FAILED! Fixes: 838d9bb ("perf: Use sample_flags for raw_data") Signed-off-by: James Clark <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Acked-by: Namhyung Kim <[email protected]> Tested-by: SeongJae Park <[email protected]> Tested-by: Athira Rajeev <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 247f34f commit 4b66ff4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

kernel/events/core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9846,6 +9846,7 @@ void perf_tp_event(u16 event_type, u64 count, void *record, int entry_size,
98469846

98479847
perf_sample_data_init(&data, 0, 0);
98489848
data.raw = &raw;
9849+
data.sample_flags |= PERF_SAMPLE_RAW;
98499850

98509851
perf_trace_buf_update(record, event_type);
98519852

0 commit comments

Comments
 (0)