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 }
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 version number (similar to bpftool version), and op‐
72 tional features that were included when bpftool was compiled.
73 Optional features include linking against libbfd to provide
74 the disassembler for JIT-ted programs (bpftool prog dump
75 jited) and usage of BPF skeletons (some features like bpftool
76 prog profile or showing pids associated to BPF objects may
77 rely on it).
78
79 -j, --json
80 Generate JSON output. For commands that cannot produce JSON,
81 this option has no effect.
82
83 -p, --pretty
84 Generate human-readable JSON output. Implies -j.
85
86 -d, --debug
87 Print all logs available, even debug-level information. This
88 includes logs from libbpf as well as from the verifier, when
89 attempting to load programs.
90
92 bpf(2), bpf-helpers(7), bpftool(8), bpftool-btf(8),
93 bpftool-cgroup(8), bpftool-gen(8), bpftool-iter(8), bpftool-link(8),
94 bpftool-map(8), bpftool-net(8), bpftool-perf(8), bpftool-prog(8),
95 bpftool-struct_ops(8)
96
97
98
99
100 BPFTOOL-FEATURE(8)