diff options
author | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2017-05-01 15:45:23 -0400 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2017-05-01 15:45:23 -0400 |
commit | 326fe045ca201a1e747767cee10b4d1fd94a4d80 (patch) | |
tree | d558d53176da894143562038db8d492b4c6b6e4f | |
parent | 821d7935c7fe3fd3d412efb6343ccd4065f84ba8 (diff) | |
download | trace-cmd-326fe045ca201a1e747767cee10b4d1fd94a4d80.tar.gz |
trace-cmd record: Fix filtering when using set_event_pid
When set_event_pid exists, trace-cmd uses it for filtering tasks. A commit
that updates the pid filtering was not updated to handle excludes of the
tracing, and they were added too, causing more to be filtered than what
should have been.
Fixes: a5923c5c9f81 ("trace-cmd: Filter out specific pids")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
-rw-r--r-- | trace-record.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/trace-record.c b/trace-record.c index bd60892a..1b55043e 100644 --- a/trace-record.c +++ b/trace-record.c @@ -2042,11 +2042,16 @@ static void update_pid_filters(struct buffer_instance *instance) str = filter; for (p = filter_pids; p; p = p->next) { + if (p->exclude) + continue; len = sprintf(str, "%d ", p->pid); str += len; } - len = len_filter_pids + nr_filter_pids; + if (filter == str) + goto out; + + len = str - filter; str = filter; do { ret = write(fd, str, len); @@ -2056,6 +2061,7 @@ static void update_pid_filters(struct buffer_instance *instance) len -= ret; } while (ret >= 0 && len); + out: close(fd); } |