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>
This commit is contained in:
Arnaldo Carvalho de Melo
2014-01-10 10:37:27 -03:00
parent f6d8b0571c
commit 0050f7aa18
24 changed files with 151 additions and 86 deletions

View File

@@ -384,7 +384,7 @@ static int perf_evlist__tty_browse_hists(struct perf_evlist *evlist,
{
struct perf_evsel *pos;
list_for_each_entry(pos, &evlist->entries, node) {
evlist__for_each(evlist, pos) {
struct hists *hists = &pos->hists;
const char *evname = perf_evsel__name(pos);
@@ -495,7 +495,7 @@ static u64 report__collapse_hists(struct report *rep)
* Count number of histogram entries to use when showing progress,
* reusing nr_samples variable.
*/
list_for_each_entry(pos, &rep->session->evlist->entries, node)
evlist__for_each(rep->session->evlist, pos)
nr_samples += pos->hists.nr_entries;
ui_progress__init(&prog, nr_samples, "Merging related events...");
@@ -505,7 +505,7 @@ static u64 report__collapse_hists(struct report *rep)
*/
nr_samples = 0;
list_for_each_entry(pos, &rep->session->evlist->entries, node) {
evlist__for_each(rep->session->evlist, pos) {
struct hists *hists = &pos->hists;
if (pos->idx == 0)
@@ -582,7 +582,7 @@ static int __cmd_report(struct report *rep)
return 0;
}
list_for_each_entry(pos, &session->evlist->entries, node)
evlist__for_each(session->evlist, pos)
hists__output_resort(&pos->hists);
return report__browse_hists(rep);