Re: [PATCH bpf-next] libbpf: allow disabling auto attach

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

 



On Tue, Aug 16, 2022 at 3:55 PM Andrii Nakryiko
<andrii.nakryiko@xxxxxxxxx> wrote:
>
> On Tue, Aug 16, 2022 at 3:16 PM Hao Luo <haoluo@xxxxxxxxxx> wrote:
> >
> > On Tue, Aug 16, 2022 at 3:01 PM Andrii Nakryiko
> > <andrii.nakryiko@xxxxxxxxx> wrote:
> > >
> > > On Tue, Aug 16, 2022 at 2:49 PM Hao Luo <haoluo@xxxxxxxxxx> wrote:
> > > >
> > > > Add libbpf APIs for disabling auto-attach for individual functions.
> > > > This is motivated by the use case of cgroup iter [1]. Some iter
> > > > types require their parameters to be non-zero, therefore applying
> > > > auto-attach on them will fail. With these two new APIs, Users who
> > > > want to use auto-attach and these types of iters can disable
> > > > auto-attach for them and perform manual attach.
> > > >
> > > > [1] https://lore.kernel.org/bpf/CAEf4BzZ+a2uDo_t6kGBziqdz--m2gh2_EUwkGLDtMd65uwxUjA@xxxxxxxxxxxxxx/
> > > >
> > > > Signed-off-by: Hao Luo <haoluo@xxxxxxxxxx>
> > > > ---
[...]
> > > > diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
> > > > index 61493c4cddac..88a1ac34b12a 100644
> > > > --- a/tools/lib/bpf/libbpf.h
> > > > +++ b/tools/lib/bpf/libbpf.h
> > > > @@ -260,6 +260,8 @@ LIBBPF_API const char *bpf_program__name(const struct bpf_program *prog);
> > > >  LIBBPF_API const char *bpf_program__section_name(const struct bpf_program *prog);
> > > >  LIBBPF_API bool bpf_program__autoload(const struct bpf_program *prog);
> > > >  LIBBPF_API int bpf_program__set_autoload(struct bpf_program *prog, bool autoload);
> > > > +LIBBPF_API bool bpf_program__autoattach(const struct bpf_program *prog);
> > > > +LIBBPF_API void bpf_program__set_autoattach(struct bpf_program *prog, bool autoattach);
> > >
> > > please add these APIs to libbpf.map as well
> > >
> >
> > Ok. Which section? LIBBPF_1.0.0? Do the items in each section have a
> > particular order?
>
> Yes, 1.0.0 section. All the functions are sorted alphabetically.
>

Thanks for confirming. :)



[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