Commit 1e03a269 authored by Namhyung Kim's avatar Namhyung Kim Committed by Greg Kroah-Hartman
Browse files

perf record: Fix BTF type checks in the off-cpu profiling



[ Upstream commit 0e501a65 ]

The BTF func proto for a tracepoint has one more argument than the
actual tracepoint function since it has a context argument at the
begining.  So it should compare to 5 when the tracepoint has 4
arguments.

  typedef void (*btf_trace_sched_switch)(void *, bool, struct task_struct *, struct task_struct *, unsigned int);

Also, recent change in the perf tool would use a hand-written minimal
vmlinux.h to generate BTF in the skeleton.  So it won't have the info
of the tracepoint.  Anyway it should use the kernel's vmlinux BTF to
check the type in the kernel.

Fixes: b36888f7 ("perf record: Handle argument change in sched_switch")
Reviewed-by: default avatarIan Rogers <irogers@google.com>
Acked-by: default avatarSong Liu <song@kernel.org>
Cc: Hao Luo <haoluo@google.com>
CC: bpf@vger.kernel.org
Link: https://lore.kernel.org/r/20230922234444.3115821-1-namhyung@kernel.org


Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 1c4eb1bc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment