Re: [PATCH bpf-next v5] libbpf: introduce legacy kprobe events support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 13, 2021 at 10:03 PM Rafael David Tinoco
<rafaeldtinoco@xxxxxxxxx> wrote:
>
>
> >> Allow kprobe tracepoint events creation through legacy interface, as the
> >> kprobe dynamic PMUs support, used by default, was only created in v4.17.
> >>
> >> After commit "bpf: implement minimal BPF perf link", it was allowed that
> >> some extra - to the link - information is accessed through container_of
> >> struct bpf_link. This allows the tracing perf event legacy name, and
> >> information whether it is a retprobe, to be saved outside bpf_link
> >> structure, which would not be optimal.
> >>
> >> This enables CO-RE support for older kernels.
> >>
> >> Cc: Andrii Nakryiko <andrii.nakryiko@xxxxxxxxx>
> >> Signed-off-by: Rafael David Tinoco <rafaeldtinoco@xxxxxxxxx>
> >> ---
> >
> > I've adjusted the commit message a bit (this has nothing to do with
> > CO-RE per se, so I dropped that, for example). Also see my comments
> > below, I've applied all that to your patch while applying, please
> > check them out.
>
> Thanks. I'm assuming you don't need a v6 based on your adjustment comments, let me know if you do please.
>

Nope, I've applied it to bpf-next.

> ...
>
> >>
> >> -       if (ioctl(perf_link->perf_event_fd, PERF_EVENT_IOC_DISABLE, 0) < 0)
> >> -               err = -errno;
> >> +       ioctl(perf_link->perf_event_fd, PERF_EVENT_IOC_DISABLE, 0);
> >
> > what's the reason for dropping the error check? I kept it, but please
> > let me know if there is any reason to drop it
>
> From: _perf_ioctl() -> case PERF_EVENT_IOC_DISABLE: func = _perf_event_disable;
>
> _perf_ioctl() will always return 0 and func is void (*func)(struct perf_event *).
>

And what about all the future kernels? This is an unnecessary
assumption that it will always succeed.



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux