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

bpftool: Add support for task local storage

Updates the binary to handle the BPF_MAP_TYPE_TASK_STORAGE as
"task_storage" for printing and parsing. Also updates the documentation
and bash completion

Signed-off-by: KP Singh <kpsingh@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20201106103747.2780972-5-kpsingh@chromium.org

authored by

KP Singh and committed by
Alexei Starovoitov
864ab061 8885274d

+6 -3
+2 -1
tools/bpf/bpftool/Documentation/bpftool-map.rst
··· 50 50 | | **lru_percpu_hash** | **lpm_trie** | **array_of_maps** | **hash_of_maps** 51 51 | | **devmap** | **devmap_hash** | **sockmap** | **cpumap** | **xskmap** | **sockhash** 52 52 | | **cgroup_storage** | **reuseport_sockarray** | **percpu_cgroup_storage** 53 - | | **queue** | **stack** | **sk_storage** | **struct_ops** | **ringbuf** | **inode_storage** } 53 + | | **queue** | **stack** | **sk_storage** | **struct_ops** | **ringbuf** | **inode_storage** 54 + | **task_storage** } 54 55 55 56 DESCRIPTION 56 57 ===========
+1 -1
tools/bpf/bpftool/bash-completion/bpftool
··· 705 705 hash_of_maps devmap devmap_hash sockmap cpumap \ 706 706 xskmap sockhash cgroup_storage reuseport_sockarray \ 707 707 percpu_cgroup_storage queue stack sk_storage \ 708 - struct_ops inode_storage' -- \ 708 + struct_ops inode_storage task_storage' -- \ 709 709 "$cur" ) ) 710 710 return 0 711 711 ;;
+3 -1
tools/bpf/bpftool/map.c
··· 51 51 [BPF_MAP_TYPE_STRUCT_OPS] = "struct_ops", 52 52 [BPF_MAP_TYPE_RINGBUF] = "ringbuf", 53 53 [BPF_MAP_TYPE_INODE_STORAGE] = "inode_storage", 54 + [BPF_MAP_TYPE_TASK_STORAGE] = "task_storage", 54 55 }; 55 56 56 57 const size_t map_type_name_size = ARRAY_SIZE(map_type_name); ··· 1465 1464 " lru_percpu_hash | lpm_trie | array_of_maps | hash_of_maps |\n" 1466 1465 " devmap | devmap_hash | sockmap | cpumap | xskmap | sockhash |\n" 1467 1466 " cgroup_storage | reuseport_sockarray | percpu_cgroup_storage |\n" 1468 - " queue | stack | sk_storage | struct_ops | ringbuf | inode_storage }\n" 1467 + " queue | stack | sk_storage | struct_ops | ringbuf | inode_storage |\n" 1468 + " task_storage }\n" 1469 1469 " " HELP_SPEC_OPTIONS "\n" 1470 1470 "", 1471 1471 bin_name, argv[-2]);