diff options
| author | Quentin Monnet <[email protected]> | 2019-08-20 09:31:53 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2019-08-20 16:51:06 +0000 |
| commit | 09d7c2e32b6e06d58fe7a5aa38847f4719ab4cc7 (patch) | |
| tree | 468ec4aa0449a0e88497e2ab306f567dda65f0bf /tools/lib/bpf/bpf.c | |
| parent | libbpf: refactor bpf_*_get_next_id() functions (diff) | |
| download | kernel-09d7c2e32b6e06d58fe7a5aa38847f4719ab4cc7.tar.gz kernel-09d7c2e32b6e06d58fe7a5aa38847f4719ab4cc7.zip | |
libbpf: add bpf_btf_get_next_id() to cycle through BTF objects
Add an API function taking a BTF object id and providing the id of the
next BTF object in the kernel. This can be used to list all BTF objects
loaded on the system.
v2:
- Rebase on top of Andrii's changes regarding libbpf versioning.
Signed-off-by: Quentin Monnet <[email protected]>
Reviewed-by: Jakub Kicinski <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/lib/bpf/bpf.c')
| -rw-r--r-- | tools/lib/bpf/bpf.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c index 1439e99c9be5..cbb933532981 100644 --- a/tools/lib/bpf/bpf.c +++ b/tools/lib/bpf/bpf.c @@ -593,6 +593,11 @@ int bpf_map_get_next_id(__u32 start_id, __u32 *next_id) return bpf_obj_get_next_id(start_id, next_id, BPF_MAP_GET_NEXT_ID); } +int bpf_btf_get_next_id(__u32 start_id, __u32 *next_id) +{ + return bpf_obj_get_next_id(start_id, next_id, BPF_BTF_GET_NEXT_ID); +} + int bpf_prog_get_fd_by_id(__u32 id) { union bpf_attr attr; |
