linux/tools/lib
Hangbin Liu 10b62d6a38 libbpf: Add names for auxiliary maps
The bpftool self-created maps can appear in final map show output due to
deferred removal in kernel. These maps don't have a name, which would make
users confused about where it comes from.

With a libbpf_ prefix name, users could know who created these maps.
It also could make some tests (like test_offload.py, which skip base maps
without names as a workaround) filter them out.

Kernel adds bpf prog/map name support in the same merge
commit fadad670a8 ("Merge branch 'bpf-extend-info'"). So we can also use
kernel_supports(NULL, FEAT_PROG_NAME) to check if kernel supports map name.

As discussed [1], Let's make bpf_map_create accept non-null
name string, and silently ignore the name if kernel doesn't support.

  [1] https://lore.kernel.org/bpf/CAEf4BzYL1TQwo1231s83pjTdFPk9XWWhfZC5=KzkU-VO0k=0Ug@mail.gmail.com/

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20220811034020.529685-1-liuhangbin@gmail.com
2022-08-11 15:12:38 -07:00
..
api Kbuild updates for v5.18 2022-03-31 11:59:03 -07:00
bpf libbpf: Add names for auxiliary maps 2022-08-11 15:12:38 -07:00
perf libperf evsel: Open shouldn't leak fd on failure 2022-06-19 10:41:43 -03:00
subcmd libsubcmd: Fix OPTION_GROUP sorting 2022-04-22 12:32:01 +02:00
symbol libsymbols kallsyms: Move hex2u64 out of header 2020-05-05 16:35:32 -03:00
thermal tools/lib/thermal: remove unneeded semicolon 2022-05-19 12:11:52 +02:00
traceevent libtraceevent: Add __rel_loc relative location attribute support 2021-12-06 15:37:22 -05:00
argv_split.c tools lib: Move argv_{split,free} from tools/perf/util/ 2019-07-01 22:50:40 -03:00
bitmap.c bitmap: Fix return values to be unsigned 2022-06-03 06:52:58 -07:00
ctype.c
find_bit.c tools: sync tools/bitmap with mother linux 2022-01-15 08:47:31 -08:00
hweight.c
list_sort.c tools lib: Adopt list_sort() from the kernel sources 2021-10-20 10:30:59 -03:00
rbtree.c tools/: replace HTTP links with HTTPS ones 2020-08-07 11:33:21 -07:00
slab.c tools: Move gfp.h and slab.h from radix-tree to lib 2022-02-20 08:44:37 +02:00
str_error_r.c
string.c tools lib: Adopt memchr_inv() from kernel 2020-11-27 08:34:52 -03:00
vsprintf.c
zalloc.c tools lib: Adopt zalloc()/zfree() from tools/perf 2019-07-09 10:13:26 -03:00