1BPFTOOL-FEATURE(8)                                          BPFTOOL-FEATURE(8)
2
3
4

NAME

6       bpftool-feature  -  tool  for inspection of eBPF-related parameters for
7       Linux kernel or net device
8

SYNOPSIS

10          bpftool [OPTIONS] feature COMMAND
11
12          OPTIONS := { { -j | --json } [{ -p | --pretty }] | { -d | --debug  }
13          | { -l | --legacy } }
14
15          COMMANDS := { probe | help }
16

FEATURE COMMANDS

18       bpftool feature probe [COMPONENT] [full] [unprivileged] [macros [prefix PREFIX]]
19       bpftool feature list_builtins GROUP
20       bpftool feature help
21
22       COMPONENT := { kernel | dev NAME }
23       GROUP := { prog_types | map_types | attach_types | link_types | helpers }
24
25

DESCRIPTION

27          bpftool feature probe [kernel] [full] [macros [prefix PREFIX]]
28                 Probe  the  running  kernel and dump a number of eBPF-related
29                 parameters, such as availability of the  bpf()  system  call,
30                 JIT  status,  eBPF  program  types  availability, eBPF helper
31                 functions availability, and more.
32
33                 By   default,   bpftool   does    not    run    probes    for
34                 bpf_probe_write_user()  and  bpf_trace_printk() helpers which
35                 print warnings to kernel logs. To enable  them  and  run  all
36                 probes, the full keyword should be used.
37
38                 If  the  macros  keyword (but not the -j option) is passed, a
39                 subset of the output is dumped as a list  of  #define  macros
40                 that  are  ready to be included in a C header file, for exam‐
41                 ple. If, additionally, prefix is used to define a PREFIX, the
42                 provided  string will be used as a prefix to the names of the
43                 macros: this can be used to avoid conflicts  on  macro  names
44                 when including the output of this command as a header file.
45
46                 Keyword  kernel  can be omitted. If no probe target is speci‐
47                 fied, probing the kernel is the default behaviour.
48
49                 When the unprivileged keyword is used, bpftool will dump only
50                 the  features  available  to  a  user  who  does not have the
51                 CAP_SYS_ADMIN capability set. The features available in  that
52                 case  usually represent a small subset of the parameters sup‐
53                 ported by the system. Unprivileged users MUST use the unpriv‐
54                 ileged  keyword:  This is to avoid misdetection if bpftool is
55                 inadvertently run as non-root, for example. This  keyword  is
56                 unavailable if bpftool was compiled without libcap.
57
58          bpftool feature probe dev NAME [full] [macros [prefix PREFIX]]
59                 Probe network device for supported eBPF features and dump re‐
60                 sults to the console.
61
62                 The keywords full, macros and prefix have the  same  role  as
63                 when probing the kernel.
64
65          bpftool feature list_builtins GROUP
66                 List  items  known to bpftool. These can be BPF program types
67                 (prog_types), BPF map types (map_types),  attach  types  (at‐
68                 tach_types), link types (link_types), or BPF helper functions
69                 (helpers). The command does not probe the system, but  simply
70                 lists  the elements that bpftool knows from compilation time,
71                 as provided from libbpf (for all object types)  or  from  the
72                 BPF  UAPI  header  (list  of  helpers).  This  can be used in
73                 scripts to iterate over BPF types or helpers.
74
75          bpftool feature help
76                 Print short help message.
77

OPTIONS

79          -h, --help
80                 Print short help message (similar to bpftool help).
81
82          -V, --version
83                 Print bpftool's version number (similar to bpftool  version),
84                 the  number  of  the libbpf version in use, and optional fea‐
85                 tures that were included when bpftool was compiled.  Optional
86                 features include linking against libbfd to provide the disas‐
87                 sembler for JIT-ted programs (bpftool prog  dump  jited)  and
88                 usage  of BPF skeletons (some features like bpftool prog pro‐
89                 file or showing pids associated to BPF objects  may  rely  on
90                 it).
91
92          -j, --json
93                 Generate  JSON output. For commands that cannot produce JSON,
94                 this option has no effect.
95
96          -p, --pretty
97                 Generate human-readable JSON output. Implies -j.
98
99          -d, --debug
100                 Print all logs available, even debug-level information.  This
101                 includes  logs from libbpf as well as from the verifier, when
102                 attempting to load programs.
103
104          -l, --legacy
105                 Use legacy libbpf mode which has more relaxed BPF program re‐
106                 quirements.  By default, bpftool has more strict requirements
107                 about section names, changes pinning logic and  doesn't  sup‐
108                 port some of the older non-BTF map declarations.
109
110                 See
111                 https://github.com/libbpf/libbpf/wiki/Libbpf:-the-road-to-v1.0
112                 for details.
113

SEE ALSO

115          bpf(2),       bpf-helpers(7),       bpftool(8),      bpftool-btf(8),
116          bpftool-cgroup(8), bpftool-gen(8), bpftool-iter(8), bpftool-link(8),
117          bpftool-map(8),  bpftool-net(8),  bpftool-perf(8),  bpftool-prog(8),
118          bpftool-struct_ops(8)
119
120
121
122
123                                                            BPFTOOL-FEATURE(8)
Impressum