bpftool: Update the lists of names for maps and prog-attach types
authorQuentin Monnet <quentin@isovalent.com>
Wed, 10 Nov 2021 11:46:31 +0000 (11:46 +0000)
committerAndrii Nakryiko <andrii@kernel.org>
Mon, 15 Nov 2021 02:35:02 +0000 (18:35 -0800)
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
tools/bpf/bpftool/Documentation/bpftool-map.rst
tools/bpf/bpftool/bash-completion/bpftool
tools/bpf/bpftool/common.c
tools/bpf/bpftool/map.c

index 1445cadc15d4cba8646f457e176a1006d65e5286..991d18fd84f277311aa2945833daf5598cbff932 100644 (file)
@@ -52,7 +52,7 @@ MAP COMMANDS
 |              | **devmap** | **devmap_hash** | **sockmap** | **cpumap** | **xskmap** | **sockhash**
 |              | **cgroup_storage** | **reuseport_sockarray** | **percpu_cgroup_storage**
 |              | **queue** | **stack** | **sk_storage** | **struct_ops** | **ringbuf** | **inode_storage**
-               | **task_storage** }
+|              | **task_storage** | **bloom_filter** }
 
 DESCRIPTION
 ===========
index 4a1b02ff72c1cf0b695425c05bfdbaa989b6408e..493753a4962e97693cdddc7632105c571d5748b5 100644 (file)
@@ -710,7 +710,8 @@ _bpftool()
                                 hash_of_maps devmap devmap_hash sockmap cpumap \
                                 xskmap sockhash cgroup_storage reuseport_sockarray \
                                 percpu_cgroup_storage queue stack sk_storage \
-                                struct_ops inode_storage task_storage ringbuf'
+                                struct_ops ringbuf inode_storage task_storage \
+                                bloom_filter'
                             COMPREPLY=( $( compgen -W "$BPFTOOL_MAP_CREATE_TYPES" -- "$cur" ) )
                             return 0
                             ;;
index 511eccdbdfe6df2dd7fe147cd2b634529e27a46a..fa8eb813434496f358c025d1c88180f8ab464c07 100644 (file)
@@ -74,6 +74,7 @@ const char * const attach_type_name[__MAX_BPF_ATTACH_TYPE] = {
        [BPF_XDP]                       = "xdp",
        [BPF_SK_REUSEPORT_SELECT]       = "sk_skb_reuseport_select",
        [BPF_SK_REUSEPORT_SELECT_OR_MIGRATE]    = "sk_skb_reuseport_select_or_migrate",
+       [BPF_PERF_EVENT]                = "perf_event",
 };
 
 void p_err(const char *fmt, ...)
index cae1f11192969ab42af6315bfaaacfb99d0c4a95..68cb121e65c4bf34bf200510faa6c6a901f67f6c 100644 (file)
@@ -53,6 +53,7 @@ const char * const map_type_name[] = {
        [BPF_MAP_TYPE_RINGBUF]                  = "ringbuf",
        [BPF_MAP_TYPE_INODE_STORAGE]            = "inode_storage",
        [BPF_MAP_TYPE_TASK_STORAGE]             = "task_storage",
+       [BPF_MAP_TYPE_BLOOM_FILTER]             = "bloom_filter",
 };
 
 const size_t map_type_name_size = ARRAY_SIZE(map_type_name);
@@ -1477,7 +1478,7 @@ static int do_help(int argc, char **argv)
                "                 devmap | devmap_hash | sockmap | cpumap | xskmap | sockhash |\n"
                "                 cgroup_storage | reuseport_sockarray | percpu_cgroup_storage |\n"
                "                 queue | stack | sk_storage | struct_ops | ringbuf | inode_storage |\n"
-               "                 task_storage }\n"
+               "                 task_storage | bloom_filter }\n"
                "       " HELP_SPEC_OPTIONS " |\n"
                "                    {-f|--bpffs} | {-n|--nomount} }\n"
                "",