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:
@@ -208,7 +208,7 @@ static int add_hist_entries(struct perf_evlist *evlist, struct machine *machine)
|
||||
* However the second evsel also has a collapsed entry for
|
||||
* "bash [libc] malloc" so total 9 entries will be in the tree.
|
||||
*/
|
||||
list_for_each_entry(evsel, &evlist->entries, node) {
|
||||
evlist__for_each(evlist, evsel) {
|
||||
for (k = 0; k < ARRAY_SIZE(fake_common_samples); k++) {
|
||||
const union perf_event event = {
|
||||
.header = {
|
||||
@@ -466,7 +466,7 @@ int test__hists_link(void)
|
||||
if (err < 0)
|
||||
goto out;
|
||||
|
||||
list_for_each_entry(evsel, &evlist->entries, node) {
|
||||
evlist__for_each(evlist, evsel) {
|
||||
hists__collapse_resort(&evsel->hists, NULL);
|
||||
|
||||
if (verbose > 2)
|
||||
|
Reference in New Issue
Block a user