bpftool-feature.rst 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. .. SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. ===============
  3. bpftool-feature
  4. ===============
  5. -------------------------------------------------------------------------------
  6. tool for inspection of eBPF-related parameters for Linux kernel or net device
  7. -------------------------------------------------------------------------------
  8. :Manual section: 8
  9. .. include:: substitutions.rst
  10. SYNOPSIS
  11. ========
  12. **bpftool** [*OPTIONS*] **feature** *COMMAND*
  13. *OPTIONS* := { |COMMON_OPTIONS| }
  14. *COMMANDS* := { **probe** | **help** }
  15. FEATURE COMMANDS
  16. ================
  17. | **bpftool** **feature probe** [*COMPONENT*] [**full**] [**unprivileged**] [**macros** [**prefix** *PREFIX*]]
  18. | **bpftool** **feature list_builtins** *GROUP*
  19. | **bpftool** **feature help**
  20. |
  21. | *COMPONENT* := { **kernel** | **dev** *NAME* }
  22. | *GROUP* := { **prog_types** | **map_types** | **attach_types** | **link_types** | **helpers** }
  23. DESCRIPTION
  24. ===========
  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. By default, bpftool **does not run probes** for
  31. **bpf_probe_write_user**\ () and **bpf_trace_printk**\()
  32. helpers which print warnings to kernel logs. To enable them
  33. and run all probes, the **full** keyword should be used.
  34. If the **macros** keyword (but not the **-j** option) is
  35. passed, a subset of the output is dumped as a list of
  36. **#define** macros that are ready to be included in a C
  37. header file, for example. If, additionally, **prefix** is
  38. used to define a *PREFIX*, the provided string will be used
  39. as a prefix to the names of the macros: this can be used to
  40. avoid conflicts on macro names when including the output of
  41. this command as a header file.
  42. Keyword **kernel** can be omitted. If no probe target is
  43. specified, probing the kernel is the default behaviour.
  44. When the **unprivileged** keyword is used, bpftool will dump
  45. only the features available to a user who does not have the
  46. **CAP_SYS_ADMIN** capability set. The features available in
  47. that case usually represent a small subset of the parameters
  48. supported by the system. Unprivileged users MUST use the
  49. **unprivileged** keyword: This is to avoid misdetection if
  50. bpftool is inadvertently run as non-root, for example. This
  51. keyword is unavailable if bpftool was compiled without
  52. libcap.
  53. **bpftool feature probe dev** *NAME* [**full**] [**macros** [**prefix** *PREFIX*]]
  54. Probe network device for supported eBPF features and dump
  55. results to the console.
  56. The keywords **full**, **macros** and **prefix** have the
  57. same role as when probing the kernel.
  58. **bpftool feature list_builtins** *GROUP*
  59. List items known to bpftool. These can be BPF program types
  60. (**prog_types**), BPF map types (**map_types**), attach types
  61. (**attach_types**), link types (**link_types**), or BPF helper
  62. functions (**helpers**). The command does not probe the system, but
  63. simply lists the elements that bpftool knows from compilation time,
  64. as provided from libbpf (for all object types) or from the BPF UAPI
  65. header (list of helpers). This can be used in scripts to iterate over
  66. BPF types or helpers.
  67. **bpftool feature help**
  68. Print short help message.
  69. OPTIONS
  70. =======
  71. .. include:: common_options.rst