All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] perf bpf: Check that the minimal vmlinux.h installed is the latest one
@ 2024-02-24 15:47 Arnaldo Carvalho de Melo
  2024-02-24 15:57 ` Ian Rogers
  2024-02-26 16:21 ` Namhyung Kim
  0 siblings, 2 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-02-24 15:47 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Stephen Rothwell, Ian Rogers, Linux Kernel Mailing List,
	linux-perf-users

When building BPF skels perf will, by default, install a minimalistic
vmlinux.h file with the types needed by the BPF skels in
tools/perf/util/bpf_skel/ in its build directory.

When 29d16de26df17e94 ("perf augmented_raw_syscalls.bpf: Move 'struct
timespec64' to vmlinux.h") was added, a type used in the augmented_raw_syscalls
BPF skel, 'struct timespec64' was not found when building from a pre-existing
build directory, because the vmlinux.h there didn't contain that type,
ending up with this error, spotted in linux-next:

    CLANG   /tmp/build/perf-tools-next/util/bpf_skel/.tmp/augmented_raw_syscalls.bpf.o
  util/bpf_skel/augmented_raw_syscalls.bpf.c:329:15: error: invalid application of 'sizeof' to an incomplete type 'struct timespec64'
    329 |         __u32 size = sizeof(struct timespec64);
        |                      ^     ~~~~~~~~~~~~~~~~~~~
  util/bpf_skel/augmented_raw_syscalls.bpf.c:329:29: note: forward declaration of 'struct timespec64'
    329 |         __u32 size = sizeof(struct timespec64);
        |                                    ^
  util/bpf_skel/augmented_raw_syscalls.bpf.c:350:15: error: invalid application of 'sizeof' to an incomplete type 'struct timespec64'
    350 |         __u32 size = sizeof(struct timespec64);
        |                      ^     ~~~~~~~~~~~~~~~~~~~
  util/bpf_skel/augmented_raw_syscalls.bpf.c:350:29: note: forward declaration of 'struct timespec64'
    350 |         __u32 size = sizeof(struct timespec64);
        |                                    ^
  2 errors generated.
  make[2]: *** [Makefile.perf:1158: /tmp/build/perf-tools-next/util/bpf_skel/.tmp/augmented_raw_syscalls.bpf.o] Error 1
  make[2]: *** Waiting for unfinished jobs....
  make[1]: *** [Makefile.perf:261: sub-make] Error 2
  make: *** [Makefile:113: install-bin] Error 2
  make: Leaving directory '/home/acme/git/perf-tools-next/tools/perf'

So add a Makefile dependency (Namhyung's suggestion) to make sure that
the new tools/perf/util/bpf_skel/vmlinux/vmlinux.h minimal vmlinux is
updated in the build directory, providing the moved 'struct timespec64'
type.

Fixes: 29d16de26df17e94 ("perf augmented_raw_syscalls.bpf: Move 'struct timespec64' to vmlinux.h")
Cc: Ian Rogers <irogers@google.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Link: https://lore.kernel.org/lkml/CAM9d7ciaj80QZL0AS_T2HNBdMOyS-j1wBHQSYs=U3kHQimY1mQ@mail.gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Makefile.perf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 3cecd51b239707ba..33621114135ee2c8 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -1147,7 +1147,7 @@ ifeq ($(VMLINUX_H),)
   endif
 endif
 
-$(SKEL_OUT)/vmlinux.h: $(VMLINUX_BTF) $(BPFTOOL)
+$(SKEL_OUT)/vmlinux.h: $(VMLINUX_BTF) $(BPFTOOL) $(VMLINUX_H)
 ifeq ($(VMLINUX_H),)
 	$(QUIET_GEN)$(BPFTOOL) btf dump file $< format c > $@
 else
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] perf bpf: Check that the minimal vmlinux.h installed is the latest one
  2024-02-24 15:47 [PATCH 1/1] perf bpf: Check that the minimal vmlinux.h installed is the latest one Arnaldo Carvalho de Melo
@ 2024-02-24 15:57 ` Ian Rogers
  2024-02-24 19:18   ` Namhyung Kim
  2024-02-26 16:21 ` Namhyung Kim
  1 sibling, 1 reply; 4+ messages in thread
From: Ian Rogers @ 2024-02-24 15:57 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Namhyung Kim, Stephen Rothwell, Linux Kernel Mailing List,
	linux-perf-users

On Sat, Feb 24, 2024 at 7:48 AM Arnaldo Carvalho de Melo
<acme@kernel.org> wrote:
>
> When building BPF skels perf will, by default, install a minimalistic
> vmlinux.h file with the types needed by the BPF skels in
> tools/perf/util/bpf_skel/ in its build directory.
>
> When 29d16de26df17e94 ("perf augmented_raw_syscalls.bpf: Move 'struct
> timespec64' to vmlinux.h") was added, a type used in the augmented_raw_syscalls
> BPF skel, 'struct timespec64' was not found when building from a pre-existing
> build directory, because the vmlinux.h there didn't contain that type,
> ending up with this error, spotted in linux-next:
>
>     CLANG   /tmp/build/perf-tools-next/util/bpf_skel/.tmp/augmented_raw_syscalls.bpf.o
>   util/bpf_skel/augmented_raw_syscalls.bpf.c:329:15: error: invalid application of 'sizeof' to an incomplete type 'struct timespec64'
>     329 |         __u32 size = sizeof(struct timespec64);
>         |                      ^     ~~~~~~~~~~~~~~~~~~~
>   util/bpf_skel/augmented_raw_syscalls.bpf.c:329:29: note: forward declaration of 'struct timespec64'
>     329 |         __u32 size = sizeof(struct timespec64);
>         |                                    ^
>   util/bpf_skel/augmented_raw_syscalls.bpf.c:350:15: error: invalid application of 'sizeof' to an incomplete type 'struct timespec64'
>     350 |         __u32 size = sizeof(struct timespec64);
>         |                      ^     ~~~~~~~~~~~~~~~~~~~
>   util/bpf_skel/augmented_raw_syscalls.bpf.c:350:29: note: forward declaration of 'struct timespec64'
>     350 |         __u32 size = sizeof(struct timespec64);
>         |                                    ^
>   2 errors generated.
>   make[2]: *** [Makefile.perf:1158: /tmp/build/perf-tools-next/util/bpf_skel/.tmp/augmented_raw_syscalls.bpf.o] Error 1
>   make[2]: *** Waiting for unfinished jobs....
>   make[1]: *** [Makefile.perf:261: sub-make] Error 2
>   make: *** [Makefile:113: install-bin] Error 2
>   make: Leaving directory '/home/acme/git/perf-tools-next/tools/perf'
>
> So add a Makefile dependency (Namhyung's suggestion) to make sure that
> the new tools/perf/util/bpf_skel/vmlinux/vmlinux.h minimal vmlinux is
> updated in the build directory, providing the moved 'struct timespec64'
> type.
>
> Fixes: 29d16de26df17e94 ("perf augmented_raw_syscalls.bpf: Move 'struct timespec64' to vmlinux.h")
> Cc: Ian Rogers <irogers@google.com>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Link: https://lore.kernel.org/lkml/CAM9d7ciaj80QZL0AS_T2HNBdMOyS-j1wBHQSYs=U3kHQimY1mQ@mail.gmail.com
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Reviewed-by: Ian Rogers <irogers@google.com>

Thanks,
Ian

> ---
>  tools/perf/Makefile.perf | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
> index 3cecd51b239707ba..33621114135ee2c8 100644
> --- a/tools/perf/Makefile.perf
> +++ b/tools/perf/Makefile.perf
> @@ -1147,7 +1147,7 @@ ifeq ($(VMLINUX_H),)
>    endif
>  endif
>
> -$(SKEL_OUT)/vmlinux.h: $(VMLINUX_BTF) $(BPFTOOL)
> +$(SKEL_OUT)/vmlinux.h: $(VMLINUX_BTF) $(BPFTOOL) $(VMLINUX_H)
>  ifeq ($(VMLINUX_H),)
>         $(QUIET_GEN)$(BPFTOOL) btf dump file $< format c > $@
>  else
> --
> 2.43.0
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] perf bpf: Check that the minimal vmlinux.h installed is the latest one
  2024-02-24 15:57 ` Ian Rogers
@ 2024-02-24 19:18   ` Namhyung Kim
  0 siblings, 0 replies; 4+ messages in thread
From: Namhyung Kim @ 2024-02-24 19:18 UTC (permalink / raw)
  To: Ian Rogers
  Cc: Arnaldo Carvalho de Melo, Stephen Rothwell,
	Linux Kernel Mailing List, linux-perf-users

On Sat, Feb 24, 2024 at 7:57 AM Ian Rogers <irogers@google.com> wrote:
>
> On Sat, Feb 24, 2024 at 7:48 AM Arnaldo Carvalho de Melo
> <acme@kernel.org> wrote:
> >
> > When building BPF skels perf will, by default, install a minimalistic
> > vmlinux.h file with the types needed by the BPF skels in
> > tools/perf/util/bpf_skel/ in its build directory.
> >
> > When 29d16de26df17e94 ("perf augmented_raw_syscalls.bpf: Move 'struct
> > timespec64' to vmlinux.h") was added, a type used in the augmented_raw_syscalls
> > BPF skel, 'struct timespec64' was not found when building from a pre-existing
> > build directory, because the vmlinux.h there didn't contain that type,
> > ending up with this error, spotted in linux-next:
> >
> >     CLANG   /tmp/build/perf-tools-next/util/bpf_skel/.tmp/augmented_raw_syscalls.bpf.o
> >   util/bpf_skel/augmented_raw_syscalls.bpf.c:329:15: error: invalid application of 'sizeof' to an incomplete type 'struct timespec64'
> >     329 |         __u32 size = sizeof(struct timespec64);
> >         |                      ^     ~~~~~~~~~~~~~~~~~~~
> >   util/bpf_skel/augmented_raw_syscalls.bpf.c:329:29: note: forward declaration of 'struct timespec64'
> >     329 |         __u32 size = sizeof(struct timespec64);
> >         |                                    ^
> >   util/bpf_skel/augmented_raw_syscalls.bpf.c:350:15: error: invalid application of 'sizeof' to an incomplete type 'struct timespec64'
> >     350 |         __u32 size = sizeof(struct timespec64);
> >         |                      ^     ~~~~~~~~~~~~~~~~~~~
> >   util/bpf_skel/augmented_raw_syscalls.bpf.c:350:29: note: forward declaration of 'struct timespec64'
> >     350 |         __u32 size = sizeof(struct timespec64);
> >         |                                    ^
> >   2 errors generated.
> >   make[2]: *** [Makefile.perf:1158: /tmp/build/perf-tools-next/util/bpf_skel/.tmp/augmented_raw_syscalls.bpf.o] Error 1
> >   make[2]: *** Waiting for unfinished jobs....
> >   make[1]: *** [Makefile.perf:261: sub-make] Error 2
> >   make: *** [Makefile:113: install-bin] Error 2
> >   make: Leaving directory '/home/acme/git/perf-tools-next/tools/perf'
> >
> > So add a Makefile dependency (Namhyung's suggestion) to make sure that
> > the new tools/perf/util/bpf_skel/vmlinux/vmlinux.h minimal vmlinux is
> > updated in the build directory, providing the moved 'struct timespec64'
> > type.
> >
> > Fixes: 29d16de26df17e94 ("perf augmented_raw_syscalls.bpf: Move 'struct timespec64' to vmlinux.h")
> > Cc: Ian Rogers <irogers@google.com>
> > Cc: Namhyung Kim <namhyung@kernel.org>
> > Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > Link: https://lore.kernel.org/lkml/CAM9d7ciaj80QZL0AS_T2HNBdMOyS-j1wBHQSYs=U3kHQimY1mQ@mail.gmail.com
> > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> Reviewed-by: Ian Rogers <irogers@google.com>

Suggested-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] perf bpf: Check that the minimal vmlinux.h installed is the latest one
  2024-02-24 15:47 [PATCH 1/1] perf bpf: Check that the minimal vmlinux.h installed is the latest one Arnaldo Carvalho de Melo
  2024-02-24 15:57 ` Ian Rogers
@ 2024-02-26 16:21 ` Namhyung Kim
  1 sibling, 0 replies; 4+ messages in thread
From: Namhyung Kim @ 2024-02-26 16:21 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Linux Kernel Mailing List, linux-perf-users, Stephen Rothwell,
	Ian Rogers

On Sat, 24 Feb 2024 12:47:57 -0300, Arnaldo Carvalho de Melo wrote:
> When building BPF skels perf will, by default, install a minimalistic
> vmlinux.h file with the types needed by the BPF skels in
> tools/perf/util/bpf_skel/ in its build directory.
> 
> When 29d16de26df17e94 ("perf augmented_raw_syscalls.bpf: Move 'struct
> timespec64' to vmlinux.h") was added, a type used in the augmented_raw_syscalls
> BPF skel, 'struct timespec64' was not found when building from a pre-existing
> build directory, because the vmlinux.h there didn't contain that type,
> ending up with this error, spotted in linux-next:
> 
> [...]

Applied to perf-tools-next, thanks!

Best regards,
-- 
Namhyung Kim <namhyung@kernel.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-02-26 16:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-24 15:47 [PATCH 1/1] perf bpf: Check that the minimal vmlinux.h installed is the latest one Arnaldo Carvalho de Melo
2024-02-24 15:57 ` Ian Rogers
2024-02-24 19:18   ` Namhyung Kim
2024-02-26 16:21 ` Namhyung Kim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.