xref: /openbmc/linux/tools/bpf/bpftool/Documentation/bpftool-perf.rst (revision 03ab8e6297acd1bc0eedaa050e2a1635c576fd11)
143448428SQuentin Monnet.. SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
243448428SQuentin Monnet
3b04df400SYonghong Song================
4b04df400SYonghong Songbpftool-perf
5b04df400SYonghong Song================
6b04df400SYonghong Song-------------------------------------------------------------------------------
7b04df400SYonghong Songtool for inspection of perf related bpf prog attachments
8b04df400SYonghong Song-------------------------------------------------------------------------------
9b04df400SYonghong Song
10b04df400SYonghong Song:Manual section: 8
11b04df400SYonghong Song
12*b6231815SQuentin Monnet.. include:: substitutions.rst
13*b6231815SQuentin Monnet
14b04df400SYonghong SongSYNOPSIS
15b04df400SYonghong Song========
16b04df400SYonghong Song
17b04df400SYonghong Song	**bpftool** [*OPTIONS*] **perf** *COMMAND*
18b04df400SYonghong Song
19*b6231815SQuentin Monnet	*OPTIONS* := { |COMMON_OPTIONS| }
20b04df400SYonghong Song
21b04df400SYonghong Song	*COMMANDS* :=
22b04df400SYonghong Song	{ **show** | **list** | **help** }
23b04df400SYonghong Song
24b04df400SYonghong SongPERF COMMANDS
25b04df400SYonghong Song=============
26b04df400SYonghong Song
27c8caa0bbSQuentin Monnet|	**bpftool** **perf** { **show** | **list** }
28b04df400SYonghong Song|	**bpftool** **perf help**
29b04df400SYonghong Song
30b04df400SYonghong SongDESCRIPTION
31b04df400SYonghong Song===========
32b04df400SYonghong Song	**bpftool perf { show | list }**
33b04df400SYonghong Song		  List all raw_tracepoint, tracepoint, kprobe attachment in the system.
34b04df400SYonghong Song
35b04df400SYonghong Song		  Output will start with process id and file descriptor in that process,
36b04df400SYonghong Song		  followed by bpf program id, attachment information, and attachment point.
37b04df400SYonghong Song		  The attachment point for raw_tracepoint/tracepoint is the trace probe name.
38b04df400SYonghong Song		  The attachment point for k[ret]probe is either symbol name and offset,
39b04df400SYonghong Song		  or a kernel virtual address.
40b04df400SYonghong Song		  The attachment point for u[ret]probe is the file name and the file offset.
41b04df400SYonghong Song
42b04df400SYonghong Song	**bpftool perf help**
43b04df400SYonghong Song		  Print short help message.
44b04df400SYonghong Song
45b04df400SYonghong SongOPTIONS
46b04df400SYonghong Song=======
47f28ef96dSQuentin Monnet	.. include:: common_options.rst
48775bc8adSQuentin Monnet
49b04df400SYonghong SongEXAMPLES
50b04df400SYonghong Song========
51b04df400SYonghong Song
52b04df400SYonghong Song| **# bpftool perf**
53b04df400SYonghong Song
54b04df400SYonghong Song::
55b04df400SYonghong Song
56b04df400SYonghong Song      pid 21711  fd 5: prog_id 5  kprobe  func __x64_sys_write  offset 0
57b04df400SYonghong Song      pid 21765  fd 5: prog_id 7  kretprobe  func __x64_sys_nanosleep  offset 0
58b04df400SYonghong Song      pid 21767  fd 5: prog_id 8  tracepoint  sys_enter_nanosleep
59b04df400SYonghong Song      pid 21800  fd 5: prog_id 9  uprobe  filename /home/yhs/a.out  offset 1159
60b04df400SYonghong Song
61b04df400SYonghong Song|
62b04df400SYonghong Song| **# bpftool -j perf**
63b04df400SYonghong Song
64b04df400SYonghong Song::
65b04df400SYonghong Song
66b04df400SYonghong Song    [{"pid":21711,"fd":5,"prog_id":5,"fd_type":"kprobe","func":"__x64_sys_write","offset":0}, \
67b04df400SYonghong Song     {"pid":21765,"fd":5,"prog_id":7,"fd_type":"kretprobe","func":"__x64_sys_nanosleep","offset":0}, \
68b04df400SYonghong Song     {"pid":21767,"fd":5,"prog_id":8,"fd_type":"tracepoint","tracepoint":"sys_enter_nanosleep"}, \
69b04df400SYonghong Song     {"pid":21800,"fd":5,"prog_id":9,"fd_type":"uprobe","filename":"/home/yhs/a.out","offset":1159}]
70