From: David Ahern Date: Mon, 18 Nov 2013 20:32:47 +0000 (-0700) Subject: perf thread: Move comm_list check into function X-Git-Tag: submit/tizen/20160422.055611~1^2~99^2~18^2~2397^2~19^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1f3878c11ca8c9f2d9545ec6e1e6bb5386e0565f;p=sdk%2Femulator%2Femulator-kernel.git perf thread: Move comm_list check into function Signed-off-by: David Ahern Cc: Frederic Weisbecker Cc: Ingo Molnar Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/1384806771-2945-5-git-send-email-dsahern@gmail.com Signed-off-by: Arnaldo Carvalho de Melo --- 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, if (thread == NULL) return -1; - if (symbol_conf.comm_list && - !strlist__has_entry(symbol_conf.comm_list, thread__comm_str(thread))) + if (thread__is_filtered(thread)) goto out_filtered; 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 @@ #include #include #include "symbol.h" +#include struct thread { union { @@ -66,4 +67,15 @@ static inline void thread__set_priv(struct thread *thread, void *p) { thread->priv = p; } + +static inline bool thread__is_filtered(struct thread *thread) +{ + if (symbol_conf.comm_list && + !strlist__has_entry(symbol_conf.comm_list, thread__comm_str(thread))) { + return true; + } + + return false; +} + #endif /* __PERF_THREAD_H */