Re: [External] Re: [PATCH bpf-next v2 7/9] libbpf: don't free btf if program of multi-link tracing existing

2024-03-11 Thread 梦龙董
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.

Re: [External] Re: [PATCH bpf-next v2 7/9] libbpf: don't free btf if program of multi-link tracing existing

2024-03-11 Thread Alexei Starovoitov
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

Re: [External] Re: [PATCH bpf-next v2 7/9] libbpf: don't free btf if program of multi-link tracing existing

2024-03-11 Thread 梦龙董
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

Re: [PATCH bpf-next v2 7/9] libbpf: don't free btf if program of multi-link tracing existing

2024-03-11 Thread Alexei Starovoitov
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

[PATCH bpf-next v2 7/9] libbpf: don't free btf if program of multi-link tracing existing

2024-03-11 Thread Menglong Dong
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