]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
libbpf: Add btf__new_split() API that was declared but not implemented
authorAndrii Nakryiko <andrii@kernel.org>
Thu, 1 Feb 2024 17:20:25 +0000 (09:20 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 1 Feb 2024 21:16:12 +0000 (22:16 +0100)
Seems like original commit adding split BTF support intended to add
btf__new_split() API, and even declared it in libbpf.map, but never
added (trivial) implementation. Fix this.

Fixes: ba451366bf44 ("libbpf: Implement basic split BTF support")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/bpf/20240201172027.604869-4-andrii@kernel.org
tools/lib/bpf/btf.c
tools/lib/bpf/libbpf.map

index 95db88b36cf3108f362d0eea7bd1abd89c9ef82f..845034d1542064e1981316c660c346d43be50cfc 100644 (file)
@@ -1079,6 +1079,11 @@ struct btf *btf__new(const void *data, __u32 size)
        return libbpf_ptr(btf_new(data, size, NULL));
 }
 
+struct btf *btf__new_split(const void *data, __u32 size, struct btf *base_btf)
+{
+       return libbpf_ptr(btf_new(data, size, base_btf));
+}
+
 static struct btf *btf_parse_elf(const char *path, struct btf *base_btf,
                                 struct btf_ext **btf_ext)
 {
index d9e1f57534fa7fb7dde853f4b5424aa6139c4c51..386964f572a8ff31fcabecfcc769f51b349505f5 100644 (file)
@@ -245,7 +245,6 @@ LIBBPF_0.3.0 {
                btf__parse_raw_split;
                btf__parse_split;
                btf__new_empty_split;
-               btf__new_split;
                ring_buffer__epoll_fd;
 } LIBBPF_0.2.0;
 
@@ -411,5 +410,7 @@ LIBBPF_1.3.0 {
 } LIBBPF_1.2.0;
 
 LIBBPF_1.4.0 {
+       global:
                bpf_token_create;
+               btf__new_split;
 } LIBBPF_1.3.0;