Skip to content

Commit

Permalink
libbpf: Add btf__new_split() API that was declared but not implemented
Browse files Browse the repository at this point in the history
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: ba45136 ("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
  • Loading branch information
Andrii Nakryiko authored and Daniel Borkmann committed Feb 1, 2024
1 parent 93ee1eb commit c81a8ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions tools/lib/bpf/btf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
3 changes: 2 additions & 1 deletion tools/lib/bpf/libbpf.map
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

0 comments on commit c81a8ab

Please sign in to comment.