diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-01-10 08:37:27 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-01-13 08:06:25 -0500 |
commit | 0050f7aa182e3e8ed34dd6cc4318e52b3df6347a (patch) | |
tree | 472540f557462f51a73b7cd44c27792edd48e4d8 /tools/perf/builtin-script.c | |
parent | f6d8b0571c9ac8f273d18c112c2fc3c9533c9f0a (diff) |
perf evlist: Introduce evlist__for_each() & friends
For the common evsel list traversal, so that it becomes more compact.
Use the opportunity to start ditching the 'perf_' from 'perf_evlist__',
as discussed, as the whole conversion touches a lot of places, lets do
it piecemeal when we have the chance due to other work, like in this
case.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-qnkx7dzm2h6m6uptkfk03ni6@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-script.c')
-rw-r--r-- | tools/perf/builtin-script.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 6040000bdfa6..9e9c91f5b7fa 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c | |||
@@ -603,7 +603,7 @@ static int process_attr(struct perf_tool *tool, union perf_event *event, | |||
603 | if (evsel->attr.type >= PERF_TYPE_MAX) | 603 | if (evsel->attr.type >= PERF_TYPE_MAX) |
604 | return 0; | 604 | return 0; |
605 | 605 | ||
606 | list_for_each_entry(pos, &evlist->entries, node) { | 606 | evlist__for_each(evlist, pos) { |
607 | if (pos->attr.type == evsel->attr.type && pos != evsel) | 607 | if (pos->attr.type == evsel->attr.type && pos != evsel) |
608 | return 0; | 608 | return 0; |
609 | } | 609 | } |
@@ -1309,8 +1309,7 @@ static int check_ev_match(char *dir_name, char *scriptname, | |||
1309 | snprintf(evname, len + 1, "%s", p); | 1309 | snprintf(evname, len + 1, "%s", p); |
1310 | 1310 | ||
1311 | match = 0; | 1311 | match = 0; |
1312 | list_for_each_entry(pos, | 1312 | evlist__for_each(session->evlist, pos) { |
1313 | &session->evlist->entries, node) { | ||
1314 | if (!strcmp(perf_evsel__name(pos), evname)) { | 1313 | if (!strcmp(perf_evsel__name(pos), evname)) { |
1315 | match = 1; | 1314 | match = 1; |
1316 | break; | 1315 | break; |