linux/tools/perf/Documentation
David Ahern 745f43e343 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>
2011-03-14 17:06:16 -03:00
..
asciidoc.conf perf_counter tools: Move from Documentation/perf_counter/ to tools/perf/ 2009-06-06 20:33:43 +02:00
examples.txt perf: Rename perf-examples.txt to examples.txt 2009-08-17 10:43:42 +02:00
Makefile perf tools: Update Makefile with some help 2011-02-16 14:47:56 -02:00
manpage-1.72.xsl perf_counter tools: Move from Documentation/perf_counter/ to tools/perf/ 2009-06-06 20:33:43 +02:00
manpage-base.xsl perf_counter tools: Move from Documentation/perf_counter/ to tools/perf/ 2009-06-06 20:33:43 +02:00
manpage-bold-literal.xsl perf_counter tools: Move from Documentation/perf_counter/ to tools/perf/ 2009-06-06 20:33:43 +02:00
manpage-normal.xsl perf_counter tools: Move from Documentation/perf_counter/ to tools/perf/ 2009-06-06 20:33:43 +02:00
manpage-suppress-sp.xsl perf_counter tools: Move from Documentation/perf_counter/ to tools/perf/ 2009-06-06 20:33:43 +02:00
perf-annotate.txt perf annotate: Document missing options. 2010-12-01 18:22:45 -02:00
perf-archive.txt perf archive: Add documentation 2010-01-20 08:54:58 +01:00
perf-bench.txt perf tools: Fixup minor doc formatting issues 2010-05-05 11:23:27 -03:00
perf-buildid-cache.txt perf man pages: Fix cut'n'paste error 2010-07-28 11:30:10 -03:00
perf-buildid-list.txt perf buildid-list: Document missing options 2010-12-01 18:22:45 -02:00
perf-diff.txt perf symbols: Add symfs option for off-box analysis using specified tree 2010-12-21 20:17:51 -02:00
perf-help.txt perf_counter tools: Move from Documentation/perf_counter/ to tools/perf/ 2009-06-06 20:33:43 +02:00
perf-inject.txt perf inject: Add missing bits 2010-05-04 10:48:22 -03:00
perf-kmem.txt perf tools: Fixup minor doc formatting issues 2010-05-05 11:23:27 -03:00
perf-kvm.txt perf kvm: Document missing options 2010-12-01 18:22:46 -02:00
perf-list.txt perf list: Allow filtering list of events 2011-02-17 15:38:58 -02:00
perf-lock.txt perf lock: Document valid sort keys 2011-02-23 07:29:33 -03:00
perf-probe.txt perf probe: Support function@filename syntax for --line 2011-02-16 17:03:23 -02:00
perf-record.txt perf tool: Add cgroup support 2011-02-16 13:30:48 +01:00
perf-report.txt perf symbols: Add symfs option for off-box analysis using specified tree 2010-12-21 20:17:51 -02:00
perf-sched.txt perf sched: Document missing options 2010-12-01 18:22:48 -02:00
perf-script-perl.txt perf: Rename 'perf trace' to 'perf script' 2010-11-16 19:37:44 +01:00
perf-script-python.txt perf: Rename 'perf trace' to 'perf script' 2010-11-16 19:37:44 +01:00
perf-script.txt perf script: Support custom field selection for output 2011-03-14 17:06:16 -03:00
perf-stat.txt perf tool: Add cgroup support 2011-02-16 13:30:48 +01:00
perf-test.txt perf test: Fix spelling mistake in documentation 2010-12-01 18:22:49 -02:00
perf-timechart.txt perf symbols: Add symfs option for off-box analysis using specified tree 2010-12-21 20:17:51 -02:00
perf-top.txt perf top: Document missing options 2010-12-01 18:22:48 -02:00
perf.txt perf: Fix few typos + cosmetics 2010-01-13 17:39:44 +01:00