perf bpf skels: Make vmlinux.h use bpf.h and perf_event.h in source directory
authorYang Jihong <yangjihong1@huawei.com>
Wed, 10 May 2023 06:44:01 +0000 (06:44 +0000)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 10 May 2023 17:20:49 +0000 (14:20 -0300)
commit5be6cecda0802f2397504fd40c3402cd8ac8022e
treec98ec919bec84f1eb46044e911239f5ca61499a4
parent7d161165d9072dcbb1f01ce947436b7a3101c254
perf bpf skels: Make vmlinux.h use bpf.h and perf_event.h in source directory

Currently, vmlinux.h uses the bpf.h and perf_event.h header files in the
system path. If the header files in compilation environment are old,
compilation may fail. For example:

  /home/yangjihong/linux/tools/perf/util/bpf_skel/.tmp/../vmlinux.h:151:27: error: field has incomplete type 'union perf_sample_weight'
          union perf_sample_weight weight;

Use the bpf.h and perf_event.h files in the source code directory to
avoid compilation compatibility problems.

Signed-off-by: Yang Jihong <yangjihong1@huawei.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Tom Rix <trix@redhat.com>
Link: https://lore.kernel.org/r/20230510064401.225051-1-yangjihong1@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/Makefile.perf
tools/perf/util/bpf_skel/vmlinux.h