Skip to contentSkip to conversation

perf trace: Allow specifying list of syscalls and events in -e/--expr/--event

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Jan 12, 2017 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  017037ff3d0b11842012878a546fe2df47822259
Gitweb:     http://git.kernel.org/tip/017037ff3d0b11842012878a546fe2df47822259
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Mon, 9 Jan 2017 17:26:26 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 11 Jan 2017 16:48:01 -0300

perf trace: Allow specifying list of syscalls and events in -e/--expr/--event

Makes it easier to specify both events and syscalls (to be formatter strace-like), i.e. previously one would have to do:

  # perf trace -e nanosleep --event sched:sched_switch usleep 1

Now it is possible to do:

  # perf trace -e nanosleep,sched:sched_switch usleep 1
     0.000 ( 0.021 ms): usleep/17962 nanosleep(rqtp: 0x7ffdedd61ec0) ...
     0.021 (         ): sched:sched_switch:usleep:17962 [120] S ==> swapper/1:0 [120])
     0.000 ( 0.066 ms): usleep/17962  ... [continued]: nanosleep()) = 0
  #

The old style --expr and using both -e and --event continues to work.

---
 tools/perf/Documentation/perf-trace.txt |   8 +--
 tools/perf/builtin-trace.c              | 120 ++++++++++++++++++++++++--------
 2 files changed, 96 insertions(+), 32 deletions(-)
tools/perf/Documentation/perf-trace.txt +4 -4
index 781b019..afd7286 100644
@@ -35,7 +35,10 @@ OPTIONS
 
 -e::
 --expr::
-	List of syscalls to show, currently only syscall names.
+--event::
+	List of syscalls and other perf events (tracepoints, HW cache events,
+	etc) to show.
+	See 'perf list' for a complete list of events.
 	Prefixing with ! shows all syscalls but the ones specified.  You may
 	need to escape it.
 
@@ -135,9 +138,6 @@ the thread executes on the designated CPUs. Default is to monitor all CPUs.
 --kernel-syscall-graph::
 	 Show the kernel callchains on the syscall exit path.
 
---event::
-	Trace other events, see 'perf list' for a complete list.
-
 --max-stack::
         Set the stack depth limit when parsing the callchain, anything
         beyond the specified depth will be ignored. Note that at this point
tools/perf/builtin-trace.c +92 -28

154 lines not on this page · raw message