tracing: Allow triggers to filter for CPU ids and process names
authorDaniel Wagner <daniel.wagner@bmw-carit.de>
Mon, 10 Aug 2015 12:35:46 +0000 (14:35 +0200)
committerSteven Rostedt <rostedt@goodmis.org>
Tue, 11 Aug 2015 22:01:06 +0000 (18:01 -0400)
commit9f61668073a8d80650622e792aff876db9ca23c6
tree4f3416d44b5e350f94a9f46862f896972a569a55
parentc93bf928fea22c61f6b5c04786b325c9bfbc0462
tracing: Allow triggers to filter for CPU ids and process names

By extending the filter rules by more generic fields
we can write triggers filters like

  echo 'stacktrace if cpu == 1' > \
/sys/kernel/debug/tracing/events/raw_syscalls/sys_enter/trigger

or

  echo 'stacktrace if comm == sshd'  > \
/sys/kernel/debug/tracing/events/raw_syscalls/sys_enter/trigger

CPU and COMM are not part of struct trace_entry. We could add the two
new fields to ftrace_common_field list and fix up all depending
sides. But that looks pretty ugly. Another thing I would like to
avoid that the 'format' file contents changes.

All this can be avoided by introducing another list which contains
non field members of struct trace_entry.

Link: http://lkml.kernel.org/r/1439210146-24707-1-git-send-email-daniel.wagner@bmw-carit.de
Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/trace_events.c
kernel/trace/trace_events_filter.c