[tip:perf/core] perf evsel: Adopt MATCH_EVENT macro from 'stat'

Previous thread: [tip:perf/core] perf tools: Introduce event selectors by tip-bot for Arnaldo Carvalho de Melo on Tuesday, January 4, 2011 - 1:21 am. (1 message)

Next thread: [tip:perf/core] perf util: Move do_read from session to util by tip-bot for Arnaldo Carvalho de Melo on Tuesday, January 4, 2011 - 1:22 am. (1 message)
From: tip-bot for Arnaldo Carvalho de Melo
Date: Tuesday, January 4, 2011 - 1:21 am

Commit-ID:  daec78a09de3df5fbfbbd167da0304d49d7fcfe5
Gitweb:     http://git.kernel.org/tip/daec78a09de3df5fbfbbd167da0304d49d7fcfe5
Author:     Arnaldo Carvalho de Melo <acme@redhat.com>
AuthorDate: Mon, 3 Jan 2011 16:49:44 -0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 3 Jan 2011 16:49:44 -0200

perf evsel: Adopt MATCH_EVENT macro from 'stat'

Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-stat.c |   37 ++++++++++++++++---------------------
 tools/perf/util/evsel.h   |    4 ++++
 2 files changed, 20 insertions(+), 21 deletions(-)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 511ebaf..3e5f356 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -170,10 +170,6 @@ struct stats			runtime_cycles_stats[MAX_NR_CPUS];
 struct stats			runtime_branches_stats[MAX_NR_CPUS];
 struct stats			walltime_nsecs_stats;
 
-#define MATCH_EVENT(t, c, evsel)			\
-	(evsel->attr.type == PERF_TYPE_##t &&	\
-	 evsel->attr.config == PERF_COUNT_##c)
-
 #define ERR_PERF_OPEN \
 "counter %d, sys_perf_event_open() syscall returned with %d (%s).  /bin/dmesg may provide additional information."
 
@@ -229,10 +225,10 @@ static int create_perf_stat_counter(struct perf_evsel *evsel, bool *perm_err)
 /*
  * Does the counter have nsecs as a unit?
  */
-static inline int nsec_counter(struct perf_evsel *counter)
+static inline int nsec_counter(struct perf_evsel *evsel)
 {
-	if (MATCH_EVENT(SOFTWARE, SW_CPU_CLOCK, counter) ||
-	    MATCH_EVENT(SOFTWARE, SW_TASK_CLOCK, counter))
+	if (perf_evsel__match(evsel, SOFTWARE, SW_CPU_CLOCK) ||
+	    perf_evsel__match(evsel, SOFTWARE, SW_TASK_CLOCK))
 ...
Previous thread: [tip:perf/core] perf tools: Introduce event selectors by tip-bot for Arnaldo Carvalho de Melo on Tuesday, January 4, 2011 - 1:21 am. (1 message)

Next thread: [tip:perf/core] perf util: Move do_read from session to util by tip-bot for Arnaldo Carvalho de Melo on Tuesday, January 4, 2011 - 1:22 am. (1 message)