blob: 7b0497f95a75f0dafdf079742cec136dcff3ffdc [file] [log] [blame]
Arnaldo Carvalho de Melo514f1c62012-09-26 20:05:56 -03001perf-trace(1)
2=============
3
4NAME
5----
6perf-trace - strace inspired tool
7
8SYNOPSIS
9--------
10[verse]
11'perf trace'
David Ahern5e2485b2013-09-28 13:13:01 -060012'perf trace record'
Arnaldo Carvalho de Melo514f1c62012-09-26 20:05:56 -030013
14DESCRIPTION
15-----------
16This command will show the events associated with the target, initially
17syscalls, but other system events like pagefaults, task lifetime events,
18scheduling events, etc.
19
David Ahern5e2485b2013-09-28 13:13:01 -060020This is a live mode tool in addition to working with perf.data files like
21the other perf tools. Files can be generated using the 'perf record' command
22but the session needs to include the raw_syscalls events (-e 'raw_syscalls:*').
23Alernatively, the 'perf trace record' can be used as a shortcut to
24automatically include the raw_syscalls events when writing events to a file.
25
26The following options apply to perf trace; options to perf trace record are
27found in the perf record man page.
Arnaldo Carvalho de Melo514f1c62012-09-26 20:05:56 -030028
29OPTIONS
30-------
31
David Ahernac9be8e2013-08-20 11:15:45 -060032-a::
Arnaldo Carvalho de Melo514f1c62012-09-26 20:05:56 -030033--all-cpus::
34 System-wide collection from all CPUs.
35
Arnaldo Carvalho de Melo2ae3a312013-08-09 12:28:31 -030036-e::
37--expr::
38 List of events to show, currently only syscall names.
Arnaldo Carvalho de Melob059efd2013-08-21 12:56:21 -030039 Prefixing with ! shows all syscalls but the ones specified. You may
40 need to escape it.
Arnaldo Carvalho de Melo2ae3a312013-08-09 12:28:31 -030041
Arnaldo Carvalho de Meloc24ff992013-08-19 12:01:10 -030042-o::
43--output=::
44 Output file name.
45
Arnaldo Carvalho de Melo514f1c62012-09-26 20:05:56 -030046-p::
47--pid=::
48 Record events on existing process ID (comma separated list).
49
David Ahernac9be8e2013-08-20 11:15:45 -060050-t::
Arnaldo Carvalho de Melo514f1c62012-09-26 20:05:56 -030051--tid=::
52 Record events on existing thread ID (comma separated list).
53
David Ahernac9be8e2013-08-20 11:15:45 -060054-u::
Arnaldo Carvalho de Melo514f1c62012-09-26 20:05:56 -030055--uid=::
56 Record events in threads owned by uid. Name or number.
57
Arnaldo Carvalho de Melo7c304ee02013-08-22 16:49:54 -030058-v::
59--verbose=::
60 Verbosity level.
61
David Ahernac9be8e2013-08-20 11:15:45 -060062-i::
Arnaldo Carvalho de Melo514f1c62012-09-26 20:05:56 -030063--no-inherit::
64 Child tasks do not inherit counters.
65
David Ahernac9be8e2013-08-20 11:15:45 -060066-m::
Arnaldo Carvalho de Melo514f1c62012-09-26 20:05:56 -030067--mmap-pages=::
Jiri Olsa27050f52013-09-01 12:36:13 +020068 Number of mmap data pages (must be a power of two) or size
69 specification with appended unit character - B/K/M/G. The
70 size is rounded up to have nearest pages power of two value.
Arnaldo Carvalho de Melo514f1c62012-09-26 20:05:56 -030071
David Ahernac9be8e2013-08-20 11:15:45 -060072-C::
Arnaldo Carvalho de Melo514f1c62012-09-26 20:05:56 -030073--cpu::
74Collect samples only on the list of CPUs provided. Multiple CPUs can be provided as a
75comma-separated list with no space: 0,1. Ranges of CPUs are specified with -: 0-2.
76In per-thread mode with inheritance mode on (default), Events are captured only when
77the thread executes on the designated CPUs. Default is to monitor all CPUs.
78
Arnaldo Carvalho de Meloae9ed032012-10-08 09:56:00 -030079--duration:
80 Show only events that had a duration greater than N.M ms.
81
Arnaldo Carvalho de Melo1302d882012-10-17 17:13:12 -030082--sched:
83 Accrue thread runtime and provide a summary at the end of the session.
84
David Ahern6810fc92013-08-28 22:29:52 -060085-i
86--input
87 Process events from a given perf data file.
88
David Ahern4bb09192013-09-04 12:37:43 -060089-T
90--time
91 Print full timestamp rather time relative to first sample.
92
Arnaldo Carvalho de Melo50c95cb2013-09-12 12:35:21 -030093--comm::
94 Show process COMM right beside its ID, on by default, disable with --no-comm.
95
David Ahernbf2575c2013-10-08 21:26:53 -060096--summary::
97 Show a summary of syscalls by thread with min, max, and average times (in
98 msec) and relative stddev.
99
Arnaldo Carvalho de Meloc5227392013-09-27 18:06:19 -0300100--tool_stats::
101 Show tool stats such as number of times fd->pathname was discovered thru
102 hooking the open syscall return + vfs_getname or via reading /proc/pid/fd, etc.
103
Arnaldo Carvalho de Melo514f1c62012-09-26 20:05:56 -0300104SEE ALSO
105--------
106linkperf:perf-record[1], linkperf:perf-script[1]