By default, trace-cmd report will read the file trace.dat. But
the -i option open up the given input-file instead. Note, the
input file may also be specified as the last item on the command
This outputs the endianess of the file. trace-cmd report is smart
enough to be able to read big endian files on little endian
machines, and vise versa.
This outputs the list of functions that have been recorded in the
This outputs the list of "trace_printk()" data. The raw trace
data points to static pointers in the kernel. This must be stored
in the trace.dat file.
This lists the possible events in the file (but this list is not
necessarily the list of events in the file).
This will list the event formats that are stored in the trace.dat
This will print events that match the given regex. If a colon is
specified, then the characters before the colon will be used to
match the system and the characters after the colon will match
trace-cmd report --event sys:read
The above will only match events where the system name contains "sys"
and the event name contains "read".
trace-cmd report --event read
The above will match all events that contain "read" in its name. Also it
may list all events of a system that contains "read" as well.
This will parse the event format strings that are stored in the
trace.dat file and return whether the formats can be parsed
correctly. It will load plugins unless -N is specified.
Print the full timestamp. The timestamps in the data file are
usually recorded to the nanosecond. But the default display of
the timestamp is only to the microsecond. To see the full
timestamp, add the -t option.
Add a filter to limit what events are displayed. The format of
the filter is:
<events> ':' <filter>
<events> = SYSTEM'/'EVENT | SYSTEM | EVENT | <events> ',' <events>
<filter> = EVENT_FIELD <op> <value> | <filter> '&&' <filter> |
<filter> '||' <filter> | '(' <filter> ')' | '!' <filter>
<op> = '==' | '!=' | '>=' | '<=' | '>' | '<' | '&' | '|' | '^' |
'+' | '-' | '*' | '/' | '%'
<value> = NUM | STRING | EVENT_FIELD
SYSTEM is the name of the system to filter on. If the EVENT is left out,
then it applies to all events under the SYSTEM. If only one string is used
without the '/' to deliminate between SYSTEM and EVENT, then the filter
will be applied to all systems and events that match the given string.
Whitespace is ignored, such that "sched:next_pid==123" is equivalent to
"sched : next_pid == 123".
STRING is defined with single or double quotes (single quote must end with
single quote, and double with double). Whitespace within quotes are not
The representation of a SYSTEM or EVENT may also be a regular expression
as defined by 'regcomp(3)'.
The EVENT_FIELD is the name of the field of an event that is being
filtered. If the event does not contain the EVENT_FIELD, that part of the
equation will be considered false.
-F 'sched : bogus == 1 || common_pid == 2'
The "bogus == 1" will always evaluate to FALSE because no event has a
field called "bogus", but the "common_pid == 2" will still be evaluated
since all events have the field "common_pid". Any "sched" event that was
traced by the process with the PID of 2 will be shown.
Note, the EVENT_FIELD is the field name as shown by an events format
(as displayed with *--events*), and not what is found in the output.
If the output shows "ID:foo" but the field that "foo" belongs to was
called "name" in the event format, then "name" must be used in the filter.
The same is true about values. If the value that is displayed is converted
by to a string symbol, the filter checks the original value and not the
value displayed. For example, to filter on all tasks that were in the
running state at a context switch:
-F 'sched/sched_switch : prev_state==0'
Although the output displays 'R', having 'prev_stat=="R"' will not work.
Note: You can also specify 'COMM' as an EVENT_FIELD. This will use the
task name (or comm) of the record to compare. For example, to filter out
all of the "trace-cmd" tasks:
-F '.*:COMM != "trace-cmd"'
Do not print events where the HARDIRQ latency flag is set. This
will filter out most events that are from interrupt context.
Note, it may not filter out function traced functions that are in
interrupt context but were called before the kernel "in
interrupt" flag was set.
Do not print events where the SOFTIRQ latency flag is set. This
will filter out most events that are from soft interrupt context.
This causes the following filters of -F to filter out the
-v -F 'sched/sched_switch : prev_state == 0'
Will not display any sched_switch events that have a prev_state of 0.
Removing the *-v* will only print out those events.
Test the filters of -F. After processing a filter string, the
resulting filter will be displayed for each event. This is useful
for using a filter for more than one event where a field may not
exist in all events. Also it can be used to make sure there are
no misspelled event field names, as they will simply be ignored.
-T is ignored if -F is not specified.
Show the plugins that are loaded.
This will not load system wide plugins. It loads "local only".
That is what it finds in the ~/.trace-cmd/plugins directory.
This will not load any plugins.
This will cause all events that match the option to ignore any
registered handler (by the plugins) to print the event. The
normal event will be printed instead. The event-re is a regular
expression as defined by regcomp(3).
With the --profile option, "trace-cmd report" will process all
the events first, and then output a format showing where tasks
have spent their time in the kernel, as well as where they are
blocked the most, and where wake up latencies are.
See trace-cmd-profile(1) for more details and examples.
Set interrupt (soft and hard) events as global (associated to CPU
instead of tasks). Only works for --profile.
Add custom event matching to connect any two events together.
See trace-cmd-profile(1) for format.
This will show the events in "raw" format. That is, it will
ignore the event’s print formatting and just print the contents
of each field.
This will cause all events that match the option to print its raw
fields. The event-re is a regular expression as defined by
This adds a "latency output" format. Information about interrupts
being disabled, soft irq being disabled, the "need_resched" flag
being set, preempt count, and big kernel lock are all being
recorded with every event. But the default display does not show
this information. This option will set display this information
with 6 characters. When one of the fields is zero or N/A a '.\'
<idle>-0 0d.h1. 106467.859747: function: ktime_get <-- tick_check_idle
The 0d.h1. denotes this information. The first character is never a '.'
and represents what CPU the trace was recorded on (CPU 0). The 'd' denotes
that interrupts were disabled. The 'h' means that this was called inside
an interrupt handler. The '1' is the preemption disabled (preempt_count)
was set to one. The two '.'s are "need_resched" flag and kernel lock
counter. If the "need_resched" flag is set, then that character would be a
If both the sched_switch and sched_wakeup events are enabled,
then this option will report the latency between the time the
task was first woken, and the time it was scheduled in.
Quiet non critical warnings.
Pass options to the trace-cmd plugins that are loaded.
The 'plugin:' and '=value' are optional. Value may be left off for options
that are boolean. If the 'plugin:' is left off, then any variable that matches
in all plugins will be set.
Example: -O fgraph:tailprint
If the trace.dat file recorded the final stats (outputed at the
end of record) the --stat option can be used to retrieve them.
If the trace.dat file recorded uname during the run, this will
retrieve that information.
Add (or subtract if negative) an offset for all timestamps of the
previous data file specified with -i. This is useful to merge
sort multiple trace.dat files where the difference in the
timestamp is known. For example if a trace is done on a virtual
guest, and another trace is done on the host. If the host
timestamp is 1000 units ahead of the guest, the following can be
trace-cmd report -i host.dat --ts-offset -1000 -i guest.dat
This will subtract 1000 timestamp units from all the host events as it merges
with the guest.dat events. Note, the units is for the raw units recorded in
the trace. If the units are nanoseconds, the addition (or subtraction) from
the offset will be nanoseconds even if the displayed units are microseconds.
Convert the current clock source into a second (nanosecond
resolution) output. When using clocks like x86-tsc, if the
frequency is known, by passing in the clock frequency, this will
convert the time to seconds.
This option affects any trace.dat file given with *-i* proceeding it.
If this option comes before any *-i* option, then that value becomes
the default conversion for all other trace.dat files. If another
--ts2secs option appears after a *-i* trace.dat file, than that option
will override the default value.
Example: On a 3.4 GHz machine
trace-cmd record -p function -C x86-tsc
trace-cmd report --ts2ns 3400000000
The report will convert the cycles timestamps into a readable second
display. The default display resolution is microseconds, unless *-t*
The value of --ts-offset must still be in the raw timestamp units, even
with this option. The offset will be converted as well.
Show the time differences between events. The difference will
appear in parenthesis just after the timestamp.
This page is part of the trace-cmd (a front-end for Ftrace) project.
Information about the project can be found at [unknown -- if you
know, please contact firstname.lastname@example.org] If you have a bug report for
this manual page, send it to Steven Rostedt <email@example.com>.
This page was obtained from the project's upstream Git repository
on 2017-03-13. If you discover any rendering problems in this HTML
version of the page, or you believe there is a better or more up-to-
date source for the page, or you have corrections or improvements to
the information in this COLOPHON (which is not part of the original
manual page), send a mail to firstname.lastname@example.org