• Andrey Ignatov's avatar
    libbpf: Introduce bpf_object__btf · 789f6bab
    Andrey Ignatov authored
    Add new accessor for bpf_object to get opaque struct btf * from it.
    
    struct btf * is needed for all operations with BTF and it's present in
    bpf_object. The only thing missing is a way to get it.
    
    Example use-case is to get BTF key_type_id and value_type_id for a map in
    bpf_object. It can be done with btf__get_map_kv_tids() but that function
    requires struct btf *.
    
    Similar API can be added for struct btf_ext but no use-case for it yet.
    Signed-off-by: default avatarAndrey Ignatov <rdna@fb.com>
    Acked-by: default avatarYonghong Song <yhs@fb.com>
    Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
    789f6bab
libbpf.c 67.2 KB