diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-06-23 10:26:15 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-06-23 10:26:15 -0400 |
commit | e5cadb93d0839d268a7c4199e0fdef0f94722117 (patch) | |
tree | 719409fb3ae40688123aaab224f8d8a8f322f41d /tools | |
parent | 3bd03c9583bfb22cb82eeb09d8445bb79d27ae78 (diff) |
perf evlist: Rename for_each() macros to for_each_entry()
To match the semantics for list.h in the kernel, that are used to
implement those macros.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Taeung Song <treeze.taeung@gmail.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-qbcjlgj0ffxquxscahbpddi3@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
40 files changed, 157 insertions, 157 deletions
diff --git a/tools/perf/arch/x86/util/auxtrace.c b/tools/perf/arch/x86/util/auxtrace.c index 7a7805583e3f..cc1d865e31f1 100644 --- a/tools/perf/arch/x86/util/auxtrace.c +++ b/tools/perf/arch/x86/util/auxtrace.c | |||
@@ -37,7 +37,7 @@ struct auxtrace_record *auxtrace_record__init_intel(struct perf_evlist *evlist, | |||
37 | intel_bts_pmu = perf_pmu__find(INTEL_BTS_PMU_NAME); | 37 | intel_bts_pmu = perf_pmu__find(INTEL_BTS_PMU_NAME); |
38 | 38 | ||
39 | if (evlist) { | 39 | if (evlist) { |
40 | evlist__for_each(evlist, evsel) { | 40 | evlist__for_each_entry(evlist, evsel) { |
41 | if (intel_pt_pmu && | 41 | if (intel_pt_pmu && |
42 | evsel->attr.type == intel_pt_pmu->type) | 42 | evsel->attr.type == intel_pt_pmu->type) |
43 | found_pt = true; | 43 | found_pt = true; |
diff --git a/tools/perf/arch/x86/util/intel-bts.c b/tools/perf/arch/x86/util/intel-bts.c index 7dc30637cf66..5132775a044f 100644 --- a/tools/perf/arch/x86/util/intel-bts.c +++ b/tools/perf/arch/x86/util/intel-bts.c | |||
@@ -124,7 +124,7 @@ static int intel_bts_recording_options(struct auxtrace_record *itr, | |||
124 | btsr->evlist = evlist; | 124 | btsr->evlist = evlist; |
125 | btsr->snapshot_mode = opts->auxtrace_snapshot_mode; | 125 | btsr->snapshot_mode = opts->auxtrace_snapshot_mode; |
126 | 126 | ||
127 | evlist__for_each(evlist, evsel) { | 127 | evlist__for_each_entry(evlist, evsel) { |
128 | if (evsel->attr.type == intel_bts_pmu->type) { | 128 | if (evsel->attr.type == intel_bts_pmu->type) { |
129 | if (intel_bts_evsel) { | 129 | if (intel_bts_evsel) { |
130 | pr_err("There may be only one " INTEL_BTS_PMU_NAME " event\n"); | 130 | pr_err("There may be only one " INTEL_BTS_PMU_NAME " event\n"); |
@@ -327,7 +327,7 @@ static int intel_bts_snapshot_start(struct auxtrace_record *itr) | |||
327 | container_of(itr, struct intel_bts_recording, itr); | 327 | container_of(itr, struct intel_bts_recording, itr); |
328 | struct perf_evsel *evsel; | 328 | struct perf_evsel *evsel; |
329 | 329 | ||
330 | evlist__for_each(btsr->evlist, evsel) { | 330 | evlist__for_each_entry(btsr->evlist, evsel) { |
331 | if (evsel->attr.type == btsr->intel_bts_pmu->type) | 331 | if (evsel->attr.type == btsr->intel_bts_pmu->type) |
332 | return perf_evsel__disable(evsel); | 332 | return perf_evsel__disable(evsel); |
333 | } | 333 | } |
@@ -340,7 +340,7 @@ static int intel_bts_snapshot_finish(struct auxtrace_record *itr) | |||
340 | container_of(itr, struct intel_bts_recording, itr); | 340 | container_of(itr, struct intel_bts_recording, itr); |
341 | struct perf_evsel *evsel; | 341 | struct perf_evsel *evsel; |
342 | 342 | ||
343 | evlist__for_each(btsr->evlist, evsel) { | 343 | evlist__for_each_entry(btsr->evlist, evsel) { |
344 | if (evsel->attr.type == btsr->intel_bts_pmu->type) | 344 | if (evsel->attr.type == btsr->intel_bts_pmu->type) |
345 | return perf_evsel__enable(evsel); | 345 | return perf_evsel__enable(evsel); |
346 | } | 346 | } |
@@ -422,7 +422,7 @@ static int intel_bts_read_finish(struct auxtrace_record *itr, int idx) | |||
422 | container_of(itr, struct intel_bts_recording, itr); | 422 | container_of(itr, struct intel_bts_recording, itr); |
423 | struct perf_evsel *evsel; | 423 | struct perf_evsel *evsel; |
424 | 424 | ||
425 | evlist__for_each(btsr->evlist, evsel) { | 425 | evlist__for_each_entry(btsr->evlist, evsel) { |
426 | if (evsel->attr.type == btsr->intel_bts_pmu->type) | 426 | if (evsel->attr.type == btsr->intel_bts_pmu->type) |
427 | return perf_evlist__enable_event_idx(btsr->evlist, | 427 | return perf_evlist__enable_event_idx(btsr->evlist, |
428 | evsel, idx); | 428 | evsel, idx); |
diff --git a/tools/perf/arch/x86/util/intel-pt.c b/tools/perf/arch/x86/util/intel-pt.c index a07b9605e93b..fb51457ba338 100644 --- a/tools/perf/arch/x86/util/intel-pt.c +++ b/tools/perf/arch/x86/util/intel-pt.c | |||
@@ -131,7 +131,7 @@ static int intel_pt_read_config(struct perf_pmu *intel_pt_pmu, const char *str, | |||
131 | if (!mask) | 131 | if (!mask) |
132 | return -EINVAL; | 132 | return -EINVAL; |
133 | 133 | ||
134 | evlist__for_each(evlist, evsel) { | 134 | evlist__for_each_entry(evlist, evsel) { |
135 | if (evsel->attr.type == intel_pt_pmu->type) { | 135 | if (evsel->attr.type == intel_pt_pmu->type) { |
136 | *res = intel_pt_masked_bits(mask, evsel->attr.config); | 136 | *res = intel_pt_masked_bits(mask, evsel->attr.config); |
137 | return 0; | 137 | return 0; |
@@ -511,7 +511,7 @@ static int intel_pt_recording_options(struct auxtrace_record *itr, | |||
511 | ptr->evlist = evlist; | 511 | ptr->evlist = evlist; |
512 | ptr->snapshot_mode = opts->auxtrace_snapshot_mode; | 512 | ptr->snapshot_mode = opts->auxtrace_snapshot_mode; |
513 | 513 | ||
514 | evlist__for_each(evlist, evsel) { | 514 | evlist__for_each_entry(evlist, evsel) { |
515 | if (evsel->attr.type == intel_pt_pmu->type) { | 515 | if (evsel->attr.type == intel_pt_pmu->type) { |
516 | if (intel_pt_evsel) { | 516 | if (intel_pt_evsel) { |
517 | pr_err("There may be only one " INTEL_PT_PMU_NAME " event\n"); | 517 | pr_err("There may be only one " INTEL_PT_PMU_NAME " event\n"); |
@@ -725,7 +725,7 @@ static int intel_pt_snapshot_start(struct auxtrace_record *itr) | |||
725 | container_of(itr, struct intel_pt_recording, itr); | 725 | container_of(itr, struct intel_pt_recording, itr); |
726 | struct perf_evsel *evsel; | 726 | struct perf_evsel *evsel; |
727 | 727 | ||
728 | evlist__for_each(ptr->evlist, evsel) { | 728 | evlist__for_each_entry(ptr->evlist, evsel) { |
729 | if (evsel->attr.type == ptr->intel_pt_pmu->type) | 729 | if (evsel->attr.type == ptr->intel_pt_pmu->type) |
730 | return perf_evsel__disable(evsel); | 730 | return perf_evsel__disable(evsel); |
731 | } | 731 | } |
@@ -738,7 +738,7 @@ static int intel_pt_snapshot_finish(struct auxtrace_record *itr) | |||
738 | container_of(itr, struct intel_pt_recording, itr); | 738 | container_of(itr, struct intel_pt_recording, itr); |
739 | struct perf_evsel *evsel; | 739 | struct perf_evsel *evsel; |
740 | 740 | ||
741 | evlist__for_each(ptr->evlist, evsel) { | 741 | evlist__for_each_entry(ptr->evlist, evsel) { |
742 | if (evsel->attr.type == ptr->intel_pt_pmu->type) | 742 | if (evsel->attr.type == ptr->intel_pt_pmu->type) |
743 | return perf_evsel__enable(evsel); | 743 | return perf_evsel__enable(evsel); |
744 | } | 744 | } |
@@ -1011,7 +1011,7 @@ static int intel_pt_read_finish(struct auxtrace_record *itr, int idx) | |||
1011 | container_of(itr, struct intel_pt_recording, itr); | 1011 | container_of(itr, struct intel_pt_recording, itr); |
1012 | struct perf_evsel *evsel; | 1012 | struct perf_evsel *evsel; |
1013 | 1013 | ||
1014 | evlist__for_each(ptr->evlist, evsel) { | 1014 | evlist__for_each_entry(ptr->evlist, evsel) { |
1015 | if (evsel->attr.type == ptr->intel_pt_pmu->type) | 1015 | if (evsel->attr.type == ptr->intel_pt_pmu->type) |
1016 | return perf_evlist__enable_event_idx(ptr->evlist, evsel, | 1016 | return perf_evlist__enable_event_idx(ptr->evlist, evsel, |
1017 | idx); | 1017 | idx); |
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index a2324e1892aa..b15e7683f38c 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c | |||
@@ -236,7 +236,7 @@ static int __cmd_annotate(struct perf_annotate *ann) | |||
236 | perf_session__fprintf_dsos(session, stdout); | 236 | perf_session__fprintf_dsos(session, stdout); |
237 | 237 | ||
238 | total_nr_samples = 0; | 238 | total_nr_samples = 0; |
239 | evlist__for_each(session->evlist, pos) { | 239 | evlist__for_each_entry(session->evlist, pos) { |
240 | struct hists *hists = evsel__hists(pos); | 240 | struct hists *hists = evsel__hists(pos); |
241 | u32 nr_samples = hists->stats.nr_events[PERF_RECORD_SAMPLE]; | 241 | u32 nr_samples = hists->stats.nr_events[PERF_RECORD_SAMPLE]; |
242 | 242 | ||
diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c index eac0b1100b8f..21ee753211ad 100644 --- a/tools/perf/builtin-diff.c +++ b/tools/perf/builtin-diff.c | |||
@@ -363,7 +363,7 @@ static struct perf_evsel *evsel_match(struct perf_evsel *evsel, | |||
363 | { | 363 | { |
364 | struct perf_evsel *e; | 364 | struct perf_evsel *e; |
365 | 365 | ||
366 | evlist__for_each(evlist, e) { | 366 | evlist__for_each_entry(evlist, e) { |
367 | if (perf_evsel__match2(evsel, e)) | 367 | if (perf_evsel__match2(evsel, e)) |
368 | return e; | 368 | return e; |
369 | } | 369 | } |
@@ -375,7 +375,7 @@ static void perf_evlist__collapse_resort(struct perf_evlist *evlist) | |||
375 | { | 375 | { |
376 | struct perf_evsel *evsel; | 376 | struct perf_evsel *evsel; |
377 | 377 | ||
378 | evlist__for_each(evlist, evsel) { | 378 | evlist__for_each_entry(evlist, evsel) { |
379 | struct hists *hists = evsel__hists(evsel); | 379 | struct hists *hists = evsel__hists(evsel); |
380 | 380 | ||
381 | hists__collapse_resort(hists, NULL); | 381 | hists__collapse_resort(hists, NULL); |
@@ -681,7 +681,7 @@ static void data_process(void) | |||
681 | struct perf_evsel *evsel_base; | 681 | struct perf_evsel *evsel_base; |
682 | bool first = true; | 682 | bool first = true; |
683 | 683 | ||
684 | evlist__for_each(evlist_base, evsel_base) { | 684 | evlist__for_each_entry(evlist_base, evsel_base) { |
685 | struct hists *hists_base = evsel__hists(evsel_base); | 685 | struct hists *hists_base = evsel__hists(evsel_base); |
686 | struct data__file *d; | 686 | struct data__file *d; |
687 | int i; | 687 | int i; |
diff --git a/tools/perf/builtin-evlist.c b/tools/perf/builtin-evlist.c index 8a31f511e1a0..e09c4287fe87 100644 --- a/tools/perf/builtin-evlist.c +++ b/tools/perf/builtin-evlist.c | |||
@@ -32,7 +32,7 @@ static int __cmd_evlist(const char *file_name, struct perf_attr_details *details | |||
32 | if (session == NULL) | 32 | if (session == NULL) |
33 | return -1; | 33 | return -1; |
34 | 34 | ||
35 | evlist__for_each(session->evlist, pos) { | 35 | evlist__for_each_entry(session->evlist, pos) { |
36 | perf_evsel__fprintf(pos, details, stdout); | 36 | perf_evsel__fprintf(pos, details, stdout); |
37 | 37 | ||
38 | if (pos->attr.type == PERF_TYPE_TRACEPOINT) | 38 | if (pos->attr.type == PERF_TYPE_TRACEPOINT) |
diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c index e5afa8fe1bf1..73c1c4cc3600 100644 --- a/tools/perf/builtin-inject.c +++ b/tools/perf/builtin-inject.c | |||
@@ -562,7 +562,7 @@ static void strip_init(struct perf_inject *inject) | |||
562 | 562 | ||
563 | inject->tool.context_switch = perf_event__drop; | 563 | inject->tool.context_switch = perf_event__drop; |
564 | 564 | ||
565 | evlist__for_each(evlist, evsel) | 565 | evlist__for_each_entry(evlist, evsel) |
566 | evsel->handler = drop_sample; | 566 | evsel->handler = drop_sample; |
567 | } | 567 | } |
568 | 568 | ||
@@ -590,7 +590,7 @@ static bool ok_to_remove(struct perf_evlist *evlist, | |||
590 | if (!has_tracking(evsel_to_remove)) | 590 | if (!has_tracking(evsel_to_remove)) |
591 | return true; | 591 | return true; |
592 | 592 | ||
593 | evlist__for_each(evlist, evsel) { | 593 | evlist__for_each_entry(evlist, evsel) { |
594 | if (evsel->handler != drop_sample) { | 594 | if (evsel->handler != drop_sample) { |
595 | cnt += 1; | 595 | cnt += 1; |
596 | if ((evsel->attr.sample_type & COMPAT_MASK) == | 596 | if ((evsel->attr.sample_type & COMPAT_MASK) == |
@@ -608,7 +608,7 @@ static void strip_fini(struct perf_inject *inject) | |||
608 | struct perf_evsel *evsel, *tmp; | 608 | struct perf_evsel *evsel, *tmp; |
609 | 609 | ||
610 | /* Remove non-synthesized evsels if possible */ | 610 | /* Remove non-synthesized evsels if possible */ |
611 | evlist__for_each_safe(evlist, tmp, evsel) { | 611 | evlist__for_each_entry_safe(evlist, tmp, evsel) { |
612 | if (evsel->handler == drop_sample && | 612 | if (evsel->handler == drop_sample && |
613 | ok_to_remove(evlist, evsel)) { | 613 | ok_to_remove(evlist, evsel)) { |
614 | pr_debug("Deleting %s\n", perf_evsel__name(evsel)); | 614 | pr_debug("Deleting %s\n", perf_evsel__name(evsel)); |
@@ -643,7 +643,7 @@ static int __cmd_inject(struct perf_inject *inject) | |||
643 | } else if (inject->sched_stat) { | 643 | } else if (inject->sched_stat) { |
644 | struct perf_evsel *evsel; | 644 | struct perf_evsel *evsel; |
645 | 645 | ||
646 | evlist__for_each(session->evlist, evsel) { | 646 | evlist__for_each_entry(session->evlist, evsel) { |
647 | const char *name = perf_evsel__name(evsel); | 647 | const char *name = perf_evsel__name(evsel); |
648 | 648 | ||
649 | if (!strcmp(name, "sched:sched_switch")) { | 649 | if (!strcmp(name, "sched:sched_switch")) { |
diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c index 4defe44a4a83..b1d491c2e704 100644 --- a/tools/perf/builtin-kmem.c +++ b/tools/perf/builtin-kmem.c | |||
@@ -1354,7 +1354,7 @@ static int __cmd_kmem(struct perf_session *session) | |||
1354 | goto out; | 1354 | goto out; |
1355 | } | 1355 | } |
1356 | 1356 | ||
1357 | evlist__for_each(session->evlist, evsel) { | 1357 | evlist__for_each_entry(session->evlist, evsel) { |
1358 | if (!strcmp(perf_evsel__name(evsel), "kmem:mm_page_alloc") && | 1358 | if (!strcmp(perf_evsel__name(evsel), "kmem:mm_page_alloc") && |
1359 | perf_evsel__field(evsel, "pfn")) { | 1359 | perf_evsel__field(evsel, "pfn")) { |
1360 | use_pfn = true; | 1360 | use_pfn = true; |
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c index 8f8f90e2b993..f4efef9d1eb3 100644 --- a/tools/perf/builtin-kvm.c +++ b/tools/perf/builtin-kvm.c | |||
@@ -988,7 +988,7 @@ static int kvm_live_open_events(struct perf_kvm_stat *kvm) | |||
988 | * Note: exclude_{guest,host} do not apply here. | 988 | * Note: exclude_{guest,host} do not apply here. |
989 | * This command processes KVM tracepoints from host only | 989 | * This command processes KVM tracepoints from host only |
990 | */ | 990 | */ |
991 | evlist__for_each(evlist, pos) { | 991 | evlist__for_each_entry(evlist, pos) { |
992 | struct perf_event_attr *attr = &pos->attr; | 992 | struct perf_event_attr *attr = &pos->attr; |
993 | 993 | ||
994 | /* make sure these *are* set */ | 994 | /* make sure these *are* set */ |
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index c97b2b69ba0a..81411b14df4c 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -353,7 +353,7 @@ static int record__open(struct record *rec) | |||
353 | 353 | ||
354 | perf_evlist__config(evlist, opts, &callchain_param); | 354 | perf_evlist__config(evlist, opts, &callchain_param); |
355 | 355 | ||
356 | evlist__for_each(evlist, pos) { | 356 | evlist__for_each_entry(evlist, pos) { |
357 | try_again: | 357 | try_again: |
358 | if (perf_evsel__open(pos, pos->cpus, pos->threads) < 0) { | 358 | if (perf_evsel__open(pos, pos->cpus, pos->threads) < 0) { |
359 | if (perf_evsel__fallback(pos, errno, msg, sizeof(msg))) { | 359 | if (perf_evsel__fallback(pos, errno, msg, sizeof(msg))) { |
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index bcb49ff18c1d..f6cb357986c6 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -361,7 +361,7 @@ static int perf_evlist__tty_browse_hists(struct perf_evlist *evlist, | |||
361 | struct perf_evsel *pos; | 361 | struct perf_evsel *pos; |
362 | 362 | ||
363 | fprintf(stdout, "#\n# Total Lost Samples: %" PRIu64 "\n#\n", evlist->stats.total_lost_samples); | 363 | fprintf(stdout, "#\n# Total Lost Samples: %" PRIu64 "\n#\n", evlist->stats.total_lost_samples); |
364 | evlist__for_each(evlist, pos) { | 364 | evlist__for_each_entry(evlist, pos) { |
365 | struct hists *hists = evsel__hists(pos); | 365 | struct hists *hists = evsel__hists(pos); |
366 | const char *evname = perf_evsel__name(pos); | 366 | const char *evname = perf_evsel__name(pos); |
367 | 367 | ||
@@ -478,7 +478,7 @@ static int report__collapse_hists(struct report *rep) | |||
478 | 478 | ||
479 | ui_progress__init(&prog, rep->nr_entries, "Merging related events..."); | 479 | ui_progress__init(&prog, rep->nr_entries, "Merging related events..."); |
480 | 480 | ||
481 | evlist__for_each(rep->session->evlist, pos) { | 481 | evlist__for_each_entry(rep->session->evlist, pos) { |
482 | struct hists *hists = evsel__hists(pos); | 482 | struct hists *hists = evsel__hists(pos); |
483 | 483 | ||
484 | if (pos->idx == 0) | 484 | if (pos->idx == 0) |
@@ -511,7 +511,7 @@ static void report__output_resort(struct report *rep) | |||
511 | 511 | ||
512 | ui_progress__init(&prog, rep->nr_entries, "Sorting events for output..."); | 512 | ui_progress__init(&prog, rep->nr_entries, "Sorting events for output..."); |
513 | 513 | ||
514 | evlist__for_each(rep->session->evlist, pos) | 514 | evlist__for_each_entry(rep->session->evlist, pos) |
515 | perf_evsel__output_resort(pos, &prog); | 515 | perf_evsel__output_resort(pos, &prog); |
516 | 516 | ||
517 | ui_progress__finish(); | 517 | ui_progress__finish(); |
@@ -552,7 +552,7 @@ static int __cmd_report(struct report *rep) | |||
552 | 552 | ||
553 | report__warn_kptr_restrict(rep); | 553 | report__warn_kptr_restrict(rep); |
554 | 554 | ||
555 | evlist__for_each(session->evlist, pos) | 555 | evlist__for_each_entry(session->evlist, pos) |
556 | rep->nr_entries += evsel__hists(pos)->nr_entries; | 556 | rep->nr_entries += evsel__hists(pos)->nr_entries; |
557 | 557 | ||
558 | if (use_browser == 0) { | 558 | if (use_browser == 0) { |
@@ -583,7 +583,7 @@ static int __cmd_report(struct report *rep) | |||
583 | * might be changed during the collapse phase. | 583 | * might be changed during the collapse phase. |
584 | */ | 584 | */ |
585 | rep->nr_entries = 0; | 585 | rep->nr_entries = 0; |
586 | evlist__for_each(session->evlist, pos) | 586 | evlist__for_each_entry(session->evlist, pos) |
587 | rep->nr_entries += evsel__hists(pos)->nr_entries; | 587 | rep->nr_entries += evsel__hists(pos)->nr_entries; |
588 | 588 | ||
589 | if (rep->nr_entries == 0) { | 589 | if (rep->nr_entries == 0) { |
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 46011235af5d..0e18e06e7fd5 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c | |||
@@ -369,7 +369,7 @@ static int perf_session__check_output_opt(struct perf_session *session) | |||
369 | if (!no_callchain) { | 369 | if (!no_callchain) { |
370 | bool use_callchain = false; | 370 | bool use_callchain = false; |
371 | 371 | ||
372 | evlist__for_each(session->evlist, evsel) { | 372 | evlist__for_each_entry(session->evlist, evsel) { |
373 | if (evsel->attr.sample_type & PERF_SAMPLE_CALLCHAIN) { | 373 | if (evsel->attr.sample_type & PERF_SAMPLE_CALLCHAIN) { |
374 | use_callchain = true; | 374 | use_callchain = true; |
375 | break; | 375 | break; |
@@ -389,7 +389,7 @@ static int perf_session__check_output_opt(struct perf_session *session) | |||
389 | 389 | ||
390 | j = PERF_TYPE_TRACEPOINT; | 390 | j = PERF_TYPE_TRACEPOINT; |
391 | 391 | ||
392 | evlist__for_each(session->evlist, evsel) { | 392 | evlist__for_each_entry(session->evlist, evsel) { |
393 | if (evsel->attr.type != j) | 393 | if (evsel->attr.type != j) |
394 | continue; | 394 | continue; |
395 | 395 | ||
@@ -720,7 +720,7 @@ static int perf_evlist__max_name_len(struct perf_evlist *evlist) | |||
720 | struct perf_evsel *evsel; | 720 | struct perf_evsel *evsel; |
721 | int max = 0; | 721 | int max = 0; |
722 | 722 | ||
723 | evlist__for_each(evlist, evsel) { | 723 | evlist__for_each_entry(evlist, evsel) { |
724 | int len = strlen(perf_evsel__name(evsel)); | 724 | int len = strlen(perf_evsel__name(evsel)); |
725 | 725 | ||
726 | max = MAX(len, max); | 726 | max = MAX(len, max); |
@@ -945,7 +945,7 @@ static int process_attr(struct perf_tool *tool, union perf_event *event, | |||
945 | if (evsel->attr.type >= PERF_TYPE_MAX) | 945 | if (evsel->attr.type >= PERF_TYPE_MAX) |
946 | return 0; | 946 | return 0; |
947 | 947 | ||
948 | evlist__for_each(evlist, pos) { | 948 | evlist__for_each_entry(evlist, pos) { |
949 | if (pos->attr.type == evsel->attr.type && pos != evsel) | 949 | if (pos->attr.type == evsel->attr.type && pos != evsel) |
950 | return 0; | 950 | return 0; |
951 | } | 951 | } |
@@ -1671,7 +1671,7 @@ static int check_ev_match(char *dir_name, char *scriptname, | |||
1671 | snprintf(evname, len + 1, "%s", p); | 1671 | snprintf(evname, len + 1, "%s", p); |
1672 | 1672 | ||
1673 | match = 0; | 1673 | match = 0; |
1674 | evlist__for_each(session->evlist, pos) { | 1674 | evlist__for_each_entry(session->evlist, pos) { |
1675 | if (!strcmp(perf_evsel__name(pos), evname)) { | 1675 | if (!strcmp(perf_evsel__name(pos), evname)) { |
1676 | match = 1; | 1676 | match = 1; |
1677 | break; | 1677 | break; |
@@ -1873,7 +1873,7 @@ static int process_stat_round_event(struct perf_tool *tool __maybe_unused, | |||
1873 | struct stat_round_event *round = &event->stat_round; | 1873 | struct stat_round_event *round = &event->stat_round; |
1874 | struct perf_evsel *counter; | 1874 | struct perf_evsel *counter; |
1875 | 1875 | ||
1876 | evlist__for_each(session->evlist, counter) { | 1876 | evlist__for_each_entry(session->evlist, counter) { |
1877 | perf_stat_process_counter(&stat_config, counter); | 1877 | perf_stat_process_counter(&stat_config, counter); |
1878 | process_stat(counter, round->time); | 1878 | process_stat(counter, round->time); |
1879 | } | 1879 | } |
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index dff63733dfb7..c367a43525e6 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c | |||
@@ -331,7 +331,7 @@ static void read_counters(bool close_counters) | |||
331 | { | 331 | { |
332 | struct perf_evsel *counter; | 332 | struct perf_evsel *counter; |
333 | 333 | ||
334 | evlist__for_each(evsel_list, counter) { | 334 | evlist__for_each_entry(evsel_list, counter) { |
335 | if (read_counter(counter)) | 335 | if (read_counter(counter)) |
336 | pr_debug("failed to read counter %s\n", counter->name); | 336 | pr_debug("failed to read counter %s\n", counter->name); |
337 | 337 | ||
@@ -417,7 +417,7 @@ static int perf_stat_synthesize_config(bool is_pipe) | |||
417 | * Synthesize other events stuff not carried within | 417 | * Synthesize other events stuff not carried within |
418 | * attr event - unit, scale, name | 418 | * attr event - unit, scale, name |
419 | */ | 419 | */ |
420 | evlist__for_each(evsel_list, counter) { | 420 | evlist__for_each_entry(evsel_list, counter) { |
421 | if (!counter->supported) | 421 | if (!counter->supported) |
422 | continue; | 422 | continue; |
423 | 423 | ||
@@ -550,7 +550,7 @@ static int __run_perf_stat(int argc, const char **argv) | |||
550 | if (group) | 550 | if (group) |
551 | perf_evlist__set_leader(evsel_list); | 551 | perf_evlist__set_leader(evsel_list); |
552 | 552 | ||
553 | evlist__for_each(evsel_list, counter) { | 553 | evlist__for_each_entry(evsel_list, counter) { |
554 | try_again: | 554 | try_again: |
555 | if (create_perf_stat_counter(counter) < 0) { | 555 | if (create_perf_stat_counter(counter) < 0) { |
556 | /* | 556 | /* |
@@ -1134,7 +1134,7 @@ static void aggr_update_shadow(void) | |||
1134 | 1134 | ||
1135 | for (s = 0; s < aggr_map->nr; s++) { | 1135 | for (s = 0; s < aggr_map->nr; s++) { |
1136 | id = aggr_map->map[s]; | 1136 | id = aggr_map->map[s]; |
1137 | evlist__for_each(evsel_list, counter) { | 1137 | evlist__for_each_entry(evsel_list, counter) { |
1138 | val = 0; | 1138 | val = 0; |
1139 | for (cpu = 0; cpu < perf_evsel__nr_cpus(counter); cpu++) { | 1139 | for (cpu = 0; cpu < perf_evsel__nr_cpus(counter); cpu++) { |
1140 | s2 = aggr_get_id(evsel_list->cpus, cpu); | 1140 | s2 = aggr_get_id(evsel_list->cpus, cpu); |
@@ -1173,7 +1173,7 @@ static void print_aggr(char *prefix) | |||
1173 | 1173 | ||
1174 | id = aggr_map->map[s]; | 1174 | id = aggr_map->map[s]; |
1175 | first = true; | 1175 | first = true; |
1176 | evlist__for_each(evsel_list, counter) { | 1176 | evlist__for_each_entry(evsel_list, counter) { |
1177 | val = ena = run = 0; | 1177 | val = ena = run = 0; |
1178 | nr = 0; | 1178 | nr = 0; |
1179 | for (cpu = 0; cpu < perf_evsel__nr_cpus(counter); cpu++) { | 1179 | for (cpu = 0; cpu < perf_evsel__nr_cpus(counter); cpu++) { |
@@ -1292,7 +1292,7 @@ static void print_no_aggr_metric(char *prefix) | |||
1292 | 1292 | ||
1293 | if (prefix) | 1293 | if (prefix) |
1294 | fputs(prefix, stat_config.output); | 1294 | fputs(prefix, stat_config.output); |
1295 | evlist__for_each(evsel_list, counter) { | 1295 | evlist__for_each_entry(evsel_list, counter) { |
1296 | if (first) { | 1296 | if (first) { |
1297 | aggr_printout(counter, cpu, 0); | 1297 | aggr_printout(counter, cpu, 0); |
1298 | first = false; | 1298 | first = false; |
@@ -1346,7 +1346,7 @@ static void print_metric_headers(const char *prefix, bool no_indent) | |||
1346 | } | 1346 | } |
1347 | 1347 | ||
1348 | /* Print metrics headers only */ | 1348 | /* Print metrics headers only */ |
1349 | evlist__for_each(evsel_list, counter) { | 1349 | evlist__for_each_entry(evsel_list, counter) { |
1350 | os.evsel = counter; | 1350 | os.evsel = counter; |
1351 | out.ctx = &os; | 1351 | out.ctx = &os; |
1352 | out.print_metric = print_metric_header; | 1352 | out.print_metric = print_metric_header; |
@@ -1482,11 +1482,11 @@ static void print_counters(struct timespec *ts, int argc, const char **argv) | |||
1482 | print_aggr(prefix); | 1482 | print_aggr(prefix); |
1483 | break; | 1483 | break; |
1484 | case AGGR_THREAD: | 1484 | case AGGR_THREAD: |
1485 | evlist__for_each(evsel_list, counter) | 1485 | evlist__for_each_entry(evsel_list, counter) |
1486 | print_aggr_thread(counter, prefix); | 1486 | print_aggr_thread(counter, prefix); |
1487 | break; | 1487 | break; |
1488 | case AGGR_GLOBAL: | 1488 | case AGGR_GLOBAL: |
1489 | evlist__for_each(evsel_list, counter) | 1489 | evlist__for_each_entry(evsel_list, counter) |
1490 | print_counter_aggr(counter, prefix); | 1490 | print_counter_aggr(counter, prefix); |
1491 | if (metric_only) | 1491 | if (metric_only) |
1492 | fputc('\n', stat_config.output); | 1492 | fputc('\n', stat_config.output); |
@@ -1495,7 +1495,7 @@ static void print_counters(struct timespec *ts, int argc, const char **argv) | |||
1495 | if (metric_only) | 1495 | if (metric_only) |
1496 | print_no_aggr_metric(prefix); | 1496 | print_no_aggr_metric(prefix); |
1497 | else { | 1497 | else { |
1498 | evlist__for_each(evsel_list, counter) | 1498 | evlist__for_each_entry(evsel_list, counter) |
1499 | print_counter(counter, prefix); | 1499 | print_counter(counter, prefix); |
1500 | } | 1500 | } |
1501 | break; | 1501 | break; |
@@ -2149,7 +2149,7 @@ static int process_stat_round_event(struct perf_tool *tool __maybe_unused, | |||
2149 | const char **argv = session->header.env.cmdline_argv; | 2149 | const char **argv = session->header.env.cmdline_argv; |
2150 | int argc = session->header.env.nr_cmdline; | 2150 | int argc = session->header.env.nr_cmdline; |
2151 | 2151 | ||
2152 | evlist__for_each(evsel_list, counter) | 2152 | evlist__for_each_entry(evsel_list, counter) |
2153 | perf_stat_process_counter(&stat_config, counter); | 2153 | perf_stat_process_counter(&stat_config, counter); |
2154 | 2154 | ||
2155 | if (stat_round->type == PERF_STAT_ROUND_TYPE__FINAL) | 2155 | if (stat_round->type == PERF_STAT_ROUND_TYPE__FINAL) |
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index ec4cba61f3a2..07fc7921980c 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -479,7 +479,7 @@ static bool perf_top__handle_keypress(struct perf_top *top, int c) | |||
479 | 479 | ||
480 | fprintf(stderr, "\nAvailable events:"); | 480 | fprintf(stderr, "\nAvailable events:"); |
481 | 481 | ||
482 | evlist__for_each(top->evlist, top->sym_evsel) | 482 | evlist__for_each_entry(top->evlist, top->sym_evsel) |
483 | fprintf(stderr, "\n\t%d %s", top->sym_evsel->idx, perf_evsel__name(top->sym_evsel)); | 483 | fprintf(stderr, "\n\t%d %s", top->sym_evsel->idx, perf_evsel__name(top->sym_evsel)); |
484 | 484 | ||
485 | prompt_integer(&counter, "Enter details event counter"); | 485 | prompt_integer(&counter, "Enter details event counter"); |
@@ -490,7 +490,7 @@ static bool perf_top__handle_keypress(struct perf_top *top, int c) | |||
490 | sleep(1); | 490 | sleep(1); |
491 | break; | 491 | break; |
492 | } | 492 | } |
493 | evlist__for_each(top->evlist, top->sym_evsel) | 493 | evlist__for_each_entry(top->evlist, top->sym_evsel) |
494 | if (top->sym_evsel->idx == counter) | 494 | if (top->sym_evsel->idx == counter) |
495 | break; | 495 | break; |
496 | } else | 496 | } else |
@@ -583,7 +583,7 @@ static void *display_thread_tui(void *arg) | |||
583 | * Zooming in/out UIDs. For now juse use whatever the user passed | 583 | * Zooming in/out UIDs. For now juse use whatever the user passed |
584 | * via --uid. | 584 | * via --uid. |
585 | */ | 585 | */ |
586 | evlist__for_each(top->evlist, pos) { | 586 | evlist__for_each_entry(top->evlist, pos) { |
587 | struct hists *hists = evsel__hists(pos); | 587 | struct hists *hists = evsel__hists(pos); |
588 | hists->uid_filter_str = top->record_opts.target.uid_str; | 588 | hists->uid_filter_str = top->record_opts.target.uid_str; |
589 | } | 589 | } |
@@ -888,7 +888,7 @@ static int perf_top__start_counters(struct perf_top *top) | |||
888 | 888 | ||
889 | perf_evlist__config(evlist, opts, &callchain_param); | 889 | perf_evlist__config(evlist, opts, &callchain_param); |
890 | 890 | ||
891 | evlist__for_each(evlist, counter) { | 891 | evlist__for_each_entry(evlist, counter) { |
892 | try_again: | 892 | try_again: |
893 | if (perf_evsel__open(counter, top->evlist->cpus, | 893 | if (perf_evsel__open(counter, top->evlist->cpus, |
894 | top->evlist->threads) < 0) { | 894 | top->evlist->threads) < 0) { |
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 5c50fe70d6b3..1ecadfc61196 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c | |||
@@ -2483,7 +2483,7 @@ static int trace__replay(struct trace *trace) | |||
2483 | goto out; | 2483 | goto out; |
2484 | } | 2484 | } |
2485 | 2485 | ||
2486 | evlist__for_each(session->evlist, evsel) { | 2486 | evlist__for_each_entry(session->evlist, evsel) { |
2487 | if (evsel->attr.type == PERF_TYPE_SOFTWARE && | 2487 | if (evsel->attr.type == PERF_TYPE_SOFTWARE && |
2488 | (evsel->attr.config == PERF_COUNT_SW_PAGE_FAULTS_MAJ || | 2488 | (evsel->attr.config == PERF_COUNT_SW_PAGE_FAULTS_MAJ || |
2489 | evsel->attr.config == PERF_COUNT_SW_PAGE_FAULTS_MIN || | 2489 | evsel->attr.config == PERF_COUNT_SW_PAGE_FAULTS_MIN || |
@@ -2714,7 +2714,7 @@ static void evlist__set_evsel_handler(struct perf_evlist *evlist, void *handler) | |||
2714 | { | 2714 | { |
2715 | struct perf_evsel *evsel; | 2715 | struct perf_evsel *evsel; |
2716 | 2716 | ||
2717 | evlist__for_each(evlist, evsel) | 2717 | evlist__for_each_entry(evlist, evsel) |
2718 | evsel->handler = handler; | 2718 | evsel->handler = handler; |
2719 | } | 2719 | } |
2720 | 2720 | ||
diff --git a/tools/perf/tests/backward-ring-buffer.c b/tools/perf/tests/backward-ring-buffer.c index d9ba991a9a30..e70313fac5a5 100644 --- a/tools/perf/tests/backward-ring-buffer.c +++ b/tools/perf/tests/backward-ring-buffer.c | |||
@@ -118,7 +118,7 @@ int test__backward_ring_buffer(int subtest __maybe_unused) | |||
118 | perf_evlist__config(evlist, &opts, NULL); | 118 | perf_evlist__config(evlist, &opts, NULL); |
119 | 119 | ||
120 | /* Set backward bit, ring buffer should be writing from end */ | 120 | /* Set backward bit, ring buffer should be writing from end */ |
121 | evlist__for_each(evlist, evsel) | 121 | evlist__for_each_entry(evlist, evsel) |
122 | evsel->attr.write_backward = 1; | 122 | evsel->attr.write_backward = 1; |
123 | 123 | ||
124 | err = perf_evlist__open(evlist); | 124 | err = perf_evlist__open(evlist); |
diff --git a/tools/perf/tests/evsel-roundtrip-name.c b/tools/perf/tests/evsel-roundtrip-name.c index 2de4a4f2c3ed..60926a1f6fd7 100644 --- a/tools/perf/tests/evsel-roundtrip-name.c +++ b/tools/perf/tests/evsel-roundtrip-name.c | |||
@@ -80,7 +80,7 @@ static int __perf_evsel__name_array_test(const char *names[], int nr_names) | |||
80 | } | 80 | } |
81 | 81 | ||
82 | err = 0; | 82 | err = 0; |
83 | evlist__for_each(evlist, evsel) { | 83 | evlist__for_each_entry(evlist, evsel) { |
84 | if (strcmp(perf_evsel__name(evsel), names[evsel->idx])) { | 84 | if (strcmp(perf_evsel__name(evsel), names[evsel->idx])) { |
85 | --err; | 85 | --err; |
86 | pr_debug("%s != %s\n", perf_evsel__name(evsel), names[evsel->idx]); | 86 | pr_debug("%s != %s\n", perf_evsel__name(evsel), names[evsel->idx]); |
diff --git a/tools/perf/tests/hists_filter.c b/tools/perf/tests/hists_filter.c index e846f8c42013..62efb14f3a5a 100644 --- a/tools/perf/tests/hists_filter.c +++ b/tools/perf/tests/hists_filter.c | |||
@@ -56,7 +56,7 @@ static int add_hist_entries(struct perf_evlist *evlist, | |||
56 | * (perf [perf] main) will be collapsed to an existing entry | 56 | * (perf [perf] main) will be collapsed to an existing entry |
57 | * so total 9 entries will be in the tree. | 57 | * so total 9 entries will be in the tree. |
58 | */ | 58 | */ |
59 | evlist__for_each(evlist, evsel) { | 59 | evlist__for_each_entry(evlist, evsel) { |
60 | for (i = 0; i < ARRAY_SIZE(fake_samples); i++) { | 60 | for (i = 0; i < ARRAY_SIZE(fake_samples); i++) { |
61 | struct hist_entry_iter iter = { | 61 | struct hist_entry_iter iter = { |
62 | .evsel = evsel, | 62 | .evsel = evsel, |
@@ -136,7 +136,7 @@ int test__hists_filter(int subtest __maybe_unused) | |||
136 | if (err < 0) | 136 | if (err < 0) |
137 | goto out; | 137 | goto out; |
138 | 138 | ||
139 | evlist__for_each(evlist, evsel) { | 139 | evlist__for_each_entry(evlist, evsel) { |
140 | struct hists *hists = evsel__hists(evsel); | 140 | struct hists *hists = evsel__hists(evsel); |
141 | 141 | ||
142 | hists__collapse_resort(hists, NULL); | 142 | hists__collapse_resort(hists, NULL); |
diff --git a/tools/perf/tests/hists_link.c b/tools/perf/tests/hists_link.c index 6f96ca4d4fc0..eddc7407ff8a 100644 --- a/tools/perf/tests/hists_link.c +++ b/tools/perf/tests/hists_link.c | |||
@@ -72,7 +72,7 @@ static int add_hist_entries(struct perf_evlist *evlist, struct machine *machine) | |||
72 | * However the second evsel also has a collapsed entry for | 72 | * However the second evsel also has a collapsed entry for |
73 | * "bash [libc] malloc" so total 9 entries will be in the tree. | 73 | * "bash [libc] malloc" so total 9 entries will be in the tree. |
74 | */ | 74 | */ |
75 | evlist__for_each(evlist, evsel) { | 75 | evlist__for_each_entry(evlist, evsel) { |
76 | struct hists *hists = evsel__hists(evsel); | 76 | struct hists *hists = evsel__hists(evsel); |
77 | 77 | ||
78 | for (k = 0; k < ARRAY_SIZE(fake_common_samples); k++) { | 78 | for (k = 0; k < ARRAY_SIZE(fake_common_samples); k++) { |
@@ -301,7 +301,7 @@ int test__hists_link(int subtest __maybe_unused) | |||
301 | if (err < 0) | 301 | if (err < 0) |
302 | goto out; | 302 | goto out; |
303 | 303 | ||
304 | evlist__for_each(evlist, evsel) { | 304 | evlist__for_each_entry(evlist, evsel) { |
305 | hists = evsel__hists(evsel); | 305 | hists = evsel__hists(evsel); |
306 | hists__collapse_resort(hists, NULL); | 306 | hists__collapse_resort(hists, NULL); |
307 | 307 | ||
diff --git a/tools/perf/tests/mmap-basic.c b/tools/perf/tests/mmap-basic.c index 359e98fcd94c..aea33f5589c5 100644 --- a/tools/perf/tests/mmap-basic.c +++ b/tools/perf/tests/mmap-basic.c | |||
@@ -126,7 +126,7 @@ int test__basic_mmap(int subtest __maybe_unused) | |||
126 | } | 126 | } |
127 | 127 | ||
128 | err = 0; | 128 | err = 0; |
129 | evlist__for_each(evlist, evsel) { | 129 | evlist__for_each_entry(evlist, evsel) { |
130 | if (nr_events[evsel->idx] != expected_nr_events[evsel->idx]) { | 130 | if (nr_events[evsel->idx] != expected_nr_events[evsel->idx]) { |
131 | pr_debug("expected %d %s events, got %d\n", | 131 | pr_debug("expected %d %s events, got %d\n", |
132 | expected_nr_events[evsel->idx], | 132 | expected_nr_events[evsel->idx], |
diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c index b2a2c74136a5..20c2e641c422 100644 --- a/tools/perf/tests/parse-events.c +++ b/tools/perf/tests/parse-events.c | |||
@@ -32,7 +32,7 @@ static int test__checkevent_tracepoint_multi(struct perf_evlist *evlist) | |||
32 | TEST_ASSERT_VAL("wrong number of entries", evlist->nr_entries > 1); | 32 | TEST_ASSERT_VAL("wrong number of entries", evlist->nr_entries > 1); |
33 | TEST_ASSERT_VAL("wrong number of groups", 0 == evlist->nr_groups); | 33 | TEST_ASSERT_VAL("wrong number of groups", 0 == evlist->nr_groups); |
34 | 34 | ||
35 | evlist__for_each(evlist, evsel) { | 35 | evlist__for_each_entry(evlist, evsel) { |
36 | TEST_ASSERT_VAL("wrong type", | 36 | TEST_ASSERT_VAL("wrong type", |
37 | PERF_TYPE_TRACEPOINT == evsel->attr.type); | 37 | PERF_TYPE_TRACEPOINT == evsel->attr.type); |
38 | TEST_ASSERT_VAL("wrong sample_type", | 38 | TEST_ASSERT_VAL("wrong sample_type", |
@@ -207,7 +207,7 @@ test__checkevent_tracepoint_multi_modifier(struct perf_evlist *evlist) | |||
207 | 207 | ||
208 | TEST_ASSERT_VAL("wrong number of entries", evlist->nr_entries > 1); | 208 | TEST_ASSERT_VAL("wrong number of entries", evlist->nr_entries > 1); |
209 | 209 | ||
210 | evlist__for_each(evlist, evsel) { | 210 | evlist__for_each_entry(evlist, evsel) { |
211 | TEST_ASSERT_VAL("wrong exclude_user", | 211 | TEST_ASSERT_VAL("wrong exclude_user", |
212 | !evsel->attr.exclude_user); | 212 | !evsel->attr.exclude_user); |
213 | TEST_ASSERT_VAL("wrong exclude_kernel", | 213 | TEST_ASSERT_VAL("wrong exclude_kernel", |
diff --git a/tools/perf/tests/switch-tracking.c b/tools/perf/tests/switch-tracking.c index 39a689bf7574..7ddbe267d0ac 100644 --- a/tools/perf/tests/switch-tracking.c +++ b/tools/perf/tests/switch-tracking.c | |||
@@ -432,7 +432,7 @@ int test__switch_tracking(int subtest __maybe_unused) | |||
432 | } | 432 | } |
433 | 433 | ||
434 | /* Check non-tracking events are not tracking */ | 434 | /* Check non-tracking events are not tracking */ |
435 | evlist__for_each(evlist, evsel) { | 435 | evlist__for_each_entry(evlist, evsel) { |
436 | if (evsel != tracking_evsel) { | 436 | if (evsel != tracking_evsel) { |
437 | if (evsel->attr.mmap || evsel->attr.comm) { | 437 | if (evsel->attr.mmap || evsel->attr.comm) { |
438 | pr_debug("Non-tracking event is tracking\n"); | 438 | pr_debug("Non-tracking event is tracking\n"); |
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 9d744358ca78..e08b8f7b6d3f 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c | |||
@@ -3199,7 +3199,7 @@ static int __perf_evlist__tui_browse_hists(struct perf_evlist *evlist, | |||
3199 | 3199 | ||
3200 | ui_helpline__push("Press ESC to exit"); | 3200 | ui_helpline__push("Press ESC to exit"); |
3201 | 3201 | ||
3202 | evlist__for_each(evlist, pos) { | 3202 | evlist__for_each_entry(evlist, pos) { |
3203 | const char *ev_name = perf_evsel__name(pos); | 3203 | const char *ev_name = perf_evsel__name(pos); |
3204 | size_t line_len = strlen(ev_name) + 7; | 3204 | size_t line_len = strlen(ev_name) + 7; |
3205 | 3205 | ||
@@ -3230,7 +3230,7 @@ single_entry: | |||
3230 | struct perf_evsel *pos; | 3230 | struct perf_evsel *pos; |
3231 | 3231 | ||
3232 | nr_entries = 0; | 3232 | nr_entries = 0; |
3233 | evlist__for_each(evlist, pos) { | 3233 | evlist__for_each_entry(evlist, pos) { |
3234 | if (perf_evsel__is_group_leader(pos)) | 3234 | if (perf_evsel__is_group_leader(pos)) |
3235 | nr_entries++; | 3235 | nr_entries++; |
3236 | } | 3236 | } |
diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c index e5c1325b0340..c5f3677f6679 100644 --- a/tools/perf/ui/gtk/hists.c +++ b/tools/perf/ui/gtk/hists.c | |||
@@ -627,7 +627,7 @@ int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist, | |||
627 | 627 | ||
628 | gtk_container_add(GTK_CONTAINER(window), vbox); | 628 | gtk_container_add(GTK_CONTAINER(window), vbox); |
629 | 629 | ||
630 | evlist__for_each(evlist, pos) { | 630 | evlist__for_each_entry(evlist, pos) { |
631 | struct hists *hists = evsel__hists(pos); | 631 | struct hists *hists = evsel__hists(pos); |
632 | const char *evname = perf_evsel__name(pos); | 632 | const char *evname = perf_evsel__name(pos); |
633 | GtkWidget *scrolled_window; | 633 | GtkWidget *scrolled_window; |
diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c index 6940745aa77c..4274969ddc89 100644 --- a/tools/perf/ui/hist.c +++ b/tools/perf/ui/hist.c | |||
@@ -766,7 +766,7 @@ int perf_hpp__setup_hists_formats(struct perf_hpp_list *list, | |||
766 | if (!symbol_conf.report_hierarchy) | 766 | if (!symbol_conf.report_hierarchy) |
767 | return 0; | 767 | return 0; |
768 | 768 | ||
769 | evlist__for_each(evlist, evsel) { | 769 | evlist__for_each_entry(evlist, evsel) { |
770 | hists = evsel__hists(evsel); | 770 | hists = evsel__hists(evsel); |
771 | 771 | ||
772 | perf_hpp_list__for_each_sort_list(list, fmt) { | 772 | perf_hpp_list__for_each_sort_list(list, fmt) { |
diff --git a/tools/perf/util/cgroup.c b/tools/perf/util/cgroup.c index 90aa1b46b2e5..8fdee24725a7 100644 --- a/tools/perf/util/cgroup.c +++ b/tools/perf/util/cgroup.c | |||
@@ -81,7 +81,7 @@ static int add_cgroup(struct perf_evlist *evlist, char *str) | |||
81 | /* | 81 | /* |
82 | * check if cgrp is already defined, if so we reuse it | 82 | * check if cgrp is already defined, if so we reuse it |
83 | */ | 83 | */ |
84 | evlist__for_each(evlist, counter) { | 84 | evlist__for_each_entry(evlist, counter) { |
85 | cgrp = counter->cgrp; | 85 | cgrp = counter->cgrp; |
86 | if (!cgrp) | 86 | if (!cgrp) |
87 | continue; | 87 | continue; |
@@ -110,7 +110,7 @@ static int add_cgroup(struct perf_evlist *evlist, char *str) | |||
110 | * if add cgroup N, then need to find event N | 110 | * if add cgroup N, then need to find event N |
111 | */ | 111 | */ |
112 | n = 0; | 112 | n = 0; |
113 | evlist__for_each(evlist, counter) { | 113 | evlist__for_each_entry(evlist, counter) { |
114 | if (n == nr_cgroups) | 114 | if (n == nr_cgroups) |
115 | goto found; | 115 | goto found; |
116 | n++; | 116 | n++; |
diff --git a/tools/perf/util/data-convert-bt.c b/tools/perf/util/data-convert-bt.c index 9f53020c3269..4b59879391c0 100644 --- a/tools/perf/util/data-convert-bt.c +++ b/tools/perf/util/data-convert-bt.c | |||
@@ -997,7 +997,7 @@ static int setup_events(struct ctf_writer *cw, struct perf_session *session) | |||
997 | struct perf_evsel *evsel; | 997 | struct perf_evsel *evsel; |
998 | int ret; | 998 | int ret; |
999 | 999 | ||
1000 | evlist__for_each(evlist, evsel) { | 1000 | evlist__for_each_entry(evlist, evsel) { |
1001 | ret = add_event(cw, evsel); | 1001 | ret = add_event(cw, evsel); |
1002 | if (ret) | 1002 | if (ret) |
1003 | return ret; | 1003 | return ret; |
@@ -1010,7 +1010,7 @@ static void cleanup_events(struct perf_session *session) | |||
1010 | struct perf_evlist *evlist = session->evlist; | 1010 | struct perf_evlist *evlist = session->evlist; |
1011 | struct perf_evsel *evsel; | 1011 | struct perf_evsel *evsel; |
1012 | 1012 | ||
1013 | evlist__for_each(evlist, evsel) { | 1013 | evlist__for_each_entry(evlist, evsel) { |
1014 | struct evsel_priv *priv; | 1014 | struct evsel_priv *priv; |
1015 | 1015 | ||
1016 | priv = evsel->priv; | 1016 | priv = evsel->priv; |
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index fcb8f1ff7806..113507716044 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c | |||
@@ -100,7 +100,7 @@ static void perf_evlist__update_id_pos(struct perf_evlist *evlist) | |||
100 | { | 100 | { |
101 | struct perf_evsel *evsel; | 101 | struct perf_evsel *evsel; |
102 | 102 | ||
103 | evlist__for_each(evlist, evsel) | 103 | evlist__for_each_entry(evlist, evsel) |
104 | perf_evsel__calc_id_pos(evsel); | 104 | perf_evsel__calc_id_pos(evsel); |
105 | 105 | ||
106 | perf_evlist__set_id_pos(evlist); | 106 | perf_evlist__set_id_pos(evlist); |
@@ -110,7 +110,7 @@ static void perf_evlist__purge(struct perf_evlist *evlist) | |||
110 | { | 110 | { |
111 | struct perf_evsel *pos, *n; | 111 | struct perf_evsel *pos, *n; |
112 | 112 | ||
113 | evlist__for_each_safe(evlist, n, pos) { | 113 | evlist__for_each_entry_safe(evlist, n, pos) { |
114 | list_del_init(&pos->node); | 114 | list_del_init(&pos->node); |
115 | pos->evlist = NULL; | 115 | pos->evlist = NULL; |
116 | perf_evsel__delete(pos); | 116 | perf_evsel__delete(pos); |
@@ -164,7 +164,7 @@ static void perf_evlist__propagate_maps(struct perf_evlist *evlist) | |||
164 | { | 164 | { |
165 | struct perf_evsel *evsel; | 165 | struct perf_evsel *evsel; |
166 | 166 | ||
167 | evlist__for_each(evlist, evsel) | 167 | evlist__for_each_entry(evlist, evsel) |
168 | __perf_evlist__propagate_maps(evlist, evsel); | 168 | __perf_evlist__propagate_maps(evlist, evsel); |
169 | } | 169 | } |
170 | 170 | ||
@@ -193,7 +193,7 @@ void perf_evlist__splice_list_tail(struct perf_evlist *evlist, | |||
193 | { | 193 | { |
194 | struct perf_evsel *evsel, *temp; | 194 | struct perf_evsel *evsel, *temp; |
195 | 195 | ||
196 | __evlist__for_each_safe(list, temp, evsel) { | 196 | __evlist__for_each_entry_safe(list, temp, evsel) { |
197 | list_del_init(&evsel->node); | 197 | list_del_init(&evsel->node); |
198 | perf_evlist__add(evlist, evsel); | 198 | perf_evlist__add(evlist, evsel); |
199 | } | 199 | } |
@@ -208,7 +208,7 @@ void __perf_evlist__set_leader(struct list_head *list) | |||
208 | 208 | ||
209 | leader->nr_members = evsel->idx - leader->idx + 1; | 209 | leader->nr_members = evsel->idx - leader->idx + 1; |
210 | 210 | ||
211 | __evlist__for_each(list, evsel) { | 211 | __evlist__for_each_entry(list, evsel) { |
212 | evsel->leader = leader; | 212 | evsel->leader = leader; |
213 | } | 213 | } |
214 | } | 214 | } |
@@ -299,7 +299,7 @@ static int perf_evlist__add_attrs(struct perf_evlist *evlist, | |||
299 | return 0; | 299 | return 0; |
300 | 300 | ||
301 | out_delete_partial_list: | 301 | out_delete_partial_list: |
302 | __evlist__for_each_safe(&head, n, evsel) | 302 | __evlist__for_each_entry_safe(&head, n, evsel) |
303 | perf_evsel__delete(evsel); | 303 | perf_evsel__delete(evsel); |
304 | return -1; | 304 | return -1; |
305 | } | 305 | } |
@@ -320,7 +320,7 @@ perf_evlist__find_tracepoint_by_id(struct perf_evlist *evlist, int id) | |||
320 | { | 320 | { |
321 | struct perf_evsel *evsel; | 321 | struct perf_evsel *evsel; |
322 | 322 | ||
323 | evlist__for_each(evlist, evsel) { | 323 | evlist__for_each_entry(evlist, evsel) { |
324 | if (evsel->attr.type == PERF_TYPE_TRACEPOINT && | 324 | if (evsel->attr.type == PERF_TYPE_TRACEPOINT && |
325 | (int)evsel->attr.config == id) | 325 | (int)evsel->attr.config == id) |
326 | return evsel; | 326 | return evsel; |
@@ -335,7 +335,7 @@ perf_evlist__find_tracepoint_by_name(struct perf_evlist *evlist, | |||
335 | { | 335 | { |
336 | struct perf_evsel *evsel; | 336 | struct perf_evsel *evsel; |
337 | 337 | ||
338 | evlist__for_each(evlist, evsel) { | 338 | evlist__for_each_entry(evlist, evsel) { |
339 | if ((evsel->attr.type == PERF_TYPE_TRACEPOINT) && | 339 | if ((evsel->attr.type == PERF_TYPE_TRACEPOINT) && |
340 | (strcmp(evsel->name, name) == 0)) | 340 | (strcmp(evsel->name, name) == 0)) |
341 | return evsel; | 341 | return evsel; |
@@ -370,7 +370,7 @@ void perf_evlist__disable(struct perf_evlist *evlist) | |||
370 | { | 370 | { |
371 | struct perf_evsel *pos; | 371 | struct perf_evsel *pos; |
372 | 372 | ||
373 | evlist__for_each(evlist, pos) { | 373 | evlist__for_each_entry(evlist, pos) { |
374 | if (!perf_evsel__is_group_leader(pos) || !pos->fd) | 374 | if (!perf_evsel__is_group_leader(pos) || !pos->fd) |
375 | continue; | 375 | continue; |
376 | perf_evsel__disable(pos); | 376 | perf_evsel__disable(pos); |
@@ -383,7 +383,7 @@ void perf_evlist__enable(struct perf_evlist *evlist) | |||
383 | { | 383 | { |
384 | struct perf_evsel *pos; | 384 | struct perf_evsel *pos; |
385 | 385 | ||
386 | evlist__for_each(evlist, pos) { | 386 | evlist__for_each_entry(evlist, pos) { |
387 | if (!perf_evsel__is_group_leader(pos) || !pos->fd) | 387 | if (!perf_evsel__is_group_leader(pos) || !pos->fd) |
388 | continue; | 388 | continue; |
389 | perf_evsel__enable(pos); | 389 | perf_evsel__enable(pos); |
@@ -451,7 +451,7 @@ int perf_evlist__alloc_pollfd(struct perf_evlist *evlist) | |||
451 | int nfds = 0; | 451 | int nfds = 0; |
452 | struct perf_evsel *evsel; | 452 | struct perf_evsel *evsel; |
453 | 453 | ||
454 | evlist__for_each(evlist, evsel) { | 454 | evlist__for_each_entry(evlist, evsel) { |
455 | if (evsel->system_wide) | 455 | if (evsel->system_wide) |
456 | nfds += nr_cpus; | 456 | nfds += nr_cpus; |
457 | else | 457 | else |
@@ -1015,7 +1015,7 @@ static int perf_evlist__mmap_per_evsel(struct perf_evlist *evlist, int idx, | |||
1015 | struct perf_evsel *evsel; | 1015 | struct perf_evsel *evsel; |
1016 | int revent; | 1016 | int revent; |
1017 | 1017 | ||
1018 | evlist__for_each(evlist, evsel) { | 1018 | evlist__for_each_entry(evlist, evsel) { |
1019 | int fd; | 1019 | int fd; |
1020 | 1020 | ||
1021 | if (evsel->overwrite != (evlist->overwrite && evlist->backward)) | 1021 | if (evsel->overwrite != (evlist->overwrite && evlist->backward)) |
@@ -1262,7 +1262,7 @@ int perf_evlist__mmap_ex(struct perf_evlist *evlist, unsigned int pages, | |||
1262 | auxtrace_mmap_params__init(&mp.auxtrace_mp, evlist->mmap_len, | 1262 | auxtrace_mmap_params__init(&mp.auxtrace_mp, evlist->mmap_len, |
1263 | auxtrace_pages, auxtrace_overwrite); | 1263 | auxtrace_pages, auxtrace_overwrite); |
1264 | 1264 | ||
1265 | evlist__for_each(evlist, evsel) { | 1265 | evlist__for_each_entry(evlist, evsel) { |
1266 | if ((evsel->attr.read_format & PERF_FORMAT_ID) && | 1266 | if ((evsel->attr.read_format & PERF_FORMAT_ID) && |
1267 | evsel->sample_id == NULL && | 1267 | evsel->sample_id == NULL && |
1268 | perf_evsel__alloc_id(evsel, cpu_map__nr(cpus), threads->nr) < 0) | 1268 | perf_evsel__alloc_id(evsel, cpu_map__nr(cpus), threads->nr) < 0) |
@@ -1338,7 +1338,7 @@ void __perf_evlist__set_sample_bit(struct perf_evlist *evlist, | |||
1338 | { | 1338 | { |
1339 | struct perf_evsel *evsel; | 1339 | struct perf_evsel *evsel; |
1340 | 1340 | ||
1341 | evlist__for_each(evlist, evsel) | 1341 | evlist__for_each_entry(evlist, evsel) |
1342 | __perf_evsel__set_sample_bit(evsel, bit); | 1342 | __perf_evsel__set_sample_bit(evsel, bit); |
1343 | } | 1343 | } |
1344 | 1344 | ||
@@ -1347,7 +1347,7 @@ void __perf_evlist__reset_sample_bit(struct perf_evlist *evlist, | |||
1347 | { | 1347 | { |
1348 | struct perf_evsel *evsel; | 1348 | struct perf_evsel *evsel; |
1349 | 1349 | ||
1350 | evlist__for_each(evlist, evsel) | 1350 | evlist__for_each_entry(evlist, evsel) |
1351 | __perf_evsel__reset_sample_bit(evsel, bit); | 1351 | __perf_evsel__reset_sample_bit(evsel, bit); |
1352 | } | 1352 | } |
1353 | 1353 | ||
@@ -1358,7 +1358,7 @@ int perf_evlist__apply_filters(struct perf_evlist *evlist, struct perf_evsel **e | |||
1358 | const int ncpus = cpu_map__nr(evlist->cpus), | 1358 | const int ncpus = cpu_map__nr(evlist->cpus), |
1359 | nthreads = thread_map__nr(evlist->threads); | 1359 | nthreads = thread_map__nr(evlist->threads); |
1360 | 1360 | ||
1361 | evlist__for_each(evlist, evsel) { | 1361 | evlist__for_each_entry(evlist, evsel) { |
1362 | if (evsel->filter == NULL) | 1362 | if (evsel->filter == NULL) |
1363 | continue; | 1363 | continue; |
1364 | 1364 | ||
@@ -1381,7 +1381,7 @@ int perf_evlist__set_filter(struct perf_evlist *evlist, const char *filter) | |||
1381 | struct perf_evsel *evsel; | 1381 | struct perf_evsel *evsel; |
1382 | int err = 0; | 1382 | int err = 0; |
1383 | 1383 | ||
1384 | evlist__for_each(evlist, evsel) { | 1384 | evlist__for_each_entry(evlist, evsel) { |
1385 | if (evsel->attr.type != PERF_TYPE_TRACEPOINT) | 1385 | if (evsel->attr.type != PERF_TYPE_TRACEPOINT) |
1386 | continue; | 1386 | continue; |
1387 | 1387 | ||
@@ -1435,7 +1435,7 @@ bool perf_evlist__valid_sample_type(struct perf_evlist *evlist) | |||
1435 | if (evlist->id_pos < 0 || evlist->is_pos < 0) | 1435 | if (evlist->id_pos < 0 || evlist->is_pos < 0) |
1436 | return false; | 1436 | return false; |
1437 | 1437 | ||
1438 | evlist__for_each(evlist, pos) { | 1438 | evlist__for_each_entry(evlist, pos) { |
1439 | if (pos->id_pos != evlist->id_pos || | 1439 | if (pos->id_pos != evlist->id_pos || |
1440 | pos->is_pos != evlist->is_pos) | 1440 | pos->is_pos != evlist->is_pos) |
1441 | return false; | 1441 | return false; |
@@ -1451,7 +1451,7 @@ u64 __perf_evlist__combined_sample_type(struct perf_evlist *evlist) | |||
1451 | if (evlist->combined_sample_type) | 1451 | if (evlist->combined_sample_type) |
1452 | return evlist->combined_sample_type; | 1452 | return evlist->combined_sample_type; |
1453 | 1453 | ||
1454 | evlist__for_each(evlist, evsel) | 1454 | evlist__for_each_entry(evlist, evsel) |
1455 | evlist->combined_sample_type |= evsel->attr.sample_type; | 1455 | evlist->combined_sample_type |= evsel->attr.sample_type; |
1456 | 1456 | ||
1457 | return evlist->combined_sample_type; | 1457 | return evlist->combined_sample_type; |
@@ -1468,7 +1468,7 @@ u64 perf_evlist__combined_branch_type(struct perf_evlist *evlist) | |||
1468 | struct perf_evsel *evsel; | 1468 | struct perf_evsel *evsel; |
1469 | u64 branch_type = 0; | 1469 | u64 branch_type = 0; |
1470 | 1470 | ||
1471 | evlist__for_each(evlist, evsel) | 1471 | evlist__for_each_entry(evlist, evsel) |
1472 | branch_type |= evsel->attr.branch_sample_type; | 1472 | branch_type |= evsel->attr.branch_sample_type; |
1473 | return branch_type; | 1473 | return branch_type; |
1474 | } | 1474 | } |
@@ -1479,7 +1479,7 @@ bool perf_evlist__valid_read_format(struct perf_evlist *evlist) | |||
1479 | u64 read_format = first->attr.read_format; | 1479 | u64 read_format = first->attr.read_format; |
1480 | u64 sample_type = first->attr.sample_type; | 1480 | u64 sample_type = first->attr.sample_type; |
1481 | 1481 | ||
1482 | evlist__for_each(evlist, pos) { | 1482 | evlist__for_each_entry(evlist, pos) { |
1483 | if (read_format != pos->attr.read_format) | 1483 | if (read_format != pos->attr.read_format) |
1484 | return false; | 1484 | return false; |
1485 | } | 1485 | } |
@@ -1536,7 +1536,7 @@ bool perf_evlist__valid_sample_id_all(struct perf_evlist *evlist) | |||
1536 | { | 1536 | { |
1537 | struct perf_evsel *first = perf_evlist__first(evlist), *pos = first; | 1537 | struct perf_evsel *first = perf_evlist__first(evlist), *pos = first; |
1538 | 1538 | ||
1539 | evlist__for_each_continue(evlist, pos) { | 1539 | evlist__for_each_entry_continue(evlist, pos) { |
1540 | if (first->attr.sample_id_all != pos->attr.sample_id_all) | 1540 | if (first->attr.sample_id_all != pos->attr.sample_id_all) |
1541 | return false; | 1541 | return false; |
1542 | } | 1542 | } |
@@ -1563,7 +1563,7 @@ void perf_evlist__close(struct perf_evlist *evlist) | |||
1563 | int nthreads = thread_map__nr(evlist->threads); | 1563 | int nthreads = thread_map__nr(evlist->threads); |
1564 | int n; | 1564 | int n; |
1565 | 1565 | ||
1566 | evlist__for_each_reverse(evlist, evsel) { | 1566 | evlist__for_each_entry_reverse(evlist, evsel) { |
1567 | n = evsel->cpus ? evsel->cpus->nr : ncpus; | 1567 | n = evsel->cpus ? evsel->cpus->nr : ncpus; |
1568 | perf_evsel__close(evsel, n, nthreads); | 1568 | perf_evsel__close(evsel, n, nthreads); |
1569 | } | 1569 | } |
@@ -1617,7 +1617,7 @@ int perf_evlist__open(struct perf_evlist *evlist) | |||
1617 | 1617 | ||
1618 | perf_evlist__update_id_pos(evlist); | 1618 | perf_evlist__update_id_pos(evlist); |
1619 | 1619 | ||
1620 | evlist__for_each(evlist, evsel) { | 1620 | evlist__for_each_entry(evlist, evsel) { |
1621 | err = perf_evsel__open(evsel, evsel->cpus, evsel->threads); | 1621 | err = perf_evsel__open(evsel, evsel->cpus, evsel->threads); |
1622 | if (err < 0) | 1622 | if (err < 0) |
1623 | goto out_err; | 1623 | goto out_err; |
@@ -1778,7 +1778,7 @@ size_t perf_evlist__fprintf(struct perf_evlist *evlist, FILE *fp) | |||
1778 | struct perf_evsel *evsel; | 1778 | struct perf_evsel *evsel; |
1779 | size_t printed = 0; | 1779 | size_t printed = 0; |
1780 | 1780 | ||
1781 | evlist__for_each(evlist, evsel) { | 1781 | evlist__for_each_entry(evlist, evsel) { |
1782 | printed += fprintf(fp, "%s%s", evsel->idx ? ", " : "", | 1782 | printed += fprintf(fp, "%s%s", evsel->idx ? ", " : "", |
1783 | perf_evsel__name(evsel)); | 1783 | perf_evsel__name(evsel)); |
1784 | } | 1784 | } |
@@ -1880,7 +1880,7 @@ void perf_evlist__to_front(struct perf_evlist *evlist, | |||
1880 | if (move_evsel == perf_evlist__first(evlist)) | 1880 | if (move_evsel == perf_evlist__first(evlist)) |
1881 | return; | 1881 | return; |
1882 | 1882 | ||
1883 | evlist__for_each_safe(evlist, n, evsel) { | 1883 | evlist__for_each_entry_safe(evlist, n, evsel) { |
1884 | if (evsel->leader == move_evsel->leader) | 1884 | if (evsel->leader == move_evsel->leader) |
1885 | list_move_tail(&evsel->node, &move); | 1885 | list_move_tail(&evsel->node, &move); |
1886 | } | 1886 | } |
@@ -1896,7 +1896,7 @@ void perf_evlist__set_tracking_event(struct perf_evlist *evlist, | |||
1896 | if (tracking_evsel->tracking) | 1896 | if (tracking_evsel->tracking) |
1897 | return; | 1897 | return; |
1898 | 1898 | ||
1899 | evlist__for_each(evlist, evsel) { | 1899 | evlist__for_each_entry(evlist, evsel) { |
1900 | if (evsel != tracking_evsel) | 1900 | if (evsel != tracking_evsel) |
1901 | evsel->tracking = false; | 1901 | evsel->tracking = false; |
1902 | } | 1902 | } |
@@ -1910,7 +1910,7 @@ perf_evlist__find_evsel_by_str(struct perf_evlist *evlist, | |||
1910 | { | 1910 | { |
1911 | struct perf_evsel *evsel; | 1911 | struct perf_evsel *evsel; |
1912 | 1912 | ||
1913 | evlist__for_each(evlist, evsel) { | 1913 | evlist__for_each_entry(evlist, evsel) { |
1914 | if (!evsel->name) | 1914 | if (!evsel->name) |
1915 | continue; | 1915 | continue; |
1916 | if (strcmp(str, evsel->name) == 0) | 1916 | if (strcmp(str, evsel->name) == 0) |
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h index 68cb1361c97c..872912b392c9 100644 --- a/tools/perf/util/evlist.h +++ b/tools/perf/util/evlist.h | |||
@@ -251,70 +251,70 @@ void perf_evlist__to_front(struct perf_evlist *evlist, | |||
251 | struct perf_evsel *move_evsel); | 251 | struct perf_evsel *move_evsel); |
252 | 252 | ||
253 | /** | 253 | /** |
254 | * __evlist__for_each - iterate thru all the evsels | 254 | * __evlist__for_each_entry - iterate thru all the evsels |
255 | * @list: list_head instance to iterate | 255 | * @list: list_head instance to iterate |
256 | * @evsel: struct evsel iterator | 256 | * @evsel: struct evsel iterator |
257 | */ | 257 | */ |
258 | #define __evlist__for_each(list, evsel) \ | 258 | #define __evlist__for_each_entry(list, evsel) \ |
259 | list_for_each_entry(evsel, list, node) | 259 | list_for_each_entry(evsel, list, node) |
260 | 260 | ||
261 | /** | 261 | /** |
262 | * evlist__for_each - iterate thru all the evsels | 262 | * evlist__for_each_entry - iterate thru all the evsels |
263 | * @evlist: evlist instance to iterate | 263 | * @evlist: evlist instance to iterate |
264 | * @evsel: struct evsel iterator | 264 | * @evsel: struct evsel iterator |
265 | */ | 265 | */ |
266 | #define evlist__for_each(evlist, evsel) \ | 266 | #define evlist__for_each_entry(evlist, evsel) \ |
267 | __evlist__for_each(&(evlist)->entries, evsel) | 267 | __evlist__for_each_entry(&(evlist)->entries, evsel) |
268 | 268 | ||
269 | /** | 269 | /** |
270 | * __evlist__for_each_continue - continue iteration thru all the evsels | 270 | * __evlist__for_each_entry_continue - continue iteration thru all the evsels |
271 | * @list: list_head instance to iterate | 271 | * @list: list_head instance to iterate |
272 | * @evsel: struct evsel iterator | 272 | * @evsel: struct evsel iterator |
273 | */ | 273 | */ |
274 | #define __evlist__for_each_continue(list, evsel) \ | 274 | #define __evlist__for_each_entry_continue(list, evsel) \ |
275 | list_for_each_entry_continue(evsel, list, node) | 275 | list_for_each_entry_continue(evsel, list, node) |
276 | 276 | ||
277 | /** | 277 | /** |
278 | * evlist__for_each_continue - continue iteration thru all the evsels | 278 | * evlist__for_each_entry_continue - continue iteration thru all the evsels |
279 | * @evlist: evlist instance to iterate | 279 | * @evlist: evlist instance to iterate |
280 | * @evsel: struct evsel iterator | 280 | * @evsel: struct evsel iterator |
281 | */ | 281 | */ |
282 | #define evlist__for_each_continue(evlist, evsel) \ | 282 | #define evlist__for_each_entry_continue(evlist, evsel) \ |
283 | __evlist__for_each_continue(&(evlist)->entries, evsel) | 283 | __evlist__for_each_entry_continue(&(evlist)->entries, evsel) |
284 | 284 | ||
285 | /** | 285 | /** |
286 | * __evlist__for_each_reverse - iterate thru all the evsels in reverse order | 286 | * __evlist__for_each_entry_reverse - iterate thru all the evsels in reverse order |
287 | * @list: list_head instance to iterate | 287 | * @list: list_head instance to iterate |
288 | * @evsel: struct evsel iterator | 288 | * @evsel: struct evsel iterator |
289 | */ | 289 | */ |
290 | #define __evlist__for_each_reverse(list, evsel) \ | 290 | #define __evlist__for_each_entry_reverse(list, evsel) \ |
291 | list_for_each_entry_reverse(evsel, list, node) | 291 | list_for_each_entry_reverse(evsel, list, node) |
292 | 292 | ||
293 | /** | 293 | /** |
294 | * evlist__for_each_reverse - iterate thru all the evsels in reverse order | 294 | * evlist__for_each_entry_reverse - iterate thru all the evsels in reverse order |
295 | * @evlist: evlist instance to iterate | 295 | * @evlist: evlist instance to iterate |
296 | * @evsel: struct evsel iterator | 296 | * @evsel: struct evsel iterator |
297 | */ | 297 | */ |
298 | #define evlist__for_each_reverse(evlist, evsel) \ | 298 | #define evlist__for_each_entry_reverse(evlist, evsel) \ |
299 | __evlist__for_each_reverse(&(evlist)->entries, evsel) | 299 | __evlist__for_each_entry_reverse(&(evlist)->entries, evsel) |
300 | 300 | ||
301 | /** | 301 | /** |
302 | * __evlist__for_each_safe - safely iterate thru all the evsels | 302 | * __evlist__for_each_entry_safe - safely iterate thru all the evsels |
303 | * @list: list_head instance to iterate | 303 | * @list: list_head instance to iterate |
304 | * @tmp: struct evsel temp iterator | 304 | * @tmp: struct evsel temp iterator |
305 | * @evsel: struct evsel iterator | 305 | * @evsel: struct evsel iterator |
306 | */ | 306 | */ |
307 | #define __evlist__for_each_safe(list, tmp, evsel) \ | 307 | #define __evlist__for_each_entry_safe(list, tmp, evsel) \ |
308 | list_for_each_entry_safe(evsel, tmp, list, node) | 308 | list_for_each_entry_safe(evsel, tmp, list, node) |
309 | 309 | ||
310 | /** | 310 | /** |
311 | * evlist__for_each_safe - safely iterate thru all the evsels | 311 | * evlist__for_each_entry_safe - safely iterate thru all the evsels |
312 | * @evlist: evlist instance to iterate | 312 | * @evlist: evlist instance to iterate |
313 | * @evsel: struct evsel iterator | 313 | * @evsel: struct evsel iterator |
314 | * @tmp: struct evsel temp iterator | 314 | * @tmp: struct evsel temp iterator |
315 | */ | 315 | */ |
316 | #define evlist__for_each_safe(evlist, tmp, evsel) \ | 316 | #define evlist__for_each_entry_safe(evlist, tmp, evsel) \ |
317 | __evlist__for_each_safe(&(evlist)->entries, tmp, evsel) | 317 | __evlist__for_each_entry_safe(&(evlist)->entries, tmp, evsel) |
318 | 318 | ||
319 | void perf_evlist__set_tracking_event(struct perf_evlist *evlist, | 319 | void perf_evlist__set_tracking_event(struct perf_evlist *evlist, |
320 | struct perf_evsel *tracking_evsel); | 320 | struct perf_evsel *tracking_evsel); |
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 08852dde1378..c5cd2698281f 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c | |||
@@ -336,7 +336,7 @@ static int write_event_desc(int fd, struct perf_header *h __maybe_unused, | |||
336 | if (ret < 0) | 336 | if (ret < 0) |
337 | return ret; | 337 | return ret; |
338 | 338 | ||
339 | evlist__for_each(evlist, evsel) { | 339 | evlist__for_each_entry(evlist, evsel) { |
340 | ret = do_write(fd, &evsel->attr, sz); | 340 | ret = do_write(fd, &evsel->attr, sz); |
341 | if (ret < 0) | 341 | if (ret < 0) |
342 | return ret; | 342 | return ret; |
@@ -801,7 +801,7 @@ static int write_group_desc(int fd, struct perf_header *h __maybe_unused, | |||
801 | if (ret < 0) | 801 | if (ret < 0) |
802 | return ret; | 802 | return ret; |
803 | 803 | ||
804 | evlist__for_each(evlist, evsel) { | 804 | evlist__for_each_entry(evlist, evsel) { |
805 | if (perf_evsel__is_group_leader(evsel) && | 805 | if (perf_evsel__is_group_leader(evsel) && |
806 | evsel->nr_members > 1) { | 806 | evsel->nr_members > 1) { |
807 | const char *name = evsel->group_name ?: "{anon_group}"; | 807 | const char *name = evsel->group_name ?: "{anon_group}"; |
@@ -1425,7 +1425,7 @@ static void print_group_desc(struct perf_header *ph, int fd __maybe_unused, | |||
1425 | 1425 | ||
1426 | session = container_of(ph, struct perf_session, header); | 1426 | session = container_of(ph, struct perf_session, header); |
1427 | 1427 | ||
1428 | evlist__for_each(session->evlist, evsel) { | 1428 | evlist__for_each_entry(session->evlist, evsel) { |
1429 | if (perf_evsel__is_group_leader(evsel) && | 1429 | if (perf_evsel__is_group_leader(evsel) && |
1430 | evsel->nr_members > 1) { | 1430 | evsel->nr_members > 1) { |
1431 | fprintf(fp, "# group: %s{%s", evsel->group_name ?: "", | 1431 | fprintf(fp, "# group: %s{%s", evsel->group_name ?: "", |
@@ -1703,7 +1703,7 @@ perf_evlist__find_by_index(struct perf_evlist *evlist, int idx) | |||
1703 | { | 1703 | { |
1704 | struct perf_evsel *evsel; | 1704 | struct perf_evsel *evsel; |
1705 | 1705 | ||
1706 | evlist__for_each(evlist, evsel) { | 1706 | evlist__for_each_entry(evlist, evsel) { |
1707 | if (evsel->idx == idx) | 1707 | if (evsel->idx == idx) |
1708 | return evsel; | 1708 | return evsel; |
1709 | } | 1709 | } |
@@ -2075,7 +2075,7 @@ static int process_group_desc(struct perf_file_section *section __maybe_unused, | |||
2075 | session->evlist->nr_groups = nr_groups; | 2075 | session->evlist->nr_groups = nr_groups; |
2076 | 2076 | ||
2077 | i = nr = 0; | 2077 | i = nr = 0; |
2078 | evlist__for_each(session->evlist, evsel) { | 2078 | evlist__for_each_entry(session->evlist, evsel) { |
2079 | if (evsel->idx == (int) desc[i].leader_idx) { | 2079 | if (evsel->idx == (int) desc[i].leader_idx) { |
2080 | evsel->leader = evsel; | 2080 | evsel->leader = evsel; |
2081 | /* {anon_group} is a dummy name */ | 2081 | /* {anon_group} is a dummy name */ |
@@ -2383,7 +2383,7 @@ int perf_session__write_header(struct perf_session *session, | |||
2383 | 2383 | ||
2384 | lseek(fd, sizeof(f_header), SEEK_SET); | 2384 | lseek(fd, sizeof(f_header), SEEK_SET); |
2385 | 2385 | ||
2386 | evlist__for_each(session->evlist, evsel) { | 2386 | evlist__for_each_entry(session->evlist, evsel) { |
2387 | evsel->id_offset = lseek(fd, 0, SEEK_CUR); | 2387 | evsel->id_offset = lseek(fd, 0, SEEK_CUR); |
2388 | err = do_write(fd, evsel->id, evsel->ids * sizeof(u64)); | 2388 | err = do_write(fd, evsel->id, evsel->ids * sizeof(u64)); |
2389 | if (err < 0) { | 2389 | if (err < 0) { |
@@ -2394,7 +2394,7 @@ int perf_session__write_header(struct perf_session *session, | |||
2394 | 2394 | ||
2395 | attr_offset = lseek(fd, 0, SEEK_CUR); | 2395 | attr_offset = lseek(fd, 0, SEEK_CUR); |
2396 | 2396 | ||
2397 | evlist__for_each(evlist, evsel) { | 2397 | evlist__for_each_entry(evlist, evsel) { |
2398 | f_attr = (struct perf_file_attr){ | 2398 | f_attr = (struct perf_file_attr){ |
2399 | .attr = evsel->attr, | 2399 | .attr = evsel->attr, |
2400 | .ids = { | 2400 | .ids = { |
@@ -2828,7 +2828,7 @@ static int perf_evlist__prepare_tracepoint_events(struct perf_evlist *evlist, | |||
2828 | { | 2828 | { |
2829 | struct perf_evsel *pos; | 2829 | struct perf_evsel *pos; |
2830 | 2830 | ||
2831 | evlist__for_each(evlist, pos) { | 2831 | evlist__for_each_entry(evlist, pos) { |
2832 | if (pos->attr.type == PERF_TYPE_TRACEPOINT && | 2832 | if (pos->attr.type == PERF_TYPE_TRACEPOINT && |
2833 | perf_evsel__prepare_tracepoint_event(pos, pevent)) | 2833 | perf_evsel__prepare_tracepoint_event(pos, pevent)) |
2834 | return -1; | 2834 | return -1; |
@@ -3127,7 +3127,7 @@ int perf_event__synthesize_attrs(struct perf_tool *tool, | |||
3127 | struct perf_evsel *evsel; | 3127 | struct perf_evsel *evsel; |
3128 | int err = 0; | 3128 | int err = 0; |
3129 | 3129 | ||
3130 | evlist__for_each(session->evlist, evsel) { | 3130 | evlist__for_each_entry(session->evlist, evsel) { |
3131 | err = perf_event__synthesize_attr(tool, &evsel->attr, evsel->ids, | 3131 | err = perf_event__synthesize_attr(tool, &evsel->attr, evsel->ids, |
3132 | evsel->id, process); | 3132 | evsel->id, process); |
3133 | if (err) { | 3133 | if (err) { |
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index d9826cce6801..e1fcc8d7c01a 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c | |||
@@ -2199,7 +2199,7 @@ size_t perf_evlist__fprintf_nr_events(struct perf_evlist *evlist, FILE *fp) | |||
2199 | struct perf_evsel *pos; | 2199 | struct perf_evsel *pos; |
2200 | size_t ret = 0; | 2200 | size_t ret = 0; |
2201 | 2201 | ||
2202 | evlist__for_each(evlist, pos) { | 2202 | evlist__for_each_entry(evlist, pos) { |
2203 | ret += fprintf(fp, "%s stats:\n", perf_evsel__name(pos)); | 2203 | ret += fprintf(fp, "%s stats:\n", perf_evsel__name(pos)); |
2204 | ret += events_stats__fprintf(&evsel__hists(pos)->stats, fp); | 2204 | ret += events_stats__fprintf(&evsel__hists(pos)->stats, fp); |
2205 | } | 2205 | } |
diff --git a/tools/perf/util/intel-bts.c b/tools/perf/util/intel-bts.c index 9df996085563..ecec73f6fe5a 100644 --- a/tools/perf/util/intel-bts.c +++ b/tools/perf/util/intel-bts.c | |||
@@ -777,7 +777,7 @@ static int intel_bts_synth_events(struct intel_bts *bts, | |||
777 | u64 id; | 777 | u64 id; |
778 | int err; | 778 | int err; |
779 | 779 | ||
780 | evlist__for_each(evlist, evsel) { | 780 | evlist__for_each_entry(evlist, evsel) { |
781 | if (evsel->attr.type == bts->pmu_type && evsel->ids) { | 781 | if (evsel->attr.type == bts->pmu_type && evsel->ids) { |
782 | found = true; | 782 | found = true; |
783 | break; | 783 | break; |
diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c index a2fe3a2194cc..dc243b19197b 100644 --- a/tools/perf/util/intel-pt.c +++ b/tools/perf/util/intel-pt.c | |||
@@ -557,7 +557,7 @@ static bool intel_pt_exclude_kernel(struct intel_pt *pt) | |||
557 | { | 557 | { |
558 | struct perf_evsel *evsel; | 558 | struct perf_evsel *evsel; |
559 | 559 | ||
560 | evlist__for_each(pt->session->evlist, evsel) { | 560 | evlist__for_each_entry(pt->session->evlist, evsel) { |
561 | if (intel_pt_get_config(pt, &evsel->attr, NULL) && | 561 | if (intel_pt_get_config(pt, &evsel->attr, NULL) && |
562 | !evsel->attr.exclude_kernel) | 562 | !evsel->attr.exclude_kernel) |
563 | return false; | 563 | return false; |
@@ -573,7 +573,7 @@ static bool intel_pt_return_compression(struct intel_pt *pt) | |||
573 | if (!pt->noretcomp_bit) | 573 | if (!pt->noretcomp_bit) |
574 | return true; | 574 | return true; |
575 | 575 | ||
576 | evlist__for_each(pt->session->evlist, evsel) { | 576 | evlist__for_each_entry(pt->session->evlist, evsel) { |
577 | if (intel_pt_get_config(pt, &evsel->attr, &config) && | 577 | if (intel_pt_get_config(pt, &evsel->attr, &config) && |
578 | (config & pt->noretcomp_bit)) | 578 | (config & pt->noretcomp_bit)) |
579 | return false; | 579 | return false; |
@@ -593,7 +593,7 @@ static unsigned int intel_pt_mtc_period(struct intel_pt *pt) | |||
593 | for (shift = 0, config = pt->mtc_freq_bits; !(config & 1); shift++) | 593 | for (shift = 0, config = pt->mtc_freq_bits; !(config & 1); shift++) |
594 | config >>= 1; | 594 | config >>= 1; |
595 | 595 | ||
596 | evlist__for_each(pt->session->evlist, evsel) { | 596 | evlist__for_each_entry(pt->session->evlist, evsel) { |
597 | if (intel_pt_get_config(pt, &evsel->attr, &config)) | 597 | if (intel_pt_get_config(pt, &evsel->attr, &config)) |
598 | return (config & pt->mtc_freq_bits) >> shift; | 598 | return (config & pt->mtc_freq_bits) >> shift; |
599 | } | 599 | } |
@@ -609,7 +609,7 @@ static bool intel_pt_timeless_decoding(struct intel_pt *pt) | |||
609 | if (!pt->tsc_bit || !pt->cap_user_time_zero) | 609 | if (!pt->tsc_bit || !pt->cap_user_time_zero) |
610 | return true; | 610 | return true; |
611 | 611 | ||
612 | evlist__for_each(pt->session->evlist, evsel) { | 612 | evlist__for_each_entry(pt->session->evlist, evsel) { |
613 | if (!(evsel->attr.sample_type & PERF_SAMPLE_TIME)) | 613 | if (!(evsel->attr.sample_type & PERF_SAMPLE_TIME)) |
614 | return true; | 614 | return true; |
615 | if (intel_pt_get_config(pt, &evsel->attr, &config)) { | 615 | if (intel_pt_get_config(pt, &evsel->attr, &config)) { |
@@ -626,7 +626,7 @@ static bool intel_pt_tracing_kernel(struct intel_pt *pt) | |||
626 | { | 626 | { |
627 | struct perf_evsel *evsel; | 627 | struct perf_evsel *evsel; |
628 | 628 | ||
629 | evlist__for_each(pt->session->evlist, evsel) { | 629 | evlist__for_each_entry(pt->session->evlist, evsel) { |
630 | if (intel_pt_get_config(pt, &evsel->attr, NULL) && | 630 | if (intel_pt_get_config(pt, &evsel->attr, NULL) && |
631 | !evsel->attr.exclude_kernel) | 631 | !evsel->attr.exclude_kernel) |
632 | return true; | 632 | return true; |
@@ -643,7 +643,7 @@ static bool intel_pt_have_tsc(struct intel_pt *pt) | |||
643 | if (!pt->tsc_bit) | 643 | if (!pt->tsc_bit) |
644 | return false; | 644 | return false; |
645 | 645 | ||
646 | evlist__for_each(pt->session->evlist, evsel) { | 646 | evlist__for_each_entry(pt->session->evlist, evsel) { |
647 | if (intel_pt_get_config(pt, &evsel->attr, &config)) { | 647 | if (intel_pt_get_config(pt, &evsel->attr, &config)) { |
648 | if (config & pt->tsc_bit) | 648 | if (config & pt->tsc_bit) |
649 | have_tsc = true; | 649 | have_tsc = true; |
@@ -1851,7 +1851,7 @@ static int intel_pt_synth_events(struct intel_pt *pt, | |||
1851 | u64 id; | 1851 | u64 id; |
1852 | int err; | 1852 | int err; |
1853 | 1853 | ||
1854 | evlist__for_each(evlist, evsel) { | 1854 | evlist__for_each_entry(evlist, evsel) { |
1855 | if (evsel->attr.type == pt->pmu_type && evsel->ids) { | 1855 | if (evsel->attr.type == pt->pmu_type && evsel->ids) { |
1856 | found = true; | 1856 | found = true; |
1857 | break; | 1857 | break; |
@@ -1931,7 +1931,7 @@ static int intel_pt_synth_events(struct intel_pt *pt, | |||
1931 | pt->sample_transactions = true; | 1931 | pt->sample_transactions = true; |
1932 | pt->transactions_id = id; | 1932 | pt->transactions_id = id; |
1933 | id += 1; | 1933 | id += 1; |
1934 | evlist__for_each(evlist, evsel) { | 1934 | evlist__for_each_entry(evlist, evsel) { |
1935 | if (evsel->id && evsel->id[0] == pt->transactions_id) { | 1935 | if (evsel->id && evsel->id[0] == pt->transactions_id) { |
1936 | if (evsel->name) | 1936 | if (evsel->name) |
1937 | zfree(&evsel->name); | 1937 | zfree(&evsel->name); |
@@ -1969,7 +1969,7 @@ static struct perf_evsel *intel_pt_find_sched_switch(struct perf_evlist *evlist) | |||
1969 | { | 1969 | { |
1970 | struct perf_evsel *evsel; | 1970 | struct perf_evsel *evsel; |
1971 | 1971 | ||
1972 | evlist__for_each_reverse(evlist, evsel) { | 1972 | evlist__for_each_entry_reverse(evlist, evsel) { |
1973 | const char *name = perf_evsel__name(evsel); | 1973 | const char *name = perf_evsel__name(evsel); |
1974 | 1974 | ||
1975 | if (!strcmp(name, "sched:sched_switch")) | 1975 | if (!strcmp(name, "sched:sched_switch")) |
@@ -1983,7 +1983,7 @@ static bool intel_pt_find_switch(struct perf_evlist *evlist) | |||
1983 | { | 1983 | { |
1984 | struct perf_evsel *evsel; | 1984 | struct perf_evsel *evsel; |
1985 | 1985 | ||
1986 | evlist__for_each(evlist, evsel) { | 1986 | evlist__for_each_entry(evlist, evsel) { |
1987 | if (evsel->attr.context_switch) | 1987 | if (evsel->attr.context_switch) |
1988 | return true; | 1988 | return true; |
1989 | } | 1989 | } |
diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c index 86afe9618bb0..9f3305f6b6d5 100644 --- a/tools/perf/util/jitdump.c +++ b/tools/perf/util/jitdump.c | |||
@@ -108,7 +108,7 @@ jit_validate_events(struct perf_session *session) | |||
108 | /* | 108 | /* |
109 | * check that all events use CLOCK_MONOTONIC | 109 | * check that all events use CLOCK_MONOTONIC |
110 | */ | 110 | */ |
111 | evlist__for_each(session->evlist, evsel) { | 111 | evlist__for_each_entry(session->evlist, evsel) { |
112 | if (evsel->attr.use_clockid == 0 || evsel->attr.clockid != CLOCK_MONOTONIC) | 112 | if (evsel->attr.use_clockid == 0 || evsel->attr.clockid != CLOCK_MONOTONIC) |
113 | return -1; | 113 | return -1; |
114 | } | 114 | } |
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index d15e335842b7..ebd87b773f56 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c | |||
@@ -1396,7 +1396,7 @@ int parse_events__modifier_event(struct list_head *list, char *str, bool add) | |||
1396 | if (!add && get_event_modifier(&mod, str, NULL)) | 1396 | if (!add && get_event_modifier(&mod, str, NULL)) |
1397 | return -EINVAL; | 1397 | return -EINVAL; |
1398 | 1398 | ||
1399 | __evlist__for_each(list, evsel) { | 1399 | __evlist__for_each_entry(list, evsel) { |
1400 | if (add && get_event_modifier(&mod, str, evsel)) | 1400 | if (add && get_event_modifier(&mod, str, evsel)) |
1401 | return -EINVAL; | 1401 | return -EINVAL; |
1402 | 1402 | ||
@@ -1422,7 +1422,7 @@ int parse_events_name(struct list_head *list, char *name) | |||
1422 | { | 1422 | { |
1423 | struct perf_evsel *evsel; | 1423 | struct perf_evsel *evsel; |
1424 | 1424 | ||
1425 | __evlist__for_each(list, evsel) { | 1425 | __evlist__for_each_entry(list, evsel) { |
1426 | if (!evsel->name) | 1426 | if (!evsel->name) |
1427 | evsel->name = strdup(name); | 1427 | evsel->name = strdup(name); |
1428 | } | 1428 | } |
diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c index 98f127abfa42..65c6c73d28fe 100644 --- a/tools/perf/util/python.c +++ b/tools/perf/util/python.c | |||
@@ -957,7 +957,7 @@ static PyObject *pyrf_evlist__item(PyObject *obj, Py_ssize_t i) | |||
957 | if (i >= pevlist->evlist.nr_entries) | 957 | if (i >= pevlist->evlist.nr_entries) |
958 | return NULL; | 958 | return NULL; |
959 | 959 | ||
960 | evlist__for_each(&pevlist->evlist, pos) { | 960 | evlist__for_each_entry(&pevlist->evlist, pos) { |
961 | if (i-- == 0) | 961 | if (i-- == 0) |
962 | break; | 962 | break; |
963 | } | 963 | } |
diff --git a/tools/perf/util/record.c b/tools/perf/util/record.c index 481792c7484b..98bf584853ea 100644 --- a/tools/perf/util/record.c +++ b/tools/perf/util/record.c | |||
@@ -148,7 +148,7 @@ void perf_evlist__config(struct perf_evlist *evlist, struct record_opts *opts, | |||
148 | 148 | ||
149 | use_comm_exec = perf_can_comm_exec(); | 149 | use_comm_exec = perf_can_comm_exec(); |
150 | 150 | ||
151 | evlist__for_each(evlist, evsel) { | 151 | evlist__for_each_entry(evlist, evsel) { |
152 | perf_evsel__config(evsel, opts, callchain); | 152 | perf_evsel__config(evsel, opts, callchain); |
153 | if (evsel->tracking && use_comm_exec) | 153 | if (evsel->tracking && use_comm_exec) |
154 | evsel->attr.comm_exec = 1; | 154 | evsel->attr.comm_exec = 1; |
@@ -161,18 +161,18 @@ void perf_evlist__config(struct perf_evlist *evlist, struct record_opts *opts, | |||
161 | * match the id. | 161 | * match the id. |
162 | */ | 162 | */ |
163 | use_sample_identifier = perf_can_sample_identifier(); | 163 | use_sample_identifier = perf_can_sample_identifier(); |
164 | evlist__for_each(evlist, evsel) | 164 | evlist__for_each_entry(evlist, evsel) |
165 | perf_evsel__set_sample_id(evsel, use_sample_identifier); | 165 | perf_evsel__set_sample_id(evsel, use_sample_identifier); |
166 | } else if (evlist->nr_entries > 1) { | 166 | } else if (evlist->nr_entries > 1) { |
167 | struct perf_evsel *first = perf_evlist__first(evlist); | 167 | struct perf_evsel *first = perf_evlist__first(evlist); |
168 | 168 | ||
169 | evlist__for_each(evlist, evsel) { | 169 | evlist__for_each_entry(evlist, evsel) { |
170 | if (evsel->attr.sample_type == first->attr.sample_type) | 170 | if (evsel->attr.sample_type == first->attr.sample_type) |
171 | continue; | 171 | continue; |
172 | use_sample_identifier = perf_can_sample_identifier(); | 172 | use_sample_identifier = perf_can_sample_identifier(); |
173 | break; | 173 | break; |
174 | } | 174 | } |
175 | evlist__for_each(evlist, evsel) | 175 | evlist__for_each_entry(evlist, evsel) |
176 | perf_evsel__set_sample_id(evsel, use_sample_identifier); | 176 | perf_evsel__set_sample_id(evsel, use_sample_identifier); |
177 | } | 177 | } |
178 | 178 | ||
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 43be0c5a6a26..078d49626494 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c | |||
@@ -83,7 +83,7 @@ static bool perf_session__has_comm_exec(struct perf_session *session) | |||
83 | { | 83 | { |
84 | struct perf_evsel *evsel; | 84 | struct perf_evsel *evsel; |
85 | 85 | ||
86 | evlist__for_each(session->evlist, evsel) { | 86 | evlist__for_each_entry(session->evlist, evsel) { |
87 | if (evsel->attr.comm_exec) | 87 | if (evsel->attr.comm_exec) |
88 | return true; | 88 | return true; |
89 | } | 89 | } |
@@ -1872,7 +1872,7 @@ bool perf_session__has_traces(struct perf_session *session, const char *msg) | |||
1872 | { | 1872 | { |
1873 | struct perf_evsel *evsel; | 1873 | struct perf_evsel *evsel; |
1874 | 1874 | ||
1875 | evlist__for_each(session->evlist, evsel) { | 1875 | evlist__for_each_entry(session->evlist, evsel) { |
1876 | if (evsel->attr.type == PERF_TYPE_TRACEPOINT) | 1876 | if (evsel->attr.type == PERF_TYPE_TRACEPOINT) |
1877 | return true; | 1877 | return true; |
1878 | } | 1878 | } |
@@ -1954,7 +1954,7 @@ struct perf_evsel *perf_session__find_first_evtype(struct perf_session *session, | |||
1954 | { | 1954 | { |
1955 | struct perf_evsel *pos; | 1955 | struct perf_evsel *pos; |
1956 | 1956 | ||
1957 | evlist__for_each(session->evlist, pos) { | 1957 | evlist__for_each_entry(session->evlist, pos) { |
1958 | if (pos->attr.type == type) | 1958 | if (pos->attr.type == type) |
1959 | return pos; | 1959 | return pos; |
1960 | } | 1960 | } |
@@ -2109,7 +2109,7 @@ int perf_event__synthesize_id_index(struct perf_tool *tool, | |||
2109 | max_nr = (UINT16_MAX - sizeof(struct id_index_event)) / | 2109 | max_nr = (UINT16_MAX - sizeof(struct id_index_event)) / |
2110 | sizeof(struct id_index_entry); | 2110 | sizeof(struct id_index_entry); |
2111 | 2111 | ||
2112 | evlist__for_each(evlist, evsel) | 2112 | evlist__for_each_entry(evlist, evsel) |
2113 | nr += evsel->ids; | 2113 | nr += evsel->ids; |
2114 | 2114 | ||
2115 | n = nr > max_nr ? max_nr : nr; | 2115 | n = nr > max_nr ? max_nr : nr; |
@@ -2122,7 +2122,7 @@ int perf_event__synthesize_id_index(struct perf_tool *tool, | |||
2122 | ev->id_index.header.size = sz; | 2122 | ev->id_index.header.size = sz; |
2123 | ev->id_index.nr = n; | 2123 | ev->id_index.nr = n; |
2124 | 2124 | ||
2125 | evlist__for_each(evlist, evsel) { | 2125 | evlist__for_each_entry(evlist, evsel) { |
2126 | u32 j; | 2126 | u32 j; |
2127 | 2127 | ||
2128 | for (j = 0; j < evsel->ids; j++) { | 2128 | for (j = 0; j < evsel->ids; j++) { |
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index a764139af485..5854b4660a49 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c | |||
@@ -2069,7 +2069,7 @@ static struct perf_evsel *find_evsel(struct perf_evlist *evlist, char *event_nam | |||
2069 | } | 2069 | } |
2070 | 2070 | ||
2071 | full_name = !!strchr(event_name, ':'); | 2071 | full_name = !!strchr(event_name, ':'); |
2072 | evlist__for_each(evlist, pos) { | 2072 | evlist__for_each_entry(evlist, pos) { |
2073 | /* case 2 */ | 2073 | /* case 2 */ |
2074 | if (full_name && !strcmp(pos->name, event_name)) | 2074 | if (full_name && !strcmp(pos->name, event_name)) |
2075 | return pos; | 2075 | return pos; |
@@ -2125,7 +2125,7 @@ static int add_all_dynamic_fields(struct perf_evlist *evlist, bool raw_trace, | |||
2125 | int ret; | 2125 | int ret; |
2126 | struct perf_evsel *evsel; | 2126 | struct perf_evsel *evsel; |
2127 | 2127 | ||
2128 | evlist__for_each(evlist, evsel) { | 2128 | evlist__for_each_entry(evlist, evsel) { |
2129 | if (evsel->attr.type != PERF_TYPE_TRACEPOINT) | 2129 | if (evsel->attr.type != PERF_TYPE_TRACEPOINT) |
2130 | continue; | 2130 | continue; |
2131 | 2131 | ||
@@ -2143,7 +2143,7 @@ static int add_all_matching_fields(struct perf_evlist *evlist, | |||
2143 | struct perf_evsel *evsel; | 2143 | struct perf_evsel *evsel; |
2144 | struct format_field *field; | 2144 | struct format_field *field; |
2145 | 2145 | ||
2146 | evlist__for_each(evlist, evsel) { | 2146 | evlist__for_each_entry(evlist, evsel) { |
2147 | if (evsel->attr.type != PERF_TYPE_TRACEPOINT) | 2147 | if (evsel->attr.type != PERF_TYPE_TRACEPOINT) |
2148 | continue; | 2148 | continue; |
2149 | 2149 | ||
@@ -2456,7 +2456,7 @@ static const char *get_default_sort_order(struct perf_evlist *evlist) | |||
2456 | if (evlist == NULL) | 2456 | if (evlist == NULL) |
2457 | goto out_no_evlist; | 2457 | goto out_no_evlist; |
2458 | 2458 | ||
2459 | evlist__for_each(evlist, evsel) { | 2459 | evlist__for_each_entry(evlist, evsel) { |
2460 | if (evsel->attr.type != PERF_TYPE_TRACEPOINT) { | 2460 | if (evsel->attr.type != PERF_TYPE_TRACEPOINT) { |
2461 | use_trace = false; | 2461 | use_trace = false; |
2462 | break; | 2462 | break; |
diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c index c1ba255f2abe..39345c2ddfc2 100644 --- a/tools/perf/util/stat.c +++ b/tools/perf/util/stat.c | |||
@@ -162,7 +162,7 @@ int perf_evlist__alloc_stats(struct perf_evlist *evlist, bool alloc_raw) | |||
162 | { | 162 | { |
163 | struct perf_evsel *evsel; | 163 | struct perf_evsel *evsel; |
164 | 164 | ||
165 | evlist__for_each(evlist, evsel) { | 165 | evlist__for_each_entry(evlist, evsel) { |
166 | if (perf_evsel__alloc_stats(evsel, alloc_raw)) | 166 | if (perf_evsel__alloc_stats(evsel, alloc_raw)) |
167 | goto out_free; | 167 | goto out_free; |
168 | } | 168 | } |
@@ -178,7 +178,7 @@ void perf_evlist__free_stats(struct perf_evlist *evlist) | |||
178 | { | 178 | { |
179 | struct perf_evsel *evsel; | 179 | struct perf_evsel *evsel; |
180 | 180 | ||
181 | evlist__for_each(evlist, evsel) { | 181 | evlist__for_each_entry(evlist, evsel) { |
182 | perf_evsel__free_stat_priv(evsel); | 182 | perf_evsel__free_stat_priv(evsel); |
183 | perf_evsel__free_counts(evsel); | 183 | perf_evsel__free_counts(evsel); |
184 | perf_evsel__free_prev_raw_counts(evsel); | 184 | perf_evsel__free_prev_raw_counts(evsel); |
@@ -189,7 +189,7 @@ void perf_evlist__reset_stats(struct perf_evlist *evlist) | |||
189 | { | 189 | { |
190 | struct perf_evsel *evsel; | 190 | struct perf_evsel *evsel; |
191 | 191 | ||
192 | evlist__for_each(evlist, evsel) { | 192 | evlist__for_each_entry(evlist, evsel) { |
193 | perf_evsel__reset_stat_priv(evsel); | 193 | perf_evsel__reset_stat_priv(evsel); |
194 | perf_evsel__reset_counts(evsel); | 194 | perf_evsel__reset_counts(evsel); |
195 | } | 195 | } |