linux/tools/lib/bpf
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
..
.gitignore libbpf: Make libbpf_version.h non-auto-generated 2021-09-13 15:36:47 -07:00
bpf_core_read.h libbpf: add bpf_core_type_matches() helper macro 2022-07-05 21:15:19 -07:00
bpf_endian.h libbpf: Make bpf_endian co-exist with vmlinux.h 2020-07-01 09:06:12 +02:00
bpf_gen_internal.h Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-12-10 15:56:13 -08:00
bpf_helpers.h libbpf: Disable SEC pragma macro on GCC 2022-07-08 15:11:34 -07:00
bpf_prog_linfo.c libbpf: Streamline error reporting for high-level APIs 2021-05-25 17:32:35 -07:00
bpf_tracing.h libbpf: Ensure functions with always_inline attribute are inline 2022-08-04 14:43:41 -07:00
bpf.c libbpf: Add names for auxiliary maps 2022-08-11 15:12:38 -07:00
bpf.h libbpf: Add bpf_obj_get_opts() 2022-07-29 15:30:06 -07:00
btf_dump.c libbpf: Fix sign expansion bug in btf_dump_get_enum_value() 2022-07-21 14:24:18 +02:00
btf.c libbpf: remove deprecated BTF APIs 2022-06-28 13:13:32 -07:00
btf.h libbpf: remove deprecated BTF APIs 2022-06-28 13:13:32 -07:00
Build libbpf: move xsk.{c,h} into selftests/bpf 2022-06-28 13:13:32 -07:00
gen_loader.c libbpf: fix an snprintf() overflow check 2022-07-19 10:47:31 -07:00
hashmap.c libbpf: Use IS_ERR_OR_NULL() in hashmap__free() 2022-01-12 17:01:36 -08:00
hashmap.h libbpf, hashmap: Fix undefined behavior in hash_bits 2020-11-02 23:33:51 +01:00
libbpf_common.h libbpf: cleanup LIBBPF_DEPRECATED_SINCE supporting macros for v0.x 2022-06-28 13:13:33 -07:00
libbpf_errno.c libbpf: Streamline error reporting for high-level APIs 2021-05-25 17:32:35 -07:00
libbpf_internal.h libbpf: Fix str_has_sfx()'s return value 2022-07-21 14:30:25 +02:00
libbpf_legacy.h libbpf: fix up few libbpf.map problems 2022-06-28 13:13:33 -07:00
libbpf_probes.c libbpf: Initialize err in probe_map_create 2022-08-04 14:40:00 -07:00
libbpf_version.h libbpf: start 1.0 development cycle 2022-05-19 09:03:31 -07:00
libbpf.c libbpf: Add names for auxiliary maps 2022-08-11 15:12:38 -07:00
libbpf.h libbpf: add ksyscall/kretsyscall sections support for syscall kprobes 2022-07-19 09:33:18 -07:00
libbpf.map libbpf: Add bpf_obj_get_opts() 2022-07-29 15:30:06 -07:00
libbpf.pc.template libbpf: Add zlib as a dependency in pkg-config template 2019-12-16 14:55:29 -08:00
linker.c libbpf: Add enum64 support for bpf linking 2022-06-07 10:20:43 -07:00
Makefile libbpf: move xsk.{c,h} into selftests/bpf 2022-06-28 13:13:32 -07:00
netlink.c libbpf: remove deprecated XDP APIs 2022-06-28 13:13:32 -07:00
nlattr.c libbpf: Switch to void * casting in netlink helpers 2021-06-22 17:04:02 +02:00
nlattr.h libbpf: Switch to void * casting in netlink helpers 2021-06-22 17:04:02 +02:00
relo_core.c bpf: Correctly propagate errors up from bpf_core_composites_match 2022-07-08 15:31:43 -07:00
relo_core.h bpf, libbpf: Add type match support 2022-07-05 21:14:25 -07:00
ringbuf.c libbpf: Streamline error reporting for high-level APIs 2021-05-25 17:32:35 -07:00
skel_internal.h libbpf: Prepare light skeleton for the kernel. 2022-02-10 23:31:51 +01:00
str_error.c libbpf: Poison kernel-only integer types 2020-01-10 10:38:00 -08:00
str_error.h libbpf: relicense libbpf as LGPL-2.1 OR BSD-2-Clause 2018-10-08 10:09:48 +02:00
strset.c libbpf: Fix memory leak in strset 2021-10-01 22:54:38 +02:00
strset.h libbpf: Extract internal set-of-strings datastructure APIs 2021-03-18 16:14:22 -07:00
usdt.bpf.h libbpf: Ensure functions with always_inline attribute are inline 2022-08-04 14:43:41 -07:00
usdt.c libbpf: Remove unnecessary usdt_rel_ip assignments 2022-07-06 16:46:19 +02:00