Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bpftool: Update the lists of names for maps and prog-attach types

To support the different BPF map or attach types, bpftool must remain
up-to-date with the types supported by the kernel. Let's update the
lists, by adding the missing Bloom filter map type and the perf_event
attach type.

Both missing items were found with test_bpftool_synctypes.py.

Signed-off-by: Quentin Monnet <quentin@isovalent.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20211110114632.24537-6-quentin@isovalent.com

authored by

Quentin Monnet and committed by
Andrii Nakryiko
3811e275 986dec18

+6 -3
+1 -1
tools/bpf/bpftool/Documentation/bpftool-map.rst
··· 52 52 | | **devmap** | **devmap_hash** | **sockmap** | **cpumap** | **xskmap** | **sockhash** 53 53 | | **cgroup_storage** | **reuseport_sockarray** | **percpu_cgroup_storage** 54 54 | | **queue** | **stack** | **sk_storage** | **struct_ops** | **ringbuf** | **inode_storage** 55 - | **task_storage** } 55 + | | **task_storage** | **bloom_filter** } 56 56 57 57 DESCRIPTION 58 58 ===========
+2 -1
tools/bpf/bpftool/bash-completion/bpftool
··· 710 710 hash_of_maps devmap devmap_hash sockmap cpumap \ 711 711 xskmap sockhash cgroup_storage reuseport_sockarray \ 712 712 percpu_cgroup_storage queue stack sk_storage \ 713 - struct_ops inode_storage task_storage ringbuf' 713 + struct_ops ringbuf inode_storage task_storage \ 714 + bloom_filter' 714 715 COMPREPLY=( $( compgen -W "$BPFTOOL_MAP_CREATE_TYPES" -- "$cur" ) ) 715 716 return 0 716 717 ;;
+1
tools/bpf/bpftool/common.c
··· 74 74 [BPF_XDP] = "xdp", 75 75 [BPF_SK_REUSEPORT_SELECT] = "sk_skb_reuseport_select", 76 76 [BPF_SK_REUSEPORT_SELECT_OR_MIGRATE] = "sk_skb_reuseport_select_or_migrate", 77 + [BPF_PERF_EVENT] = "perf_event", 77 78 }; 78 79 79 80 void p_err(const char *fmt, ...)
+2 -1
tools/bpf/bpftool/map.c
··· 53 53 [BPF_MAP_TYPE_RINGBUF] = "ringbuf", 54 54 [BPF_MAP_TYPE_INODE_STORAGE] = "inode_storage", 55 55 [BPF_MAP_TYPE_TASK_STORAGE] = "task_storage", 56 + [BPF_MAP_TYPE_BLOOM_FILTER] = "bloom_filter", 56 57 }; 57 58 58 59 const size_t map_type_name_size = ARRAY_SIZE(map_type_name); ··· 1478 1477 " devmap | devmap_hash | sockmap | cpumap | xskmap | sockhash |\n" 1479 1478 " cgroup_storage | reuseport_sockarray | percpu_cgroup_storage |\n" 1480 1479 " queue | stack | sk_storage | struct_ops | ringbuf | inode_storage |\n" 1481 - " task_storage }\n" 1480 + " task_storage | bloom_filter }\n" 1482 1481 " " HELP_SPEC_OPTIONS " |\n" 1483 1482 " {-f|--bpffs} | {-n|--nomount} }\n" 1484 1483 "",