Skip to contentSkip to conversation

trace-cmd: filter out specific pids

PATCH Applied Josef Bacik 2 participants 2 messages Dec 4, 2015 – Feb 23, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 trace-cmd: filter out specific pids

Sometimes it is a good idea to filter out events from the recording processes and even other pids, for example an external app that links against libtracecmd that watches syscalls probably doesn't want its own syscalls showing up in the events. So add the ability to filter _out_ certain pids for the events that are enabled. The recorder threads will add their pids to this list, but they are only filtered if the library consumer filters out a pid or if the trace-cmd record user tries to filter anything out. Thanks,

---
 trace-cmd.h    |  1 +
 trace-record.c | 44 +++++++++++++++++++++++++++++++++++---------
 2 files changed, 36 insertions(+), 9 deletions(-)
trace-cmd.h +1 -0
index 6bbc97a..3a230b4 100644
@@ -295,6 +295,7 @@ void tracecmd_start_threads(enum tracecmd_trace_type type,
 			    tracecmd_handle_init_func handle_init, int global);
 void tracecmd_stop_threads(enum tracecmd_trace_type type);
 int tracecmd_stream_loop(struct timeval *tv);
+void tracecmd_filter_pid(int pid, int exclude);
 
 /* --- Plugin handling --- */
 extern struct pevent_plugin_option trace_ftrace_options[];
trace-record.c +35 -9

130 lines not on this page · raw message

Signature · 1 line
2.5.0
#1 lore raw
Quoted 9 lines · On Fri, 4 Dec 2015 12:03:38 -0500 Josef Bacik <[email protected]> wrote:

Sometimes it is a good idea to filter out events from the recording processes and even other pids, for example an external app that links against libtracecmd that watches syscalls probably doesn't want its own syscalls showing up in the events. So add the ability to filter _out_ certain pids for the events that are enabled. The recorder threads will add their pids to this list, but they are only filtered if the library consumer filters out a pid or if the trace-cmd record user tries to filter anything out. Thanks,

Applied, thanks!

-- Steve