libbpf: Add btf__str_by_offset() as a more generic variant of name_by_offset
authorAndrii Nakryiko <andriin@fb.com>
Tue, 29 Sep 2020 02:05:31 +0000 (19:05 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 29 Sep 2020 02:17:13 +0000 (19:17 -0700)
commitf86ed050bcee3b7daa420eb31a8b6d079701caab
tree279c316e5814e5159995a6e93e503e2c8f7a25fd
parent4a3b33f8579af182ebcf9c7e9304effce505500e
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
tools/lib/bpf/btf.c
tools/lib/bpf/btf.h
tools/lib/bpf/libbpf.map