perf test: Fix offcpu test prev_state check
[platform/kernel/linux-starfive.git] / tools / perf / util / bpf_skel / off_cpu.bpf.c
index 38e3b28..d877a0a 100644 (file)
@@ -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";