diff options
author | Namhyung Kim <[email protected]> | 2023-02-18 08:27:24 -0800 |
---|---|---|
committer | Arnaldo Carvalho de Melo <[email protected]> | 2023-02-22 12:39:11 -0300 |
commit | b48279af636de613e9dd03857d9cadd4beca8e7e (patch) | |
tree | af89a81331497f19b15a6c5b39dd408a49f29f40 | |
parent | f9fa0778ee7349a9aa3d2ea10e9f2ab843a0b44e (diff) |
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]>
-rw-r--r-- | tools/perf/util/bpf_skel/off_cpu.bpf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/bpf_skel/off_cpu.bpf.c b/tools/perf/util/bpf_skel/off_cpu.bpf.c index 38e3b287dbb2..d877a0a9731f 100644 --- a/tools/perf/util/bpf_skel/off_cpu.bpf.c +++ b/tools/perf/util/bpf_skel/off_cpu.bpf.c @@ -277,7 +277,7 @@ int on_switch(u64 *ctx) else prev_state = get_task_state(prev); - return off_cpu_stat(ctx, prev, next, prev_state); + return off_cpu_stat(ctx, prev, next, prev_state & 0xff); } char LICENSE[] SEC("license") = "Dual BSD/GPL"; |