1PERF-TRACE(1)                     perf Manual                    PERF-TRACE(1)
2
3
4

NAME

6       perf-trace - strace inspired tool
7

SYNOPSIS

9       perf trace
10       perf trace record
11

DESCRIPTION

13       This command will show the events associated with the target, initially
14       syscalls, but other system events like pagefaults, task lifetime
15       events, scheduling events, etc.
16
17       This is a live mode tool in addition to working with perf.data files
18       like the other perf tools. Files can be generated using the perf record
19       command but the session needs to include the raw_syscalls events (-e
20       syscalls:*). Alternatively, perf trace record can be used as a shortcut
21       to automatically include the raw_syscalls events when writing events to
22       a file.
23
24       The following options apply to perf trace; options to perf trace record
25       are found in the perf record man page.
26

OPTIONS

28       -a, --all-cpus
29           System-wide collection from all CPUs.
30
31       -e, --expr
32           List of events to show, currently only syscall names. Prefixing
33           with ! shows all syscalls but the ones specified. You may need to
34           escape it.
35
36       -o, --output=
37           Output file name.
38
39       -p, --pid=
40           Record events on existing process ID (comma separated list).
41
42       -t, --tid=
43           Record events on existing thread ID (comma separated list).
44
45       -u, --uid=
46           Record events in threads owned by uid. Name or number.
47
48       --filter-pids=
49           Filter out events for these pids and for trace itself (comma
50           separated list).
51
52       -v, --verbose=
53           Verbosity level.
54
55       -i, --no-inherit
56           Child tasks do not inherit counters.
57
58       -m, --mmap-pages=
59           Number of mmap data pages (must be a power of two) or size
60           specification with appended unit character - B/K/M/G. The size is
61           rounded up to have nearest pages power of two value.
62
63       -C, --cpu
64           Collect samples only on the list of CPUs provided. Multiple CPUs
65           can be provided as a comma-separated list with no space: 0,1.
66           Ranges of CPUs are specified with -: 0-2. In per-thread mode with
67           inheritance mode on (default), Events are captured only when the
68           thread executes on the designated CPUs. Default is to monitor all
69           CPUs.
70
71       --duration: Show only events that had a duration greater than N.M ms.
72
73       --sched: Accrue thread runtime and provide a summary at the end of the
74       session.
75
76       -i --input Process events from a given perf data file.
77
78       -T --time Print full timestamp rather time relative to first sample.
79
80       --comm
81           Show process COMM right beside its ID, on by default, disable with
82           --no-comm.
83
84       -s, --summary
85           Show only a summary of syscalls by thread with min, max, and
86           average times (in msec) and relative stddev.
87
88       -S, --with-summary
89           Show all syscalls followed by a summary by thread with min, max,
90           and average times (in msec) and relative stddev.
91
92       --tool_stats
93           Show tool stats such as number of times fd→pathname was discovered
94           thru hooking the open syscall return + vfs_getname or via reading
95           /proc/pid/fd, etc.
96
97       -F=[all|min|maj], --pf=[all|min|maj]
98           Trace pagefaults. Optionally, you can specify whether you want
99           minor, major or all pagefaults. Default value is maj.
100
101       --syscalls
102           Trace system calls. This options is enabled by default.
103
104       --event
105           Trace other events, see perf list for a complete list.
106

PAGEFAULTS

108       When tracing pagefaults, the format of the trace is as follows:
109
110       <min|maj>fault [<ip.symbol>+<ip.offset>] ⇒ <addr.dso@addr.offset[1]>
111       (<map type><addr level>).
112
113       ·   min/maj indicates whether fault event is minor or major;
114
115       ·   ip.symbol shows symbol for instruction pointer (the code that
116           generated the fault); if no debug symbols available, perf trace
117           will print raw IP;
118
119       ·   addr.dso shows DSO for the faulted address;
120
121       ·   map type is either d for non-executable maps or x for executable
122           maps;
123
124       ·   addr level is either k for kernel dso or .  for user dso.
125
126       For symbols resolution you may need to install debugging symbols.
127
128       Please be aware that duration is currently always 0 and doesn’t reflect
129       actual time it took for fault to be handled!
130
131       When --verbose specified, perf trace tries to print all available
132       information for both IP and fault address in the form of
133       dso@symbol[2]+offset.
134

EXAMPLES

136       Trace only major pagefaults:
137
138           $ perf trace --no-syscalls -F
139
140       Trace syscalls, major and minor pagefaults:
141
142           $ perf trace -F all
143
144           1416.547 ( 0.000 ms): python/20235 majfault [CRYPTO_push_info_+0x0] => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0@0x61be0 (x.)
145
146           As you can see, there was major pagefault in python process, from
147           CRYPTO_push_info_ routine which faulted somewhere in libcrypto.so.
148

SEE ALSO

150       perf-record(1), perf-script(1)
151

NOTES

153        1. addr.dso@addr.offset
154           mailto:addr.dso@addr.offset
155
156        2. dso@symbol
157           mailto:dso@symbol
158
159
160
161perf                              06/18/2019                     PERF-TRACE(1)
Impressum