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-top.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-top.c')
-rw-r--r-- | tools/perf/builtin-top.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index e0fd0aa57f06..569dd87690ef 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -482,7 +482,7 @@ static bool perf_top__handle_keypress(struct perf_top *top, int c) | |||
482 | 482 | ||
483 | fprintf(stderr, "\nAvailable events:"); | 483 | fprintf(stderr, "\nAvailable events:"); |
484 | 484 | ||
485 | list_for_each_entry(top->sym_evsel, &top->evlist->entries, node) | 485 | evlist__for_each(top->evlist, top->sym_evsel) |
486 | fprintf(stderr, "\n\t%d %s", top->sym_evsel->idx, perf_evsel__name(top->sym_evsel)); | 486 | fprintf(stderr, "\n\t%d %s", top->sym_evsel->idx, perf_evsel__name(top->sym_evsel)); |
487 | 487 | ||
488 | prompt_integer(&counter, "Enter details event counter"); | 488 | prompt_integer(&counter, "Enter details event counter"); |
@@ -493,7 +493,7 @@ static bool perf_top__handle_keypress(struct perf_top *top, int c) | |||
493 | sleep(1); | 493 | sleep(1); |
494 | break; | 494 | break; |
495 | } | 495 | } |
496 | list_for_each_entry(top->sym_evsel, &top->evlist->entries, node) | 496 | evlist__for_each(top->evlist, top->sym_evsel) |
497 | if (top->sym_evsel->idx == counter) | 497 | if (top->sym_evsel->idx == counter) |
498 | break; | 498 | break; |
499 | } else | 499 | } else |
@@ -575,7 +575,7 @@ static void *display_thread_tui(void *arg) | |||
575 | * Zooming in/out UIDs. For now juse use whatever the user passed | 575 | * Zooming in/out UIDs. For now juse use whatever the user passed |
576 | * via --uid. | 576 | * via --uid. |
577 | */ | 577 | */ |
578 | list_for_each_entry(pos, &top->evlist->entries, node) | 578 | evlist__for_each(top->evlist, pos) |
579 | pos->hists.uid_filter_str = top->record_opts.target.uid_str; | 579 | pos->hists.uid_filter_str = top->record_opts.target.uid_str; |
580 | 580 | ||
581 | perf_evlist__tui_browse_hists(top->evlist, help, &hbt, top->min_percent, | 581 | perf_evlist__tui_browse_hists(top->evlist, help, &hbt, top->min_percent, |
@@ -858,7 +858,7 @@ static int perf_top__start_counters(struct perf_top *top) | |||
858 | 858 | ||
859 | perf_evlist__config(evlist, opts); | 859 | perf_evlist__config(evlist, opts); |
860 | 860 | ||
861 | list_for_each_entry(counter, &evlist->entries, node) { | 861 | evlist__for_each(evlist, counter) { |
862 | try_again: | 862 | try_again: |
863 | if (perf_evsel__open(counter, top->evlist->cpus, | 863 | if (perf_evsel__open(counter, top->evlist->cpus, |
864 | top->evlist->threads) < 0) { | 864 | top->evlist->threads) < 0) { |