Re: [RFC PATCH v3] bpftool: Add bpf_cookie to link output

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

 



> On Wed, Feb 23, 2022 at 01:46:56PM -0800, Andrii Nakryiko wrote:
> On Thu, Feb 17, 2022 at 11:51 PM Dmitrii Dolgov <9erthalion6@xxxxxxxxx> wrote:
> >
> > +static __always_inline __u64 get_bpf_cookie(struct bpf_link *link)
> > +{
> > +       struct bpf_perf_link *perf_link;
> > +       struct perf_event *event;
> > +
> > +       perf_link = container_of(link, struct bpf_perf_link, link);
> > +       event = BPF_CORE_READ(perf_link, perf_file, private_data);
> > +       return BPF_CORE_READ(event, bpf_cookie);
>
> not every bpf_link is bpf_perf_link, you can't do it for every
> instance of bpf_link.

Right, thanks. I was somehow testing it only with perf links, will fix.



[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