Re: [PATCH] perf bpf skels: vmlinux.h uses bpf.h and perf_event.h in the source directory

From: Yang Jihong
Date: Wed May 10 2023 - 02:48:01 EST


Hello,

On 2023/5/10 2:21, Arnaldo Carvalho de Melo wrote:
Em Tue, May 09, 2023 at 06:36:49AM +0000, Yang Jihong escreveu:
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;


Can this be solved in the Makefile directives for building BPF targets?

OK, will send v2 patch, use Makefile to specify path of header file that is preferentially used. Pls check whether the solution is OK.

Thanks,
Yang