18c2ecf20Sopenharmony_ci=============== 28c2ecf20Sopenharmony_cibpftool-feature 38c2ecf20Sopenharmony_ci=============== 48c2ecf20Sopenharmony_ci------------------------------------------------------------------------------- 58c2ecf20Sopenharmony_citool for inspection of eBPF-related parameters for Linux kernel or net device 68c2ecf20Sopenharmony_ci------------------------------------------------------------------------------- 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_ci:Manual section: 8 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ciSYNOPSIS 118c2ecf20Sopenharmony_ci======== 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ci **bpftool** [*OPTIONS*] **feature** *COMMAND* 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ci *OPTIONS* := { { **-j** | **--json** } [{ **-p** | **--pretty** }] } 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ci *COMMANDS* := { **probe** | **help** } 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_ciFEATURE COMMANDS 208c2ecf20Sopenharmony_ci================ 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci| **bpftool** **feature probe** [*COMPONENT*] [**full**] [**unprivileged**] [**macros** [**prefix** *PREFIX*]] 238c2ecf20Sopenharmony_ci| **bpftool** **feature help** 248c2ecf20Sopenharmony_ci| 258c2ecf20Sopenharmony_ci| *COMPONENT* := { **kernel** | **dev** *NAME* } 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ciDESCRIPTION 288c2ecf20Sopenharmony_ci=========== 298c2ecf20Sopenharmony_ci **bpftool feature probe** [**kernel**] [**full**] [**macros** [**prefix** *PREFIX*]] 308c2ecf20Sopenharmony_ci Probe the running kernel and dump a number of eBPF-related 318c2ecf20Sopenharmony_ci parameters, such as availability of the **bpf**\ () system call, 328c2ecf20Sopenharmony_ci JIT status, eBPF program types availability, eBPF helper 338c2ecf20Sopenharmony_ci functions availability, and more. 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_ci By default, bpftool **does not run probes** for 368c2ecf20Sopenharmony_ci **bpf_probe_write_user**\ () and **bpf_trace_printk**\() 378c2ecf20Sopenharmony_ci helpers which print warnings to kernel logs. To enable them 388c2ecf20Sopenharmony_ci and run all probes, the **full** keyword should be used. 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_ci If the **macros** keyword (but not the **-j** option) is 418c2ecf20Sopenharmony_ci passed, a subset of the output is dumped as a list of 428c2ecf20Sopenharmony_ci **#define** macros that are ready to be included in a C 438c2ecf20Sopenharmony_ci header file, for example. If, additionally, **prefix** is 448c2ecf20Sopenharmony_ci used to define a *PREFIX*, the provided string will be used 458c2ecf20Sopenharmony_ci as a prefix to the names of the macros: this can be used to 468c2ecf20Sopenharmony_ci avoid conflicts on macro names when including the output of 478c2ecf20Sopenharmony_ci this command as a header file. 488c2ecf20Sopenharmony_ci 498c2ecf20Sopenharmony_ci Keyword **kernel** can be omitted. If no probe target is 508c2ecf20Sopenharmony_ci specified, probing the kernel is the default behaviour. 518c2ecf20Sopenharmony_ci 528c2ecf20Sopenharmony_ci When the **unprivileged** keyword is used, bpftool will dump 538c2ecf20Sopenharmony_ci only the features available to a user who does not have the 548c2ecf20Sopenharmony_ci **CAP_SYS_ADMIN** capability set. The features available in 558c2ecf20Sopenharmony_ci that case usually represent a small subset of the parameters 568c2ecf20Sopenharmony_ci supported by the system. Unprivileged users MUST use the 578c2ecf20Sopenharmony_ci **unprivileged** keyword: This is to avoid misdetection if 588c2ecf20Sopenharmony_ci bpftool is inadvertently run as non-root, for example. This 598c2ecf20Sopenharmony_ci keyword is unavailable if bpftool was compiled without 608c2ecf20Sopenharmony_ci libcap. 618c2ecf20Sopenharmony_ci 628c2ecf20Sopenharmony_ci **bpftool feature probe dev** *NAME* [**full**] [**macros** [**prefix** *PREFIX*]] 638c2ecf20Sopenharmony_ci Probe network device for supported eBPF features and dump 648c2ecf20Sopenharmony_ci results to the console. 658c2ecf20Sopenharmony_ci 668c2ecf20Sopenharmony_ci The keywords **full**, **macros** and **prefix** have the 678c2ecf20Sopenharmony_ci same role as when probing the kernel. 688c2ecf20Sopenharmony_ci 698c2ecf20Sopenharmony_ci **bpftool feature help** 708c2ecf20Sopenharmony_ci Print short help message. 718c2ecf20Sopenharmony_ci 728c2ecf20Sopenharmony_ciOPTIONS 738c2ecf20Sopenharmony_ci======= 748c2ecf20Sopenharmony_ci .. include:: common_options.rst 75