diff options
author | David Ahern <dsahern@gmail.com> | 2013-11-18 15:32:47 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-11-27 12:58:37 -0500 |
commit | 1f3878c11ca8c9f2d9545ec6e1e6bb5386e0565f (patch) | |
tree | d08385884e1bdc128cf1054c199b977e8bf43818 | |
parent | 82d1deb0546a4af7a2ddbcfed99690b3a61776c5 (diff) |
perf thread: Move comm_list check into function
Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1384806771-2945-5-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/util/event.c | 3 | ||||
-rw-r--r-- | tools/perf/util/thread.h | 12 |
2 files changed, 13 insertions, 2 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index bb788c109fe6..c77814bf01e1 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c | |||
@@ -732,8 +732,7 @@ int perf_event__preprocess_sample(const union perf_event *event, | |||
732 | if (thread == NULL) | 732 | if (thread == NULL) |
733 | return -1; | 733 | return -1; |
734 | 734 | ||
735 | if (symbol_conf.comm_list && | 735 | if (thread__is_filtered(thread)) |
736 | !strlist__has_entry(symbol_conf.comm_list, thread__comm_str(thread))) | ||
737 | goto out_filtered; | 736 | goto out_filtered; |
738 | 737 | ||
739 | dump_printf(" ... thread: %s:%d\n", thread__comm_str(thread), thread->tid); | 738 | dump_printf(" ... thread: %s:%d\n", thread__comm_str(thread), thread->tid); |
diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h index 897c1b2a750a..5b856bf942e1 100644 --- a/tools/perf/util/thread.h +++ b/tools/perf/util/thread.h | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <unistd.h> | 6 | #include <unistd.h> |
7 | #include <sys/types.h> | 7 | #include <sys/types.h> |
8 | #include "symbol.h" | 8 | #include "symbol.h" |
9 | #include <strlist.h> | ||
9 | 10 | ||
10 | struct thread { | 11 | struct thread { |
11 | union { | 12 | union { |
@@ -66,4 +67,15 @@ static inline void thread__set_priv(struct thread *thread, void *p) | |||
66 | { | 67 | { |
67 | thread->priv = p; | 68 | thread->priv = p; |
68 | } | 69 | } |
70 | |||
71 | static inline bool thread__is_filtered(struct thread *thread) | ||
72 | { | ||
73 | if (symbol_conf.comm_list && | ||
74 | !strlist__has_entry(symbol_conf.comm_list, thread__comm_str(thread))) { | ||
75 | return true; | ||
76 | } | ||
77 | |||
78 | return false; | ||
79 | } | ||
80 | |||
69 | #endif /* __PERF_THREAD_H */ | 81 | #endif /* __PERF_THREAD_H */ |