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

NAME

6       bpftool-perf - tool for inspection of perf related bpf prog attachments
7

SYNOPSIS

9          bpftool [OPTIONS] perf COMMAND
10
11          OPTIONS  := { { -j | --json } [{ -p | --pretty }] | { -d | --debug }
12          | { -l | --legacy } }
13
14          COMMANDS := { show | list | help }
15

PERF COMMANDS

17       bpftool perf { show | list }
18       bpftool perf help
19
20

DESCRIPTION

22          bpftool perf { show | list }
23                 List all raw_tracepoint, tracepoint, kprobe attachment in the
24                 system.
25
26                 Output will start with process id and file descriptor in that
27                 process, followed by bpf program id, attachment  information,
28                 and  attachment  point.   The attachment point for raw_trace‐
29                 point/tracepoint is the trace  probe  name.   The  attachment
30                 point  for k[ret]probe is either symbol name and offset, or a
31                 kernel virtual address.  The attachment point for u[ret]probe
32                 is the file name and the file offset.
33
34          bpftool perf help
35                 Print short help message.
36

OPTIONS

38          -h, --help
39                 Print short help message (similar to bpftool help).
40
41          -V, --version
42                 Print  bpftool's version number (similar to bpftool version),
43                 the number of the libbpf version in use,  and  optional  fea‐
44                 tures  that were included when bpftool was compiled. Optional
45                 features include linking against libbfd to provide the disas‐
46                 sembler  for  JIT-ted  programs (bpftool prog dump jited) and
47                 usage of BPF skeletons (some features like bpftool prog  pro‐
48                 file  or  showing  pids associated to BPF objects may rely on
49                 it).
50
51          -j, --json
52                 Generate JSON output. For commands that cannot produce  JSON,
53                 this option has no effect.
54
55          -p, --pretty
56                 Generate human-readable JSON output. Implies -j.
57
58          -d, --debug
59                 Print  all logs available, even debug-level information. This
60                 includes logs from libbpf as well as from the verifier,  when
61                 attempting to load programs.
62
63          -l, --legacy
64                 Use legacy libbpf mode which has more relaxed BPF program re‐
65                 quirements. By default, bpftool has more strict  requirements
66                 about  section  names, changes pinning logic and doesn't sup‐
67                 port some of the older non-BTF map declarations.
68
69                 See
70                 https://github.com/libbpf/libbpf/wiki/Libbpf:-the-road-to-v1.0
71                 for details.
72

EXAMPLES

74       # bpftool perf
75
76
77          pid 21711  fd 5: prog_id 5  kprobe  func __x64_sys_write  offset 0
78          pid 21765  fd 5: prog_id 7  kretprobe  func __x64_sys_nanosleep  offset 0
79          pid 21767  fd 5: prog_id 8  tracepoint  sys_enter_nanosleep
80          pid 21800  fd 5: prog_id 9  uprobe  filename /home/yhs/a.out  offset 1159
81
82       # bpftool -j perf
83
84
85          [{"pid":21711,"fd":5,"prog_id":5,"fd_type":"kprobe","func":"__x64_sys_write","offset":0}, \
86           {"pid":21765,"fd":5,"prog_id":7,"fd_type":"kretprobe","func":"__x64_sys_nanosleep","offset":0}, \
87           {"pid":21767,"fd":5,"prog_id":8,"fd_type":"tracepoint","tracepoint":"sys_enter_nanosleep"}, \
88           {"pid":21800,"fd":5,"prog_id":9,"fd_type":"uprobe","filename":"/home/yhs/a.out","offset":1159}]
89

SEE ALSO

91          bpf(2),      bpf-helpers(7),       bpftool(8),       bpftool-btf(8),
92          bpftool-cgroup(8),        bpftool-feature(8),        bpftool-gen(8),
93          bpftool-iter(8),  bpftool-link(8),  bpftool-map(8),  bpftool-net(8),
94          bpftool-prog(8), bpftool-struct_ops(8)
95
96
97
98
99                                                               BPFTOOL-PERF(8)
Impressum