diff options
author | David Ahern <dsahern@gmail.com> | 2015-03-24 11:52:41 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-03-24 12:02:46 -0400 |
commit | e03eaa400cf8b8bded86cc5c41018a1c69152f16 (patch) | |
tree | 50864d78ede1a333b0b6fb8fe09486ed3f3ad1c2 /tools/perf/util/thread.h | |
parent | 6b1f342354d45c651cabd2ae0f61f55846f33e10 (diff) |
perf tools: Add pid/tid filtering to report and script commands
The 'record' and 'top' tools already allow a user to specify a CSV of
pids and/or tids of tasks to collect data.
Add those options to the 'report' and 'script' analysis commands to only
consider samples related to the given pids/tids.
This is also inline with the existing comm option.
Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1427212361-7066-1-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/thread.h')
-rw-r--r-- | tools/perf/util/thread.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h index 783b6688d2f7..9b8a54dc34a8 100644 --- a/tools/perf/util/thread.h +++ b/tools/perf/util/thread.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <sys/types.h> | 7 | #include <sys/types.h> |
8 | #include "symbol.h" | 8 | #include "symbol.h" |
9 | #include <strlist.h> | 9 | #include <strlist.h> |
10 | #include <intlist.h> | ||
10 | 11 | ||
11 | struct thread_stack; | 12 | struct thread_stack; |
12 | 13 | ||
@@ -100,6 +101,16 @@ static inline bool thread__is_filtered(struct thread *thread) | |||
100 | return true; | 101 | return true; |
101 | } | 102 | } |
102 | 103 | ||
104 | if (symbol_conf.pid_list && | ||
105 | !intlist__has_entry(symbol_conf.pid_list, thread->pid_)) { | ||
106 | return true; | ||
107 | } | ||
108 | |||
109 | if (symbol_conf.tid_list && | ||
110 | !intlist__has_entry(symbol_conf.tid_list, thread->tid)) { | ||
111 | return true; | ||
112 | } | ||
113 | |||
103 | return false; | 114 | return false; |
104 | } | 115 | } |
105 | 116 | ||