xref: /linux/tools/perf/Documentation/perf-trace.txt (revision c522739d72a341a3e74a369ce6298b9412813d3f)
1514f1c67SArnaldo Carvalho de Meloperf-trace(1)
2514f1c67SArnaldo Carvalho de Melo=============
3514f1c67SArnaldo Carvalho de Melo
4514f1c67SArnaldo Carvalho de MeloNAME
5514f1c67SArnaldo Carvalho de Melo----
6514f1c67SArnaldo Carvalho de Meloperf-trace - strace inspired tool
7514f1c67SArnaldo Carvalho de Melo
8514f1c67SArnaldo Carvalho de MeloSYNOPSIS
9514f1c67SArnaldo Carvalho de Melo--------
10514f1c67SArnaldo Carvalho de Melo[verse]
11514f1c67SArnaldo Carvalho de Melo'perf trace'
125e2485b1SDavid Ahern'perf trace record'
13514f1c67SArnaldo Carvalho de Melo
14514f1c67SArnaldo Carvalho de MeloDESCRIPTION
15514f1c67SArnaldo Carvalho de Melo-----------
16514f1c67SArnaldo Carvalho de MeloThis command will show the events associated with the target, initially
17514f1c67SArnaldo Carvalho de Melosyscalls, but other system events like pagefaults, task lifetime events,
18514f1c67SArnaldo Carvalho de Meloscheduling events, etc.
19514f1c67SArnaldo Carvalho de Melo
205e2485b1SDavid AhernThis is a live mode tool in addition to working with perf.data files like
215e2485b1SDavid Ahernthe other perf tools. Files can be generated using the 'perf record' command
225e2485b1SDavid Ahernbut the session needs to include the raw_syscalls events (-e 'raw_syscalls:*').
235e2485b1SDavid AhernAlernatively, the 'perf trace record' can be used as a shortcut to
245e2485b1SDavid Ahernautomatically include the raw_syscalls events when writing events to a file.
255e2485b1SDavid Ahern
265e2485b1SDavid AhernThe following options apply to perf trace; options to perf trace record are
275e2485b1SDavid Ahernfound in the perf record man page.
28514f1c67SArnaldo Carvalho de Melo
29514f1c67SArnaldo Carvalho de MeloOPTIONS
30514f1c67SArnaldo Carvalho de Melo-------
31514f1c67SArnaldo Carvalho de Melo
32ac9be8eeSDavid Ahern-a::
33514f1c67SArnaldo Carvalho de Melo--all-cpus::
34514f1c67SArnaldo Carvalho de Melo        System-wide collection from all CPUs.
35514f1c67SArnaldo Carvalho de Melo
362ae3a312SArnaldo Carvalho de Melo-e::
372ae3a312SArnaldo Carvalho de Melo--expr::
382ae3a312SArnaldo Carvalho de Melo	List of events to show, currently only syscall names.
39b059efdfSArnaldo Carvalho de Melo	Prefixing with ! shows all syscalls but the ones specified.  You may
40b059efdfSArnaldo Carvalho de Melo	need to escape it.
412ae3a312SArnaldo Carvalho de Melo
42c24ff998SArnaldo Carvalho de Melo-o::
43c24ff998SArnaldo Carvalho de Melo--output=::
44c24ff998SArnaldo Carvalho de Melo	Output file name.
45c24ff998SArnaldo Carvalho de Melo
46514f1c67SArnaldo Carvalho de Melo-p::
47514f1c67SArnaldo Carvalho de Melo--pid=::
48514f1c67SArnaldo Carvalho de Melo	Record events on existing process ID (comma separated list).
49514f1c67SArnaldo Carvalho de Melo
50ac9be8eeSDavid Ahern-t::
51514f1c67SArnaldo Carvalho de Melo--tid=::
52514f1c67SArnaldo Carvalho de Melo        Record events on existing thread ID (comma separated list).
53514f1c67SArnaldo Carvalho de Melo
54ac9be8eeSDavid Ahern-u::
55514f1c67SArnaldo Carvalho de Melo--uid=::
56514f1c67SArnaldo Carvalho de Melo        Record events in threads owned by uid. Name or number.
57514f1c67SArnaldo Carvalho de Melo
587c304ee0SArnaldo Carvalho de Melo-v::
597c304ee0SArnaldo Carvalho de Melo--verbose=::
607c304ee0SArnaldo Carvalho de Melo        Verbosity level.
617c304ee0SArnaldo Carvalho de Melo
62ac9be8eeSDavid Ahern-i::
63514f1c67SArnaldo Carvalho de Melo--no-inherit::
64514f1c67SArnaldo Carvalho de Melo	Child tasks do not inherit counters.
65514f1c67SArnaldo Carvalho de Melo
66ac9be8eeSDavid Ahern-m::
67514f1c67SArnaldo Carvalho de Melo--mmap-pages=::
6827050f53SJiri Olsa	Number of mmap data pages (must be a power of two) or size
6927050f53SJiri Olsa	specification with appended unit character - B/K/M/G. The
7027050f53SJiri Olsa	size is rounded up to have nearest pages power of two value.
71514f1c67SArnaldo Carvalho de Melo
72ac9be8eeSDavid Ahern-C::
73514f1c67SArnaldo Carvalho de Melo--cpu::
74514f1c67SArnaldo Carvalho de MeloCollect samples only on the list of CPUs provided. Multiple CPUs can be provided as a
75514f1c67SArnaldo Carvalho de Melocomma-separated list with no space: 0,1. Ranges of CPUs are specified with -: 0-2.
76514f1c67SArnaldo Carvalho de MeloIn per-thread mode with inheritance mode on (default), Events are captured only when
77514f1c67SArnaldo Carvalho de Melothe thread executes on the designated CPUs. Default is to monitor all CPUs.
78514f1c67SArnaldo Carvalho de Melo
79ae9ed035SArnaldo Carvalho de Melo--duration:
80ae9ed035SArnaldo Carvalho de Melo	Show only events that had a duration greater than N.M ms.
81ae9ed035SArnaldo Carvalho de Melo
821302d88eSArnaldo Carvalho de Melo--sched:
831302d88eSArnaldo Carvalho de Melo	Accrue thread runtime and provide a summary at the end of the session.
841302d88eSArnaldo Carvalho de Melo
856810fc91SDavid Ahern-i
866810fc91SDavid Ahern--input
876810fc91SDavid Ahern	Process events from a given perf data file.
886810fc91SDavid Ahern
894bb09192SDavid Ahern-T
904bb09192SDavid Ahern--time
914bb09192SDavid Ahern	Print full timestamp rather time relative to first sample.
924bb09192SDavid Ahern
9350c95cbdSArnaldo Carvalho de Melo--comm::
9450c95cbdSArnaldo Carvalho de Melo        Show process COMM right beside its ID, on by default, disable with --no-comm.
9550c95cbdSArnaldo Carvalho de Melo
96bf2575c1SDavid Ahern--summary::
97bf2575c1SDavid Ahern	Show a summary of syscalls by thread with min, max, and average times (in
98bf2575c1SDavid Ahern    msec) and relative stddev.
99bf2575c1SDavid Ahern
100*c522739dSArnaldo Carvalho de Melo--tool_stats::
101*c522739dSArnaldo Carvalho de Melo	Show tool stats such as number of times fd->pathname was discovered thru
102*c522739dSArnaldo Carvalho de Melo	hooking the open syscall return + vfs_getname or via reading /proc/pid/fd, etc.
103*c522739dSArnaldo Carvalho de Melo
104514f1c67SArnaldo Carvalho de MeloSEE ALSO
105514f1c67SArnaldo Carvalho de Melo--------
106514f1c67SArnaldo Carvalho de Melolinkperf:perf-record[1], linkperf:perf-script[1]
107