0001 .. SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
0002
0003 ===============
0004 bpftool-feature
0005 ===============
0006 -------------------------------------------------------------------------------
0007 tool for inspection of eBPF-related parameters for Linux kernel or net device
0008 -------------------------------------------------------------------------------
0009
0010 :Manual section: 8
0011
0012 .. include:: substitutions.rst
0013
0014 SYNOPSIS
0015 ========
0016
0017 **bpftool** [*OPTIONS*] **feature** *COMMAND*
0018
0019 *OPTIONS* := { |COMMON_OPTIONS| }
0020
0021 *COMMANDS* := { **probe** | **help** }
0022
0023 FEATURE COMMANDS
0024 ================
0025
0026 | **bpftool** **feature probe** [*COMPONENT*] [**full**] [**unprivileged**] [**macros** [**prefix** *PREFIX*]]
0027 | **bpftool** **feature list_builtins** *GROUP*
0028 | **bpftool** **feature help**
0029 |
0030 | *COMPONENT* := { **kernel** | **dev** *NAME* }
0031 | *GROUP* := { **prog_types** | **map_types** | **attach_types** | **link_types** | **helpers** }
0032
0033 DESCRIPTION
0034 ===========
0035 **bpftool feature probe** [**kernel**] [**full**] [**macros** [**prefix** *PREFIX*]]
0036 Probe the running kernel and dump a number of eBPF-related
0037 parameters, such as availability of the **bpf**\ () system call,
0038 JIT status, eBPF program types availability, eBPF helper
0039 functions availability, and more.
0040
0041 By default, bpftool **does not run probes** for
0042 **bpf_probe_write_user**\ () and **bpf_trace_printk**\()
0043 helpers which print warnings to kernel logs. To enable them
0044 and run all probes, the **full** keyword should be used.
0045
0046 If the **macros** keyword (but not the **-j** option) is
0047 passed, a subset of the output is dumped as a list of
0048 **#define** macros that are ready to be included in a C
0049 header file, for example. If, additionally, **prefix** is
0050 used to define a *PREFIX*, the provided string will be used
0051 as a prefix to the names of the macros: this can be used to
0052 avoid conflicts on macro names when including the output of
0053 this command as a header file.
0054
0055 Keyword **kernel** can be omitted. If no probe target is
0056 specified, probing the kernel is the default behaviour.
0057
0058 When the **unprivileged** keyword is used, bpftool will dump
0059 only the features available to a user who does not have the
0060 **CAP_SYS_ADMIN** capability set. The features available in
0061 that case usually represent a small subset of the parameters
0062 supported by the system. Unprivileged users MUST use the
0063 **unprivileged** keyword: This is to avoid misdetection if
0064 bpftool is inadvertently run as non-root, for example. This
0065 keyword is unavailable if bpftool was compiled without
0066 libcap.
0067
0068 **bpftool feature probe dev** *NAME* [**full**] [**macros** [**prefix** *PREFIX*]]
0069 Probe network device for supported eBPF features and dump
0070 results to the console.
0071
0072 The keywords **full**, **macros** and **prefix** have the
0073 same role as when probing the kernel.
0074
0075 **bpftool feature list_builtins** *GROUP*
0076 List items known to bpftool. These can be BPF program types
0077 (**prog_types**), BPF map types (**map_types**), attach types
0078 (**attach_types**), link types (**link_types**), or BPF helper
0079 functions (**helpers**). The command does not probe the system, but
0080 simply lists the elements that bpftool knows from compilation time,
0081 as provided from libbpf (for all object types) or from the BPF UAPI
0082 header (list of helpers). This can be used in scripts to iterate over
0083 BPF types or helpers.
0084
0085 **bpftool feature help**
0086 Print short help message.
0087
0088 OPTIONS
0089 =======
0090 .. include:: common_options.rst