^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) ===============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) bpftool-feature
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) ===============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) -------------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) tool for inspection of eBPF-related parameters for Linux kernel or net device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) -------------------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) :Manual section: 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) SYNOPSIS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) ========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) **bpftool** [*OPTIONS*] **feature** *COMMAND*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) *OPTIONS* := { { **-j** | **--json** } [{ **-p** | **--pretty** }] }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) *COMMANDS* := { **probe** | **help** }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) FEATURE COMMANDS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) ================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) | **bpftool** **feature probe** [*COMPONENT*] [**full**] [**unprivileged**] [**macros** [**prefix** *PREFIX*]]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) | **bpftool** **feature help**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) | *COMPONENT* := { **kernel** | **dev** *NAME* }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) DESCRIPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) ===========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) **bpftool feature probe** [**kernel**] [**full**] [**macros** [**prefix** *PREFIX*]]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) Probe the running kernel and dump a number of eBPF-related
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) parameters, such as availability of the **bpf**\ () system call,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) JIT status, eBPF program types availability, eBPF helper
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) functions availability, and more.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) By default, bpftool **does not run probes** for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) **bpf_probe_write_user**\ () and **bpf_trace_printk**\()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) helpers which print warnings to kernel logs. To enable them
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) and run all probes, the **full** keyword should be used.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) If the **macros** keyword (but not the **-j** option) is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) passed, a subset of the output is dumped as a list of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) **#define** macros that are ready to be included in a C
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) header file, for example. If, additionally, **prefix** is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) used to define a *PREFIX*, the provided string will be used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) as a prefix to the names of the macros: this can be used to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) avoid conflicts on macro names when including the output of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) this command as a header file.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) Keyword **kernel** can be omitted. If no probe target is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) specified, probing the kernel is the default behaviour.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) When the **unprivileged** keyword is used, bpftool will dump
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) only the features available to a user who does not have the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) **CAP_SYS_ADMIN** capability set. The features available in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) that case usually represent a small subset of the parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) supported by the system. Unprivileged users MUST use the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) **unprivileged** keyword: This is to avoid misdetection if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) bpftool is inadvertently run as non-root, for example. This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) keyword is unavailable if bpftool was compiled without
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) libcap.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) **bpftool feature probe dev** *NAME* [**full**] [**macros** [**prefix** *PREFIX*]]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) Probe network device for supported eBPF features and dump
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) results to the console.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) The keywords **full**, **macros** and **prefix** have the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) same role as when probing the kernel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) **bpftool feature help**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) Print short help message.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) OPTIONS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) =======
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) .. include:: common_options.rst