mbox series

[bpf-next,0/8] bpf: Add cookies retrieval for perf/kprobe multi links

Message ID 20240118095416.989152-1-jolsa@kernel.org (mailing list archive)
Headers show
Series bpf: Add cookies retrieval for perf/kprobe multi links | expand

Message

Jiri Olsa Jan. 18, 2024, 9:54 a.m. UTC
hi,
this patchset adds support to retrieve cookies from existing tracing
links that still did not support it plus changes to bpftool to display
them. It's leftover we discussed some time ago [1].

thanks,
jirka


[1] https://lore.kernel.org/bpf/CALOAHbAZ6=A9j3VFCLoAC_WhgQKU7injMf06=cM2sU4Hi4Sx+Q@mail.gmail.com/
---
Jiri Olsa (8):
      bpf: Add cookie to perf_event bpf_link_info records
      bpf: Store cookies in kprobe_multi bpf_link_info data
      bpftool: Fix wrong free call in do_show_link
      selftests/bpf: Add cookies check for kprobe_multi fill_link_info test
      selftests/bpf: Add cookies check for perf_event fill_link_info test
      selftests/bpf: Add fill_link_info test for perf event
      bpftool: Display cookie for perf event link probes
      bpftool: Display cookie for kprobe multi link

 include/uapi/linux/bpf.h                                |   5 +++++
 kernel/bpf/syscall.c                                    |   4 ++++
 kernel/trace/bpf_trace.c                                |  15 +++++++++++++
 tools/bpf/bpftool/link.c                                |  87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------
 tools/include/uapi/linux/bpf.h                          |   5 +++++
 tools/testing/selftests/bpf/prog_tests/fill_link_info.c | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------
 tools/testing/selftests/bpf/progs/test_fill_link_info.c |   6 +++++
 7 files changed, 204 insertions(+), 32 deletions(-)

Comments

Yafang Shao Jan. 18, 2024, 12:42 p.m. UTC | #1
On Thu, Jan 18, 2024 at 5:54 PM Jiri Olsa <jolsa@kernel.org> wrote:
>
> hi,
> this patchset adds support to retrieve cookies from existing tracing
> links that still did not support it plus changes to bpftool to display
> them. It's leftover we discussed some time ago [1].

Thanks for your work.

bpf cookie is also displayed in the pid_iter [0]. After we add support
for the cookie for other progs like kprobe_multi and uprobe_multi, I
think we should update this file as well.

[0]. tools/bpf/bpftool/skeleton/pid_iter.bpf.c

>
> thanks,
> jirka
>
>
> [1] https://lore.kernel.org/bpf/CALOAHbAZ6=A9j3VFCLoAC_WhgQKU7injMf06=cM2sU4Hi4Sx+Q@mail.gmail.com/
> ---
> Jiri Olsa (8):
>       bpf: Add cookie to perf_event bpf_link_info records
>       bpf: Store cookies in kprobe_multi bpf_link_info data
>       bpftool: Fix wrong free call in do_show_link
>       selftests/bpf: Add cookies check for kprobe_multi fill_link_info test
>       selftests/bpf: Add cookies check for perf_event fill_link_info test
>       selftests/bpf: Add fill_link_info test for perf event
>       bpftool: Display cookie for perf event link probes
>       bpftool: Display cookie for kprobe multi link
>
>  include/uapi/linux/bpf.h                                |   5 +++++
>  kernel/bpf/syscall.c                                    |   4 ++++
>  kernel/trace/bpf_trace.c                                |  15 +++++++++++++
>  tools/bpf/bpftool/link.c                                |  87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------
>  tools/include/uapi/linux/bpf.h                          |   5 +++++
>  tools/testing/selftests/bpf/prog_tests/fill_link_info.c | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------
>  tools/testing/selftests/bpf/progs/test_fill_link_info.c |   6 +++++
>  7 files changed, 204 insertions(+), 32 deletions(-)
Jiri Olsa Jan. 19, 2024, 8:03 a.m. UTC | #2
On Thu, Jan 18, 2024 at 08:42:29PM +0800, Yafang Shao wrote:
> On Thu, Jan 18, 2024 at 5:54 PM Jiri Olsa <jolsa@kernel.org> wrote:
> >
> > hi,
> > this patchset adds support to retrieve cookies from existing tracing
> > links that still did not support it plus changes to bpftool to display
> > them. It's leftover we discussed some time ago [1].
> 
> Thanks for your work.
> 
> bpf cookie is also displayed in the pid_iter [0]. After we add support
> for the cookie for other progs like kprobe_multi and uprobe_multi, I
> think we should update this file as well.

ok, I'll check

thanks,
jirka

> 
> [0]. tools/bpf/bpftool/skeleton/pid_iter.bpf.c
> 
> >
> > thanks,
> > jirka
> >
> >
> > [1] https://lore.kernel.org/bpf/CALOAHbAZ6=A9j3VFCLoAC_WhgQKU7injMf06=cM2sU4Hi4Sx+Q@mail.gmail.com/
> > ---
> > Jiri Olsa (8):
> >       bpf: Add cookie to perf_event bpf_link_info records
> >       bpf: Store cookies in kprobe_multi bpf_link_info data
> >       bpftool: Fix wrong free call in do_show_link
> >       selftests/bpf: Add cookies check for kprobe_multi fill_link_info test
> >       selftests/bpf: Add cookies check for perf_event fill_link_info test
> >       selftests/bpf: Add fill_link_info test for perf event
> >       bpftool: Display cookie for perf event link probes
> >       bpftool: Display cookie for kprobe multi link
> >
> >  include/uapi/linux/bpf.h                                |   5 +++++
> >  kernel/bpf/syscall.c                                    |   4 ++++
> >  kernel/trace/bpf_trace.c                                |  15 +++++++++++++
> >  tools/bpf/bpftool/link.c                                |  87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------
> >  tools/include/uapi/linux/bpf.h                          |   5 +++++
> >  tools/testing/selftests/bpf/prog_tests/fill_link_info.c | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------
> >  tools/testing/selftests/bpf/progs/test_fill_link_info.c |   6 +++++
> >  7 files changed, 204 insertions(+), 32 deletions(-)
> 
> 
> 
> -- 
> Regards
> Yafang