aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/libbpf.map
diff options
context:
space:
mode:
authorQuentin Monnet <quentin.monnet@netronome.com>2019-01-17 15:27:54 +0000
committerAlexei Starovoitov <ast@kernel.org>2019-01-22 22:15:40 -0800
commitf99e166397f0298fe78bce24c55c6d074f9bf196 (patch)
treee9f31b1ccd938793704a80cce059d7fd25541842 /tools/lib/bpf/libbpf.map
parenttools: bpftool: add probes for eBPF program types (diff)
downloadlinux-dev-f99e166397f0298fe78bce24c55c6d074f9bf196.tar.xz
linux-dev-f99e166397f0298fe78bce24c55c6d074f9bf196.zip
tools: bpftool: add probes for eBPF map types
Add new probes for eBPF map types, to detect what are the ones available on the system. Try creating one map of each type, and see if the kernel complains. Sample output: # bpftool feature probe kernel ... Scanning eBPF map types... eBPF map_type hash is available eBPF map_type array is available eBPF map_type prog_array is available ... # bpftool --json --pretty feature probe kernel { ... "map_types": { "have_hash_map_type": true, "have_array_map_type": true, "have_prog_array_map_type": true, ... } } v5: - In libbpf.map, move global symbol to the new LIBBPF_0.0.2 section. v3: - Use a switch with all enum values for setting specific map parameters, so that gcc complains at compile time (-Wswitch-enum) if new map types were added to the kernel but libbpf was not updated. v2: - Move probes from bpftool to libbpf. - Remove C-style macros output from this patch. Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Stanislav Fomichev <sdf@google.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/lib/bpf/libbpf.map')
-rw-r--r--tools/lib/bpf/libbpf.map1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf.map b/tools/lib/bpf/libbpf.map
index c7ec3ffa24e9..bb2dfc3b2d7b 100644
--- a/tools/lib/bpf/libbpf.map
+++ b/tools/lib/bpf/libbpf.map
@@ -127,5 +127,6 @@ LIBBPF_0.0.1 {
LIBBPF_0.0.2 {
global:
+ bpf_probe_map_type;
bpf_probe_prog_type;
} LIBBPF_0.0.1;