Skip to content

Commit b48279a

Browse files
namhyungacmel
authored andcommitted
perf test: Fix offcpu test prev_state check
On Fedora 36, the 'perf record' offcpu profiling tests are failing. It was because the BPF checks the prev task's state being S or D but actually it has more bits set. Let's check the LSB 8 bits for the purpose of offcpu profiling. Reported-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: Namhyung Kim <[email protected]> Acked-by: Ian Rogers <[email protected]> Tested-by: Arnaldo Carvalho de Melo <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent f9fa077 commit b48279a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/perf/util/bpf_skel/off_cpu.bpf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ int on_switch(u64 *ctx)
277277
else
278278
prev_state = get_task_state(prev);
279279

280-
return off_cpu_stat(ctx, prev, next, prev_state);
280+
return off_cpu_stat(ctx, prev, next, prev_state & 0xff);
281281
}
282282

283283
char LICENSE[] SEC("license") = "Dual BSD/GPL";

0 commit comments

Comments
 (0)