1BPFTOOL-FEATURE(8) BPFTOOL-FEATURE(8)
2
3
4
6 bpftool-feature - tool for inspection of eBPF-related parameters for
7 Linux kernel or net device
8
10 bpftool [OPTIONS] feature COMMAND
11
12 OPTIONS := { { -j | --json } [{ -p | --pretty }] | { -d | --debug }
13 | { -l | --legacy } }
14
15 COMMANDS := { probe | help }
16
18 bpftool feature probe [COMPONENT] [full] [unprivileged] [macros [prefix PREFIX]]
19 bpftool feature help
20
21 COMPONENT := { kernel | dev NAME }
22
23
25 bpftool feature probe [kernel] [full] [macros [prefix PREFIX]]
26 Probe the running kernel and dump a number of eBPF-related
27 parameters, such as availability of the bpf() system call,
28 JIT status, eBPF program types availability, eBPF helper
29 functions availability, and more.
30
31 By default, bpftool does not run probes for
32 bpf_probe_write_user() and bpf_trace_printk() helpers which
33 print warnings to kernel logs. To enable them and run all
34 probes, the full keyword should be used.
35
36 If the macros keyword (but not the -j option) is passed, a
37 subset of the output is dumped as a list of #define macros
38 that are ready to be included in a C header file, for exam‐
39 ple. If, additionally, prefix is used to define a PREFIX, the
40 provided string will be used as a prefix to the names of the
41 macros: this can be used to avoid conflicts on macro names
42 when including the output of this command as a header file.
43
44 Keyword kernel can be omitted. If no probe target is speci‐
45 fied, probing the kernel is the default behaviour.
46
47 When the unprivileged keyword is used, bpftool will dump only
48 the features available to a user who does not have the
49 CAP_SYS_ADMIN capability set. The features available in that
50 case usually represent a small subset of the parameters sup‐
51 ported by the system. Unprivileged users MUST use the unpriv‐
52 ileged keyword: This is to avoid misdetection if bpftool is
53 inadvertently run as non-root, for example. This keyword is
54 unavailable if bpftool was compiled without libcap.
55
56 bpftool feature probe dev NAME [full] [macros [prefix PREFIX]]
57 Probe network device for supported eBPF features and dump re‐
58 sults to the console.
59
60 The keywords full, macros and prefix have the same role as
61 when probing the kernel.
62
63 bpftool feature help
64 Print short help message.
65
67 -h, --help
68 Print short help message (similar to bpftool help).
69
70 -V, --version
71 Print bpftool's version number (similar to bpftool version),
72 the number of the libbpf version in use, and optional fea‐
73 tures that were included when bpftool was compiled. Optional
74 features include linking against libbfd to provide the disas‐
75 sembler for JIT-ted programs (bpftool prog dump jited) and
76 usage of BPF skeletons (some features like bpftool prog pro‐
77 file or showing pids associated to BPF objects may rely on
78 it).
79
80 -j, --json
81 Generate JSON output. For commands that cannot produce JSON,
82 this option has no effect.
83
84 -p, --pretty
85 Generate human-readable JSON output. Implies -j.
86
87 -d, --debug
88 Print all logs available, even debug-level information. This
89 includes logs from libbpf as well as from the verifier, when
90 attempting to load programs.
91
92 -l, --legacy
93 Use legacy libbpf mode which has more relaxed BPF program re‐
94 quirements. By default, bpftool has more strict requirements
95 about section names, changes pinning logic and doesn't sup‐
96 port some of the older non-BTF map declarations.
97
98 See
99 https://github.com/libbpf/libbpf/wiki/Libbpf:-the-road-to-v1.0
100 for details.
101
103 bpf(2), bpf-helpers(7), bpftool(8), bpftool-btf(8),
104 bpftool-cgroup(8), bpftool-gen(8), bpftool-iter(8), bpftool-link(8),
105 bpftool-map(8), bpftool-net(8), bpftool-perf(8), bpftool-prog(8),
106 bpftool-struct_ops(8)
107
108
109
110
111 BPFTOOL-FEATURE(8)