On Tue, Mar 12, 2024 at 10:13 AM Alexei Starovoitov
wrote:
>
> On Mon, Mar 11, 2024 at 7:05 PM 梦龙董 wrote:
> >
> > > >
> > > > +LIBBPF_API void bpf_object__free_btfs(struct bpf_object *obj);
> > > > +
> > >
> > > It shouldn't be exported.
> > > libbpf should clean it up when bpf_object is freed.
On Mon, Mar 11, 2024 at 7:05 PM 梦龙董 wrote:
>
> > >
> > > +LIBBPF_API void bpf_object__free_btfs(struct bpf_object *obj);
> > > +
> >
> > It shouldn't be exported.
> > libbpf should clean it up when bpf_object is freed.
>
> Yes, libbpf will clean up the btfs when bpf_object is freed in
> this
On Tue, Mar 12, 2024 at 9:55 AM Alexei Starovoitov
wrote:
>
> On Mon, Mar 11, 2024 at 2:35 AM Menglong Dong
> wrote:
> >
> > By default, the kernel btf that we load during loading program will be
> > freed after the programs are loaded in bpf_object_load(). However, we
> > still need to use
On Mon, Mar 11, 2024 at 2:35 AM Menglong Dong
wrote:
>
> By default, the kernel btf that we load during loading program will be
> freed after the programs are loaded in bpf_object_load(). However, we
> still need to use these btf for tracing of multi-link during attaching.
> Therefore, we don't
By default, the kernel btf that we load during loading program will be
freed after the programs are loaded in bpf_object_load(). However, we
still need to use these btf for tracing of multi-link during attaching.
Therefore, we don't free the btfs until the bpf object is closed if any
bpf programs