diff options
author | Andrii Nakryiko <andriin@fb.com> | 2020-09-29 04:05:31 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-09-29 04:17:13 +0200 |
commit | f86ed050bcee3b7daa420eb31a8b6d079701caab (patch) | |
tree | 279c316e5814e5159995a6e93e503e2c8f7a25fd /tools/lib/bpf/btf.h | |
parent | libbpf: Add BTF writing APIs (diff) | |
download | linux-f86ed050bcee3b7daa420eb31a8b6d079701caab.tar.xz linux-f86ed050bcee3b7daa420eb31a8b6d079701caab.zip |
libbpf: Add btf__str_by_offset() as a more generic variant of name_by_offset
BTF strings are used not just for names, they can be arbitrary strings used
for CO-RE relocations, line/func infos, etc. Thus "name_by_offset" terminology
is too specific and might be misleading. Instead, introduce
btf__str_by_offset() API which uses generic string terminology.
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20200929020533.711288-3-andriin@fb.com
Diffstat (limited to 'tools/lib/bpf/btf.h')
-rw-r--r-- | tools/lib/bpf/btf.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/lib/bpf/btf.h b/tools/lib/bpf/btf.h index d6629a2e8ebf..f7dec0144c3c 100644 --- a/tools/lib/bpf/btf.h +++ b/tools/lib/bpf/btf.h @@ -49,6 +49,7 @@ LIBBPF_API int btf__fd(const struct btf *btf); LIBBPF_API void btf__set_fd(struct btf *btf, int fd); LIBBPF_API const void *btf__get_raw_data(const struct btf *btf, __u32 *size); LIBBPF_API const char *btf__name_by_offset(const struct btf *btf, __u32 offset); +LIBBPF_API const char *btf__str_by_offset(const struct btf *btf, __u32 offset); LIBBPF_API int btf__get_from_id(__u32 id, struct btf **btf); LIBBPF_API int btf__get_map_kv_tids(const struct btf *btf, const char *map_name, __u32 expected_key_size, |