diff options
author | David Ahern <daahern@cisco.com> | 2011-03-10 00:23:26 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-03-14 16:06:16 -0400 |
commit | 745f43e3433a7939bd9c351c8106e0c1db2044c6 (patch) | |
tree | 68955a0bd5e4d179194bf3296c946e5bf745dae8 /tools/perf/Documentation/perf-script.txt | |
parent | c70c94b47405d2c94df19c16273daf1f5fb9193d (diff) |
perf script: Support custom field selection for output
Allow a user to select which fields to print to stdout for event data.
Options include comm (command name), tid (thread id), pid (process id),
time (perf timestamp), cpu, event (for event name), and trace (for
trace data).
Default is set to maintain compatibility with current output; this
feature does alter output format slightly -- no '-' between command
and pid/tid.
Thanks to Frederic Weisbecker for detailed suggestions on this approach.
Examples (output compressed)
1. trace, default format
perf record -ga -e sched:sched_switch
perf script
swapper 0 [000] 537.037184: sched_switch: prev_comm=swapper prev_pid=0...
sshd 1675 [000] 537.037309: sched_switch: prev_comm=sshd prev_pid=1675...
netstat 1692 [001] 537.038664: sched_switch: prev_comm=netstat prev_pid=1692...
2. trace, custom format
perf record -ga -e sched:sched_switch
perf script -f comm,pid,time,trace <--- omitting cpu and event name
swapper 0 537.037184: prev_comm=swapper prev_pid=0 prev_prio=120 ...
sshd 1675 537.037309: prev_comm=sshd prev_pid=1675 prev_prio=120 ...
netstat 1692 537.038664: prev_comm=netstat prev_pid=1692 prev_prio=120 ...
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
LKML-Reference: <1299734608-5223-5-git-send-email-daahern@cisco.com>
Signed-off-by: David Ahern <daahern@cisco.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/Documentation/perf-script.txt')
-rw-r--r-- | tools/perf/Documentation/perf-script.txt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt index 29ad94293cd2..b73cf589c109 100644 --- a/tools/perf/Documentation/perf-script.txt +++ b/tools/perf/Documentation/perf-script.txt | |||
@@ -112,6 +112,11 @@ OPTIONS | |||
112 | --debug-mode:: | 112 | --debug-mode:: |
113 | Do various checks like samples ordering and lost events. | 113 | Do various checks like samples ordering and lost events. |
114 | 114 | ||
115 | -f:: | ||
116 | --fields | ||
117 | Comma separated list of fields to print. Options are: | ||
118 | comm, tid, pid, time, cpu, event, trace | ||
119 | |||
115 | SEE ALSO | 120 | SEE ALSO |
116 | -------- | 121 | -------- |
117 | linkperf:perf-record[1], linkperf:perf-script-perl[1], | 122 | linkperf:perf-record[1], linkperf:perf-script-perl[1], |