lkml.org 
[lkml]   [2024]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [External] Re: [PATCH bpf-next v2 7/9] libbpf: don't free btf if program of multi-link tracing existing
    On Mon, Mar 11, 2024 at 7:05 PM 梦龙董 <dongmenglong.8@bytedance.com> 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 commit. And I'm trying to offer a way to early free the btfs
    > by the users manual to reduce the memory usage. Or, the
    > btfs that we opened will keep existing until we close the
    > bpf_object.
    >
    > This is optional, I can remove it if you prefer.

    Let's not extend libbpf api unless we really need to.
    bpf_program__attach_trace_multi_opts() and
    *skel*__attach() can probably free them.
    I don't see a use case where you'd want to keep them afterwards.

    \
     
     \ /
      Last update: 2024-05-27 15:44    [W:5.793 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site