path: root/tools/perf/Documentation/perf-script.txt
diff options
authorDavid Ahern <>2011-03-09 22:23:26 -0700
committerArnaldo Carvalho de Melo <>2011-03-14 17:06:16 -0300
commit745f43e3433a7939bd9c351c8106e0c1db2044c6 (patch)
tree68955a0bd5e4d179194bf3296c946e5bf745dae8 /tools/perf/Documentation/perf-script.txt
parentc70c94b47405d2c94df19c16273daf1f5fb9193d (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 <> Cc: Frederic Weisbecker <> Cc: Ingo Molnar <> Cc: Paul Mackerras <> Cc: Peter Zijlstra <> Cc: Thomas Gleixner <> LKML-Reference: <> Signed-off-by: David Ahern <> Signed-off-by: Arnaldo Carvalho de Melo <>
Diffstat (limited to 'tools/perf/Documentation/perf-script.txt')
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
Do various checks like samples ordering and lost events.
+ Comma separated list of fields to print. Options are:
+ comm, tid, pid, time, cpu, event, trace
linkperf:perf-record[1], linkperf:perf-script-perl[1],