Re: [PATCH 1/1] perf augmented_raw_syscalls.bpf: Move 'struct timespec64' to vmlinux.h

From: Namhyung Kim
Date: Mon Feb 05 2024 - 18:16:45 EST


On Fri, Feb 2, 2024 at 6:01 PM Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
>
> On Fri, Feb 2, 2024 at 11:35 AM Arnaldo Carvalho de Melo
> <acme@xxxxxxxxxx> wrote:
> >
> > If we instead decide to generate vmlinux.h from BTF info, it will be
> > there:
> >
> > $ pahole timespec64
> > struct timespec64 {
> > time64_t tv_sec; /* 0 8 */
> > long int tv_nsec; /* 8 8 */
> >
> > /* size: 16, cachelines: 1, members: 2 */
> > /* last cacheline: 16 bytes */
> > };
> >
> > $
> >
> > pahole manages to find it from /sys/kernel/btf/vmlinux, that is
> > generated from the kernel types.
> >
> > Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
> > Cc: Ian Rogers <irogers@xxxxxxxxxx>
> > Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
> > Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
> > Link: https://lore.kernel.org/lkml/
> > Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
>
> Acked-by: Namhyung Kim <namhyung@xxxxxxxxxx>

Hmm.. but it makes it fail to build with GEN_VMLINUX_H=1.

Thanks,
Namhyung


CLANG linux/tools/perf/util/bpf_skel/.tmp/augmented_raw_syscalls.bpf.o
In file included from util/bpf_skel/augmented_raw_syscalls.bpf.c:10:
linux/tools/include/uapi/linux/bpf.h:55:2: error: redefinition of
enumerator 'BPF_REG_0'
BPF_REG_0 = 0,
^
linux/tools/perf/util/bpf_skel/.tmp/../vmlinux.h:46833:2: note:
previous definition is here
BPF_REG_0 = 0,
^