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/ui | |
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/ui')
-rw-r--r-- | tools/perf/ui/browsers/hists.c | 5 | ||||
-rw-r--r-- | tools/perf/ui/gtk/hists.c | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index a7045ea6d1d5..b720b92eba6e 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c | |||
@@ -1938,7 +1938,7 @@ static int __perf_evlist__tui_browse_hists(struct perf_evlist *evlist, | |||
1938 | 1938 | ||
1939 | ui_helpline__push("Press ESC to exit"); | 1939 | ui_helpline__push("Press ESC to exit"); |
1940 | 1940 | ||
1941 | list_for_each_entry(pos, &evlist->entries, node) { | 1941 | evlist__for_each(evlist, pos) { |
1942 | const char *ev_name = perf_evsel__name(pos); | 1942 | const char *ev_name = perf_evsel__name(pos); |
1943 | size_t line_len = strlen(ev_name) + 7; | 1943 | size_t line_len = strlen(ev_name) + 7; |
1944 | 1944 | ||
@@ -1970,9 +1970,10 @@ single_entry: | |||
1970 | struct perf_evsel *pos; | 1970 | struct perf_evsel *pos; |
1971 | 1971 | ||
1972 | nr_entries = 0; | 1972 | nr_entries = 0; |
1973 | list_for_each_entry(pos, &evlist->entries, node) | 1973 | evlist__for_each(evlist, pos) { |
1974 | if (perf_evsel__is_group_leader(pos)) | 1974 | if (perf_evsel__is_group_leader(pos)) |
1975 | nr_entries++; | 1975 | nr_entries++; |
1976 | } | ||
1976 | 1977 | ||
1977 | if (nr_entries == 1) | 1978 | if (nr_entries == 1) |
1978 | goto single_entry; | 1979 | goto single_entry; |
diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c index 2ca66cc1160f..5b95c44f3435 100644 --- a/tools/perf/ui/gtk/hists.c +++ b/tools/perf/ui/gtk/hists.c | |||
@@ -375,7 +375,7 @@ int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist, | |||
375 | 375 | ||
376 | gtk_container_add(GTK_CONTAINER(window), vbox); | 376 | gtk_container_add(GTK_CONTAINER(window), vbox); |
377 | 377 | ||
378 | list_for_each_entry(pos, &evlist->entries, node) { | 378 | evlist__for_each(evlist, pos) { |
379 | struct hists *hists = &pos->hists; | 379 | struct hists *hists = &pos->hists; |
380 | const char *evname = perf_evsel__name(pos); | 380 | const char *evname = perf_evsel__name(pos); |
381 | GtkWidget *scrolled_window; | 381 | GtkWidget *scrolled_window; |