perf evlist: Rename for_each() macros to for_each_entry()
authorArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 23 Jun 2016 14:26:15 +0000 (11:26 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 23 Jun 2016 14:26:15 +0000 (11:26 -0300)
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>
40 files changed:
tools/perf/arch/x86/util/auxtrace.c
tools/perf/arch/x86/util/intel-bts.c
tools/perf/arch/x86/util/intel-pt.c
tools/perf/builtin-annotate.c
tools/perf/builtin-diff.c
tools/perf/builtin-evlist.c
tools/perf/builtin-inject.c
tools/perf/builtin-kmem.c
tools/perf/builtin-kvm.c
tools/perf/builtin-record.c
tools/perf/builtin-report.c
tools/perf/builtin-script.c
tools/perf/builtin-stat.c
tools/perf/builtin-top.c
tools/perf/builtin-trace.c
tools/perf/tests/backward-ring-buffer.c
tools/perf/tests/evsel-roundtrip-name.c
tools/perf/tests/hists_filter.c
tools/perf/tests/hists_link.c
tools/perf/tests/mmap-basic.c
tools/perf/tests/parse-events.c
tools/perf/tests/switch-tracking.c
tools/perf/ui/browsers/hists.c
tools/perf/ui/gtk/hists.c
tools/perf/ui/hist.c
tools/perf/util/cgroup.c
tools/perf/util/data-convert-bt.c
tools/perf/util/evlist.c
tools/perf/util/evlist.h
tools/perf/util/header.c
tools/perf/util/hist.c
tools/perf/util/intel-bts.c
tools/perf/util/intel-pt.c
tools/perf/util/jitdump.c
tools/perf/util/parse-events.c
tools/perf/util/python.c
tools/perf/util/record.c
tools/perf/util/session.c
tools/perf/util/sort.c
tools/perf/util/stat.c

index 7a7805583e3fe4f40bba1b3435d9c149ea3adebd..cc1d865e31f1b7975578343761104db81398e8de 100644 (file)
@@ -37,7 +37,7 @@ struct auxtrace_record *auxtrace_record__init_intel(struct perf_evlist *evlist,
        intel_bts_pmu = perf_pmu__find(INTEL_BTS_PMU_NAME);
 
        if (evlist) {
-               evlist__for_each(evlist, evsel) {
+               evlist__for_each_entry(evlist, evsel) {
                        if (intel_pt_pmu &&
                            evsel->attr.type == intel_pt_pmu->type)
                                found_pt = true;
index 7dc30637cf66f4957dd6608a9b3a145a0e81a487..5132775a044fd7b1acf2a6c814567f56c7e03b3b 100644 (file)
@@ -124,7 +124,7 @@ static int intel_bts_recording_options(struct auxtrace_record *itr,
        btsr->evlist = evlist;
        btsr->snapshot_mode = opts->auxtrace_snapshot_mode;
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                if (evsel->attr.type == intel_bts_pmu->type) {
                        if (intel_bts_evsel) {
                                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)
                        container_of(itr, struct intel_bts_recording, itr);
        struct perf_evsel *evsel;
 
-       evlist__for_each(btsr->evlist, evsel) {
+       evlist__for_each_entry(btsr->evlist, evsel) {
                if (evsel->attr.type == btsr->intel_bts_pmu->type)
                        return perf_evsel__disable(evsel);
        }
@@ -340,7 +340,7 @@ static int intel_bts_snapshot_finish(struct auxtrace_record *itr)
                        container_of(itr, struct intel_bts_recording, itr);
        struct perf_evsel *evsel;
 
-       evlist__for_each(btsr->evlist, evsel) {
+       evlist__for_each_entry(btsr->evlist, evsel) {
                if (evsel->attr.type == btsr->intel_bts_pmu->type)
                        return perf_evsel__enable(evsel);
        }
@@ -422,7 +422,7 @@ static int intel_bts_read_finish(struct auxtrace_record *itr, int idx)
                        container_of(itr, struct intel_bts_recording, itr);
        struct perf_evsel *evsel;
 
-       evlist__for_each(btsr->evlist, evsel) {
+       evlist__for_each_entry(btsr->evlist, evsel) {
                if (evsel->attr.type == btsr->intel_bts_pmu->type)
                        return perf_evlist__enable_event_idx(btsr->evlist,
                                                             evsel, idx);
index a07b9605e93b3f1c7c746f5296229c20f8f3767a..fb51457ba338f8c1a3dc549582213eaf5446ec56 100644 (file)
@@ -131,7 +131,7 @@ static int intel_pt_read_config(struct perf_pmu *intel_pt_pmu, const char *str,
        if (!mask)
                return -EINVAL;
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                if (evsel->attr.type == intel_pt_pmu->type) {
                        *res = intel_pt_masked_bits(mask, evsel->attr.config);
                        return 0;
@@ -511,7 +511,7 @@ static int intel_pt_recording_options(struct auxtrace_record *itr,
        ptr->evlist = evlist;
        ptr->snapshot_mode = opts->auxtrace_snapshot_mode;
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                if (evsel->attr.type == intel_pt_pmu->type) {
                        if (intel_pt_evsel) {
                                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)
                        container_of(itr, struct intel_pt_recording, itr);
        struct perf_evsel *evsel;
 
-       evlist__for_each(ptr->evlist, evsel) {
+       evlist__for_each_entry(ptr->evlist, evsel) {
                if (evsel->attr.type == ptr->intel_pt_pmu->type)
                        return perf_evsel__disable(evsel);
        }
@@ -738,7 +738,7 @@ static int intel_pt_snapshot_finish(struct auxtrace_record *itr)
                        container_of(itr, struct intel_pt_recording, itr);
        struct perf_evsel *evsel;
 
-       evlist__for_each(ptr->evlist, evsel) {
+       evlist__for_each_entry(ptr->evlist, evsel) {
                if (evsel->attr.type == ptr->intel_pt_pmu->type)
                        return perf_evsel__enable(evsel);
        }
@@ -1011,7 +1011,7 @@ static int intel_pt_read_finish(struct auxtrace_record *itr, int idx)
                        container_of(itr, struct intel_pt_recording, itr);
        struct perf_evsel *evsel;
 
-       evlist__for_each(ptr->evlist, evsel) {
+       evlist__for_each_entry(ptr->evlist, evsel) {
                if (evsel->attr.type == ptr->intel_pt_pmu->type)
                        return perf_evlist__enable_event_idx(ptr->evlist, evsel,
                                                             idx);
index a2324e1892aa575f14ea81f2d7bd909f1419b5c4..b15e7683f38c9ca27fbd0c6ca7f80c1fa3d41873 100644 (file)
@@ -236,7 +236,7 @@ static int __cmd_annotate(struct perf_annotate *ann)
                perf_session__fprintf_dsos(session, stdout);
 
        total_nr_samples = 0;
-       evlist__for_each(session->evlist, pos) {
+       evlist__for_each_entry(session->evlist, pos) {
                struct hists *hists = evsel__hists(pos);
                u32 nr_samples = hists->stats.nr_events[PERF_RECORD_SAMPLE];
 
index eac0b1100b8fd0d6da921ef92f6c35c4c5b32080..21ee753211adfa954b9e25fb1df9be8354dfc8a5 100644 (file)
@@ -363,7 +363,7 @@ static struct perf_evsel *evsel_match(struct perf_evsel *evsel,
 {
        struct perf_evsel *e;
 
-       evlist__for_each(evlist, e) {
+       evlist__for_each_entry(evlist, e) {
                if (perf_evsel__match2(evsel, e))
                        return e;
        }
@@ -375,7 +375,7 @@ static void perf_evlist__collapse_resort(struct perf_evlist *evlist)
 {
        struct perf_evsel *evsel;
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                struct hists *hists = evsel__hists(evsel);
 
                hists__collapse_resort(hists, NULL);
@@ -681,7 +681,7 @@ static void data_process(void)
        struct perf_evsel *evsel_base;
        bool first = true;
 
-       evlist__for_each(evlist_base, evsel_base) {
+       evlist__for_each_entry(evlist_base, evsel_base) {
                struct hists *hists_base = evsel__hists(evsel_base);
                struct data__file *d;
                int i;
index 8a31f511e1a0d79b9784387fa7b01db42ac3094e..e09c4287fe87435d200e20f9f216de9aa71129c7 100644 (file)
@@ -32,7 +32,7 @@ static int __cmd_evlist(const char *file_name, struct perf_attr_details *details
        if (session == NULL)
                return -1;
 
-       evlist__for_each(session->evlist, pos) {
+       evlist__for_each_entry(session->evlist, pos) {
                perf_evsel__fprintf(pos, details, stdout);
 
                if (pos->attr.type == PERF_TYPE_TRACEPOINT)
index e5afa8fe1bf1125ab577ea090befa42dbe64760c..73c1c4cc36009d79a3f33c80db6e4834dc21b81a 100644 (file)
@@ -562,7 +562,7 @@ static void strip_init(struct perf_inject *inject)
 
        inject->tool.context_switch = perf_event__drop;
 
-       evlist__for_each(evlist, evsel)
+       evlist__for_each_entry(evlist, evsel)
                evsel->handler = drop_sample;
 }
 
@@ -590,7 +590,7 @@ static bool ok_to_remove(struct perf_evlist *evlist,
        if (!has_tracking(evsel_to_remove))
                return true;
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                if (evsel->handler != drop_sample) {
                        cnt += 1;
                        if ((evsel->attr.sample_type & COMPAT_MASK) ==
@@ -608,7 +608,7 @@ static void strip_fini(struct perf_inject *inject)
        struct perf_evsel *evsel, *tmp;
 
        /* Remove non-synthesized evsels if possible */
-       evlist__for_each_safe(evlist, tmp, evsel) {
+       evlist__for_each_entry_safe(evlist, tmp, evsel) {
                if (evsel->handler == drop_sample &&
                    ok_to_remove(evlist, evsel)) {
                        pr_debug("Deleting %s\n", perf_evsel__name(evsel));
@@ -643,7 +643,7 @@ static int __cmd_inject(struct perf_inject *inject)
        } else if (inject->sched_stat) {
                struct perf_evsel *evsel;
 
-               evlist__for_each(session->evlist, evsel) {
+               evlist__for_each_entry(session->evlist, evsel) {
                        const char *name = perf_evsel__name(evsel);
 
                        if (!strcmp(name, "sched:sched_switch")) {
index 4defe44a4a836f0bf1847937b630cb287831fd71..b1d491c2e7047c5ba7ef1dac4f86db697f8a4c19 100644 (file)
@@ -1354,7 +1354,7 @@ static int __cmd_kmem(struct perf_session *session)
                goto out;
        }
 
-       evlist__for_each(session->evlist, evsel) {
+       evlist__for_each_entry(session->evlist, evsel) {
                if (!strcmp(perf_evsel__name(evsel), "kmem:mm_page_alloc") &&
                    perf_evsel__field(evsel, "pfn")) {
                        use_pfn = true;
index 8f8f90e2b993660f6c9f4f470e83338c51259576..f4efef9d1eb3e58bd40f1896561c37f298c0c765 100644 (file)
@@ -988,7 +988,7 @@ static int kvm_live_open_events(struct perf_kvm_stat *kvm)
         * Note: exclude_{guest,host} do not apply here.
         *       This command processes KVM tracepoints from host only
         */
-       evlist__for_each(evlist, pos) {
+       evlist__for_each_entry(evlist, pos) {
                struct perf_event_attr *attr = &pos->attr;
 
                /* make sure these *are* set */
index c97b2b69ba0a2889ca1d7bd082f653f0af918b99..81411b14df4ca69164ee0204c879bf64b68a6613 100644 (file)
@@ -353,7 +353,7 @@ static int record__open(struct record *rec)
 
        perf_evlist__config(evlist, opts, &callchain_param);
 
-       evlist__for_each(evlist, pos) {
+       evlist__for_each_entry(evlist, pos) {
 try_again:
                if (perf_evsel__open(pos, pos->cpus, pos->threads) < 0) {
                        if (perf_evsel__fallback(pos, errno, msg, sizeof(msg))) {
index bcb49ff18c1d163d1f4cb501c7371300fbc16320..f6cb357986c6f7bc95c2797dcd66dbcfb2ab61a8 100644 (file)
@@ -361,7 +361,7 @@ static int perf_evlist__tty_browse_hists(struct perf_evlist *evlist,
        struct perf_evsel *pos;
 
        fprintf(stdout, "#\n# Total Lost Samples: %" PRIu64 "\n#\n", evlist->stats.total_lost_samples);
-       evlist__for_each(evlist, pos) {
+       evlist__for_each_entry(evlist, pos) {
                struct hists *hists = evsel__hists(pos);
                const char *evname = perf_evsel__name(pos);
 
@@ -478,7 +478,7 @@ static int report__collapse_hists(struct report *rep)
 
        ui_progress__init(&prog, rep->nr_entries, "Merging related events...");
 
-       evlist__for_each(rep->session->evlist, pos) {
+       evlist__for_each_entry(rep->session->evlist, pos) {
                struct hists *hists = evsel__hists(pos);
 
                if (pos->idx == 0)
@@ -511,7 +511,7 @@ static void report__output_resort(struct report *rep)
 
        ui_progress__init(&prog, rep->nr_entries, "Sorting events for output...");
 
-       evlist__for_each(rep->session->evlist, pos)
+       evlist__for_each_entry(rep->session->evlist, pos)
                perf_evsel__output_resort(pos, &prog);
 
        ui_progress__finish();
@@ -552,7 +552,7 @@ static int __cmd_report(struct report *rep)
 
        report__warn_kptr_restrict(rep);
 
-       evlist__for_each(session->evlist, pos)
+       evlist__for_each_entry(session->evlist, pos)
                rep->nr_entries += evsel__hists(pos)->nr_entries;
 
        if (use_browser == 0) {
@@ -583,7 +583,7 @@ static int __cmd_report(struct report *rep)
         * might be changed during the collapse phase.
         */
        rep->nr_entries = 0;
-       evlist__for_each(session->evlist, pos)
+       evlist__for_each_entry(session->evlist, pos)
                rep->nr_entries += evsel__hists(pos)->nr_entries;
 
        if (rep->nr_entries == 0) {
index 46011235af5d19d9cba773d6fe69cd13515a7be0..0e18e06e7fd58098eba6caa84f8d80aaa9d72cb6 100644 (file)
@@ -369,7 +369,7 @@ static int perf_session__check_output_opt(struct perf_session *session)
        if (!no_callchain) {
                bool use_callchain = false;
 
-               evlist__for_each(session->evlist, evsel) {
+               evlist__for_each_entry(session->evlist, evsel) {
                        if (evsel->attr.sample_type & PERF_SAMPLE_CALLCHAIN) {
                                use_callchain = true;
                                break;
@@ -389,7 +389,7 @@ static int perf_session__check_output_opt(struct perf_session *session)
 
                j = PERF_TYPE_TRACEPOINT;
 
-               evlist__for_each(session->evlist, evsel) {
+               evlist__for_each_entry(session->evlist, evsel) {
                        if (evsel->attr.type != j)
                                continue;
 
@@ -720,7 +720,7 @@ static int perf_evlist__max_name_len(struct perf_evlist *evlist)
        struct perf_evsel *evsel;
        int max = 0;
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                int len = strlen(perf_evsel__name(evsel));
 
                max = MAX(len, max);
@@ -945,7 +945,7 @@ static int process_attr(struct perf_tool *tool, union perf_event *event,
        if (evsel->attr.type >= PERF_TYPE_MAX)
                return 0;
 
-       evlist__for_each(evlist, pos) {
+       evlist__for_each_entry(evlist, pos) {
                if (pos->attr.type == evsel->attr.type && pos != evsel)
                        return 0;
        }
@@ -1671,7 +1671,7 @@ static int check_ev_match(char *dir_name, char *scriptname,
                        snprintf(evname, len + 1, "%s", p);
 
                        match = 0;
-                       evlist__for_each(session->evlist, pos) {
+                       evlist__for_each_entry(session->evlist, pos) {
                                if (!strcmp(perf_evsel__name(pos), evname)) {
                                        match = 1;
                                        break;
@@ -1873,7 +1873,7 @@ static int process_stat_round_event(struct perf_tool *tool __maybe_unused,
        struct stat_round_event *round = &event->stat_round;
        struct perf_evsel *counter;
 
-       evlist__for_each(session->evlist, counter) {
+       evlist__for_each_entry(session->evlist, counter) {
                perf_stat_process_counter(&stat_config, counter);
                process_stat(counter, round->time);
        }
index dff63733dfb741b7e6f9811529d6c6fc9dc64fb7..c367a43525e6e77156fe9448d954d420fcd54191 100644 (file)
@@ -331,7 +331,7 @@ static void read_counters(bool close_counters)
 {
        struct perf_evsel *counter;
 
-       evlist__for_each(evsel_list, counter) {
+       evlist__for_each_entry(evsel_list, counter) {
                if (read_counter(counter))
                        pr_debug("failed to read counter %s\n", counter->name);
 
@@ -417,7 +417,7 @@ static int perf_stat_synthesize_config(bool is_pipe)
         * Synthesize other events stuff not carried within
         * attr event - unit, scale, name
         */
-       evlist__for_each(evsel_list, counter) {
+       evlist__for_each_entry(evsel_list, counter) {
                if (!counter->supported)
                        continue;
 
@@ -550,7 +550,7 @@ static int __run_perf_stat(int argc, const char **argv)
        if (group)
                perf_evlist__set_leader(evsel_list);
 
-       evlist__for_each(evsel_list, counter) {
+       evlist__for_each_entry(evsel_list, counter) {
 try_again:
                if (create_perf_stat_counter(counter) < 0) {
                        /*
@@ -1134,7 +1134,7 @@ static void aggr_update_shadow(void)
 
        for (s = 0; s < aggr_map->nr; s++) {
                id = aggr_map->map[s];
-               evlist__for_each(evsel_list, counter) {
+               evlist__for_each_entry(evsel_list, counter) {
                        val = 0;
                        for (cpu = 0; cpu < perf_evsel__nr_cpus(counter); cpu++) {
                                s2 = aggr_get_id(evsel_list->cpus, cpu);
@@ -1173,7 +1173,7 @@ static void print_aggr(char *prefix)
 
                id = aggr_map->map[s];
                first = true;
-               evlist__for_each(evsel_list, counter) {
+               evlist__for_each_entry(evsel_list, counter) {
                        val = ena = run = 0;
                        nr = 0;
                        for (cpu = 0; cpu < perf_evsel__nr_cpus(counter); cpu++) {
@@ -1292,7 +1292,7 @@ static void print_no_aggr_metric(char *prefix)
 
                if (prefix)
                        fputs(prefix, stat_config.output);
-               evlist__for_each(evsel_list, counter) {
+               evlist__for_each_entry(evsel_list, counter) {
                        if (first) {
                                aggr_printout(counter, cpu, 0);
                                first = false;
@@ -1346,7 +1346,7 @@ static void print_metric_headers(const char *prefix, bool no_indent)
        }
 
        /* Print metrics headers only */
-       evlist__for_each(evsel_list, counter) {
+       evlist__for_each_entry(evsel_list, counter) {
                os.evsel = counter;
                out.ctx = &os;
                out.print_metric = print_metric_header;
@@ -1482,11 +1482,11 @@ static void print_counters(struct timespec *ts, int argc, const char **argv)
                print_aggr(prefix);
                break;
        case AGGR_THREAD:
-               evlist__for_each(evsel_list, counter)
+               evlist__for_each_entry(evsel_list, counter)
                        print_aggr_thread(counter, prefix);
                break;
        case AGGR_GLOBAL:
-               evlist__for_each(evsel_list, counter)
+               evlist__for_each_entry(evsel_list, counter)
                        print_counter_aggr(counter, prefix);
                if (metric_only)
                        fputc('\n', stat_config.output);
@@ -1495,7 +1495,7 @@ static void print_counters(struct timespec *ts, int argc, const char **argv)
                if (metric_only)
                        print_no_aggr_metric(prefix);
                else {
-                       evlist__for_each(evsel_list, counter)
+                       evlist__for_each_entry(evsel_list, counter)
                                print_counter(counter, prefix);
                }
                break;
@@ -2149,7 +2149,7 @@ static int process_stat_round_event(struct perf_tool *tool __maybe_unused,
        const char **argv = session->header.env.cmdline_argv;
        int argc = session->header.env.nr_cmdline;
 
-       evlist__for_each(evsel_list, counter)
+       evlist__for_each_entry(evsel_list, counter)
                perf_stat_process_counter(&stat_config, counter);
 
        if (stat_round->type == PERF_STAT_ROUND_TYPE__FINAL)
index ec4cba61f3a27910d5d85e6f63b7ae32b2385e50..07fc7921980c053829ec9270e339892714058cfa 100644 (file)
@@ -479,7 +479,7 @@ static bool perf_top__handle_keypress(struct perf_top *top, int c)
 
                                fprintf(stderr, "\nAvailable events:");
 
-                               evlist__for_each(top->evlist, top->sym_evsel)
+                               evlist__for_each_entry(top->evlist, top->sym_evsel)
                                        fprintf(stderr, "\n\t%d %s", top->sym_evsel->idx, perf_evsel__name(top->sym_evsel));
 
                                prompt_integer(&counter, "Enter details event counter");
@@ -490,7 +490,7 @@ static bool perf_top__handle_keypress(struct perf_top *top, int c)
                                        sleep(1);
                                        break;
                                }
-                               evlist__for_each(top->evlist, top->sym_evsel)
+                               evlist__for_each_entry(top->evlist, top->sym_evsel)
                                        if (top->sym_evsel->idx == counter)
                                                break;
                        } else
@@ -583,7 +583,7 @@ static void *display_thread_tui(void *arg)
         * Zooming in/out UIDs. For now juse use whatever the user passed
         * via --uid.
         */
-       evlist__for_each(top->evlist, pos) {
+       evlist__for_each_entry(top->evlist, pos) {
                struct hists *hists = evsel__hists(pos);
                hists->uid_filter_str = top->record_opts.target.uid_str;
        }
@@ -888,7 +888,7 @@ static int perf_top__start_counters(struct perf_top *top)
 
        perf_evlist__config(evlist, opts, &callchain_param);
 
-       evlist__for_each(evlist, counter) {
+       evlist__for_each_entry(evlist, counter) {
 try_again:
                if (perf_evsel__open(counter, top->evlist->cpus,
                                     top->evlist->threads) < 0) {
index 5c50fe70d6b37379bd8b89b05d9df7899b9fc27d..1ecadfc611969ec1b61f4a355949844f44a77110 100644 (file)
@@ -2483,7 +2483,7 @@ static int trace__replay(struct trace *trace)
                goto out;
        }
 
-       evlist__for_each(session->evlist, evsel) {
+       evlist__for_each_entry(session->evlist, evsel) {
                if (evsel->attr.type == PERF_TYPE_SOFTWARE &&
                    (evsel->attr.config == PERF_COUNT_SW_PAGE_FAULTS_MAJ ||
                     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)
 {
        struct perf_evsel *evsel;
 
-       evlist__for_each(evlist, evsel)
+       evlist__for_each_entry(evlist, evsel)
                evsel->handler = handler;
 }
 
index d9ba991a9a30f892201e7d1cd2dc10be612198a6..e70313fac5a55225cbc089fd51f4c5daff2278ea 100644 (file)
@@ -118,7 +118,7 @@ int test__backward_ring_buffer(int subtest __maybe_unused)
        perf_evlist__config(evlist, &opts, NULL);
 
        /* Set backward bit, ring buffer should be writing from end */
-       evlist__for_each(evlist, evsel)
+       evlist__for_each_entry(evlist, evsel)
                evsel->attr.write_backward = 1;
 
        err = perf_evlist__open(evlist);
index 2de4a4f2c3ed3df38e85e69f19dc68fc14f66f3d..60926a1f6fd7fcf128924759545d7f6620128406 100644 (file)
@@ -80,7 +80,7 @@ static int __perf_evsel__name_array_test(const char *names[], int nr_names)
        }
 
        err = 0;
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                if (strcmp(perf_evsel__name(evsel), names[evsel->idx])) {
                        --err;
                        pr_debug("%s != %s\n", perf_evsel__name(evsel), names[evsel->idx]);
index e846f8c420136426fae224ce658946923b126f83..62efb14f3a5a7eabb0dfbc7bae31e90276ef9c54 100644 (file)
@@ -56,7 +56,7 @@ static int add_hist_entries(struct perf_evlist *evlist,
         * (perf [perf] main) will be collapsed to an existing entry
         * so total 9 entries will be in the tree.
         */
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                for (i = 0; i < ARRAY_SIZE(fake_samples); i++) {
                        struct hist_entry_iter iter = {
                                .evsel = evsel,
@@ -136,7 +136,7 @@ int test__hists_filter(int subtest __maybe_unused)
        if (err < 0)
                goto out;
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                struct hists *hists = evsel__hists(evsel);
 
                hists__collapse_resort(hists, NULL);
index 6f96ca4d4fc0a3d97ae4057429d7423e15d0f8d1..eddc7407ff8a9341a2e19e859bf1cab8781e8eda 100644 (file)
@@ -72,7 +72,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.
         */
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                struct hists *hists = evsel__hists(evsel);
 
                for (k = 0; k < ARRAY_SIZE(fake_common_samples); k++) {
@@ -301,7 +301,7 @@ int test__hists_link(int subtest __maybe_unused)
        if (err < 0)
                goto out;
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                hists = evsel__hists(evsel);
                hists__collapse_resort(hists, NULL);
 
index 359e98fcd94cd1be00dcc085fa18d058c8fb1986..aea33f5589c5b4ddc307a8746205145ae5994cea 100644 (file)
@@ -126,7 +126,7 @@ int test__basic_mmap(int subtest __maybe_unused)
        }
 
        err = 0;
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                if (nr_events[evsel->idx] != expected_nr_events[evsel->idx]) {
                        pr_debug("expected %d %s events, got %d\n",
                                 expected_nr_events[evsel->idx],
index b2a2c74136a58fab17d716593defa555aae0e83d..20c2e641c42265b1606d751c64ffec6bdf2e5d3c 100644 (file)
@@ -32,7 +32,7 @@ static int test__checkevent_tracepoint_multi(struct perf_evlist *evlist)
        TEST_ASSERT_VAL("wrong number of entries", evlist->nr_entries > 1);
        TEST_ASSERT_VAL("wrong number of groups", 0 == evlist->nr_groups);
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                TEST_ASSERT_VAL("wrong type",
                        PERF_TYPE_TRACEPOINT == evsel->attr.type);
                TEST_ASSERT_VAL("wrong sample_type",
@@ -207,7 +207,7 @@ test__checkevent_tracepoint_multi_modifier(struct perf_evlist *evlist)
 
        TEST_ASSERT_VAL("wrong number of entries", evlist->nr_entries > 1);
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                TEST_ASSERT_VAL("wrong exclude_user",
                                !evsel->attr.exclude_user);
                TEST_ASSERT_VAL("wrong exclude_kernel",
index 39a689bf7574e13010a59bf8dae7b748aa0b63c8..7ddbe267d0acbae827010e6408bde3faf575003e 100644 (file)
@@ -432,7 +432,7 @@ int test__switch_tracking(int subtest __maybe_unused)
        }
 
        /* Check non-tracking events are not tracking */
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                if (evsel != tracking_evsel) {
                        if (evsel->attr.mmap || evsel->attr.comm) {
                                pr_debug("Non-tracking event is tracking\n");
index 9d744358ca78e10dcaf2145a040d9a330cc7dfdc..e08b8f7b6d3f34fb4e88bd0c3bd37d06e858f30b 100644 (file)
@@ -3199,7 +3199,7 @@ static int __perf_evlist__tui_browse_hists(struct perf_evlist *evlist,
 
        ui_helpline__push("Press ESC to exit");
 
-       evlist__for_each(evlist, pos) {
+       evlist__for_each_entry(evlist, pos) {
                const char *ev_name = perf_evsel__name(pos);
                size_t line_len = strlen(ev_name) + 7;
 
@@ -3230,7 +3230,7 @@ single_entry:
                struct perf_evsel *pos;
 
                nr_entries = 0;
-               evlist__for_each(evlist, pos) {
+               evlist__for_each_entry(evlist, pos) {
                        if (perf_evsel__is_group_leader(pos))
                                nr_entries++;
                }
index e5c1325b03407af8008f51c1d891dd60c452f06d..c5f3677f66797bdbf34c171cfc398009a15b60cd 100644 (file)
@@ -627,7 +627,7 @@ int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist,
 
        gtk_container_add(GTK_CONTAINER(window), vbox);
 
-       evlist__for_each(evlist, pos) {
+       evlist__for_each_entry(evlist, pos) {
                struct hists *hists = evsel__hists(pos);
                const char *evname = perf_evsel__name(pos);
                GtkWidget *scrolled_window;
index 6940745aa77c65a25f5beb07242093192fcbee7f..4274969ddc89471e962dcf0097314b73963c65be 100644 (file)
@@ -766,7 +766,7 @@ int perf_hpp__setup_hists_formats(struct perf_hpp_list *list,
        if (!symbol_conf.report_hierarchy)
                return 0;
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                hists = evsel__hists(evsel);
 
                perf_hpp_list__for_each_sort_list(list, fmt) {
index 90aa1b46b2e5be06578befd275b6104bc9522dd3..8fdee24725a7f59febb37eeb85b3a22d8dd1f82b 100644 (file)
@@ -81,7 +81,7 @@ static int add_cgroup(struct perf_evlist *evlist, char *str)
        /*
         * check if cgrp is already defined, if so we reuse it
         */
-       evlist__for_each(evlist, counter) {
+       evlist__for_each_entry(evlist, counter) {
                cgrp = counter->cgrp;
                if (!cgrp)
                        continue;
@@ -110,7 +110,7 @@ static int add_cgroup(struct perf_evlist *evlist, char *str)
         * if add cgroup N, then need to find event N
         */
        n = 0;
-       evlist__for_each(evlist, counter) {
+       evlist__for_each_entry(evlist, counter) {
                if (n == nr_cgroups)
                        goto found;
                n++;
index 9f53020c32697e0aeb52de6ab8fa8d24a0ac24fa..4b59879391c077cda0e4f794d6a0ff381424eb28 100644 (file)
@@ -997,7 +997,7 @@ static int setup_events(struct ctf_writer *cw, struct perf_session *session)
        struct perf_evsel *evsel;
        int ret;
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                ret = add_event(cw, evsel);
                if (ret)
                        return ret;
@@ -1010,7 +1010,7 @@ static void cleanup_events(struct perf_session *session)
        struct perf_evlist *evlist = session->evlist;
        struct perf_evsel *evsel;
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                struct evsel_priv *priv;
 
                priv = evsel->priv;
index fcb8f1ff7806df347424b6f59d288d3df23859cb..113507716044a31a697214e6dce35b46452911fa 100644 (file)
@@ -100,7 +100,7 @@ static void perf_evlist__update_id_pos(struct perf_evlist *evlist)
 {
        struct perf_evsel *evsel;
 
-       evlist__for_each(evlist, evsel)
+       evlist__for_each_entry(evlist, evsel)
                perf_evsel__calc_id_pos(evsel);
 
        perf_evlist__set_id_pos(evlist);
@@ -110,7 +110,7 @@ static void perf_evlist__purge(struct perf_evlist *evlist)
 {
        struct perf_evsel *pos, *n;
 
-       evlist__for_each_safe(evlist, n, pos) {
+       evlist__for_each_entry_safe(evlist, n, pos) {
                list_del_init(&pos->node);
                pos->evlist = NULL;
                perf_evsel__delete(pos);
@@ -164,7 +164,7 @@ static void perf_evlist__propagate_maps(struct perf_evlist *evlist)
 {
        struct perf_evsel *evsel;
 
-       evlist__for_each(evlist, evsel)
+       evlist__for_each_entry(evlist, evsel)
                __perf_evlist__propagate_maps(evlist, evsel);
 }
 
@@ -193,7 +193,7 @@ void perf_evlist__splice_list_tail(struct perf_evlist *evlist,
 {
        struct perf_evsel *evsel, *temp;
 
-       __evlist__for_each_safe(list, temp, evsel) {
+       __evlist__for_each_entry_safe(list, temp, evsel) {
                list_del_init(&evsel->node);
                perf_evlist__add(evlist, evsel);
        }
@@ -208,7 +208,7 @@ void __perf_evlist__set_leader(struct list_head *list)
 
        leader->nr_members = evsel->idx - leader->idx + 1;
 
-       __evlist__for_each(list, evsel) {
+       __evlist__for_each_entry(list, evsel) {
                evsel->leader = leader;
        }
 }
@@ -299,7 +299,7 @@ static int perf_evlist__add_attrs(struct perf_evlist *evlist,
        return 0;
 
 out_delete_partial_list:
-       __evlist__for_each_safe(&head, n, evsel)
+       __evlist__for_each_entry_safe(&head, n, evsel)
                perf_evsel__delete(evsel);
        return -1;
 }
@@ -320,7 +320,7 @@ perf_evlist__find_tracepoint_by_id(struct perf_evlist *evlist, int id)
 {
        struct perf_evsel *evsel;
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                if (evsel->attr.type   == PERF_TYPE_TRACEPOINT &&
                    (int)evsel->attr.config == id)
                        return evsel;
@@ -335,7 +335,7 @@ perf_evlist__find_tracepoint_by_name(struct perf_evlist *evlist,
 {
        struct perf_evsel *evsel;
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                if ((evsel->attr.type == PERF_TYPE_TRACEPOINT) &&
                    (strcmp(evsel->name, name) == 0))
                        return evsel;
@@ -370,7 +370,7 @@ void perf_evlist__disable(struct perf_evlist *evlist)
 {
        struct perf_evsel *pos;
 
-       evlist__for_each(evlist, pos) {
+       evlist__for_each_entry(evlist, pos) {
                if (!perf_evsel__is_group_leader(pos) || !pos->fd)
                        continue;
                perf_evsel__disable(pos);
@@ -383,7 +383,7 @@ void perf_evlist__enable(struct perf_evlist *evlist)
 {
        struct perf_evsel *pos;
 
-       evlist__for_each(evlist, pos) {
+       evlist__for_each_entry(evlist, pos) {
                if (!perf_evsel__is_group_leader(pos) || !pos->fd)
                        continue;
                perf_evsel__enable(pos);
@@ -451,7 +451,7 @@ int perf_evlist__alloc_pollfd(struct perf_evlist *evlist)
        int nfds = 0;
        struct perf_evsel *evsel;
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                if (evsel->system_wide)
                        nfds += nr_cpus;
                else
@@ -1015,7 +1015,7 @@ static int perf_evlist__mmap_per_evsel(struct perf_evlist *evlist, int idx,
        struct perf_evsel *evsel;
        int revent;
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                int fd;
 
                if (evsel->overwrite != (evlist->overwrite && evlist->backward))
@@ -1262,7 +1262,7 @@ int perf_evlist__mmap_ex(struct perf_evlist *evlist, unsigned int pages,
        auxtrace_mmap_params__init(&mp.auxtrace_mp, evlist->mmap_len,
                                   auxtrace_pages, auxtrace_overwrite);
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                if ((evsel->attr.read_format & PERF_FORMAT_ID) &&
                    evsel->sample_id == NULL &&
                    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,
 {
        struct perf_evsel *evsel;
 
-       evlist__for_each(evlist, evsel)
+       evlist__for_each_entry(evlist, evsel)
                __perf_evsel__set_sample_bit(evsel, bit);
 }
 
@@ -1347,7 +1347,7 @@ void __perf_evlist__reset_sample_bit(struct perf_evlist *evlist,
 {
        struct perf_evsel *evsel;
 
-       evlist__for_each(evlist, evsel)
+       evlist__for_each_entry(evlist, evsel)
                __perf_evsel__reset_sample_bit(evsel, bit);
 }
 
@@ -1358,7 +1358,7 @@ int perf_evlist__apply_filters(struct perf_evlist *evlist, struct perf_evsel **e
        const int ncpus = cpu_map__nr(evlist->cpus),
                  nthreads = thread_map__nr(evlist->threads);
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                if (evsel->filter == NULL)
                        continue;
 
@@ -1381,7 +1381,7 @@ int perf_evlist__set_filter(struct perf_evlist *evlist, const char *filter)
        struct perf_evsel *evsel;
        int err = 0;
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                if (evsel->attr.type != PERF_TYPE_TRACEPOINT)
                        continue;
 
@@ -1435,7 +1435,7 @@ bool perf_evlist__valid_sample_type(struct perf_evlist *evlist)
        if (evlist->id_pos < 0 || evlist->is_pos < 0)
                return false;
 
-       evlist__for_each(evlist, pos) {
+       evlist__for_each_entry(evlist, pos) {
                if (pos->id_pos != evlist->id_pos ||
                    pos->is_pos != evlist->is_pos)
                        return false;
@@ -1451,7 +1451,7 @@ u64 __perf_evlist__combined_sample_type(struct perf_evlist *evlist)
        if (evlist->combined_sample_type)
                return evlist->combined_sample_type;
 
-       evlist__for_each(evlist, evsel)
+       evlist__for_each_entry(evlist, evsel)
                evlist->combined_sample_type |= evsel->attr.sample_type;
 
        return evlist->combined_sample_type;
@@ -1468,7 +1468,7 @@ u64 perf_evlist__combined_branch_type(struct perf_evlist *evlist)
        struct perf_evsel *evsel;
        u64 branch_type = 0;
 
-       evlist__for_each(evlist, evsel)
+       evlist__for_each_entry(evlist, evsel)
                branch_type |= evsel->attr.branch_sample_type;
        return branch_type;
 }
@@ -1479,7 +1479,7 @@ bool perf_evlist__valid_read_format(struct perf_evlist *evlist)
        u64 read_format = first->attr.read_format;
        u64 sample_type = first->attr.sample_type;
 
-       evlist__for_each(evlist, pos) {
+       evlist__for_each_entry(evlist, pos) {
                if (read_format != pos->attr.read_format)
                        return false;
        }
@@ -1536,7 +1536,7 @@ bool perf_evlist__valid_sample_id_all(struct perf_evlist *evlist)
 {
        struct perf_evsel *first = perf_evlist__first(evlist), *pos = first;
 
-       evlist__for_each_continue(evlist, pos) {
+       evlist__for_each_entry_continue(evlist, pos) {
                if (first->attr.sample_id_all != pos->attr.sample_id_all)
                        return false;
        }
@@ -1563,7 +1563,7 @@ void perf_evlist__close(struct perf_evlist *evlist)
        int nthreads = thread_map__nr(evlist->threads);
        int n;
 
-       evlist__for_each_reverse(evlist, evsel) {
+       evlist__for_each_entry_reverse(evlist, evsel) {
                n = evsel->cpus ? evsel->cpus->nr : ncpus;
                perf_evsel__close(evsel, n, nthreads);
        }
@@ -1617,7 +1617,7 @@ int perf_evlist__open(struct perf_evlist *evlist)
 
        perf_evlist__update_id_pos(evlist);
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                err = perf_evsel__open(evsel, evsel->cpus, evsel->threads);
                if (err < 0)
                        goto out_err;
@@ -1778,7 +1778,7 @@ size_t perf_evlist__fprintf(struct perf_evlist *evlist, FILE *fp)
        struct perf_evsel *evsel;
        size_t printed = 0;
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                printed += fprintf(fp, "%s%s", evsel->idx ? ", " : "",
                                   perf_evsel__name(evsel));
        }
@@ -1880,7 +1880,7 @@ void perf_evlist__to_front(struct perf_evlist *evlist,
        if (move_evsel == perf_evlist__first(evlist))
                return;
 
-       evlist__for_each_safe(evlist, n, evsel) {
+       evlist__for_each_entry_safe(evlist, n, evsel) {
                if (evsel->leader == move_evsel->leader)
                        list_move_tail(&evsel->node, &move);
        }
@@ -1896,7 +1896,7 @@ void perf_evlist__set_tracking_event(struct perf_evlist *evlist,
        if (tracking_evsel->tracking)
                return;
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                if (evsel != tracking_evsel)
                        evsel->tracking = false;
        }
@@ -1910,7 +1910,7 @@ perf_evlist__find_evsel_by_str(struct perf_evlist *evlist,
 {
        struct perf_evsel *evsel;
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                if (!evsel->name)
                        continue;
                if (strcmp(str, evsel->name) == 0)
index 68cb1361c97c65c3745f892b47a9f5849a1b8b4d..872912b392c9ff96d74b7400bb2d7f8ecdeb747c 100644 (file)
@@ -251,70 +251,70 @@ void perf_evlist__to_front(struct perf_evlist *evlist,
                           struct perf_evsel *move_evsel);
 
 /**
- * __evlist__for_each - iterate thru all the evsels
+ * __evlist__for_each_entry - iterate thru all the evsels
  * @list: list_head instance to iterate
  * @evsel: struct evsel iterator
  */
-#define __evlist__for_each(list, evsel) \
+#define __evlist__for_each_entry(list, evsel) \
         list_for_each_entry(evsel, list, node)
 
 /**
- * evlist__for_each - iterate thru all the evsels
+ * evlist__for_each_entry - iterate thru all the evsels
  * @evlist: evlist instance to iterate
  * @evsel: struct evsel iterator
  */
-#define evlist__for_each(evlist, evsel) \
-       __evlist__for_each(&(evlist)->entries, evsel)
+#define evlist__for_each_entry(evlist, evsel) \
+       __evlist__for_each_entry(&(evlist)->entries, evsel)
 
 /**
- * __evlist__for_each_continue - continue iteration thru all the evsels
+ * __evlist__for_each_entry_continue - continue iteration thru all the evsels
  * @list: list_head instance to iterate
  * @evsel: struct evsel iterator
  */
-#define __evlist__for_each_continue(list, evsel) \
+#define __evlist__for_each_entry_continue(list, evsel) \
         list_for_each_entry_continue(evsel, list, node)
 
 /**
- * evlist__for_each_continue - continue iteration thru all the evsels
+ * evlist__for_each_entry_continue - continue iteration thru all the evsels
  * @evlist: evlist instance to iterate
  * @evsel: struct evsel iterator
  */
-#define evlist__for_each_continue(evlist, evsel) \
-       __evlist__for_each_continue(&(evlist)->entries, evsel)
+#define evlist__for_each_entry_continue(evlist, evsel) \
+       __evlist__for_each_entry_continue(&(evlist)->entries, evsel)
 
 /**
- * __evlist__for_each_reverse - iterate thru all the evsels in reverse order
+ * __evlist__for_each_entry_reverse - iterate thru all the evsels in reverse order
  * @list: list_head instance to iterate
  * @evsel: struct evsel iterator
  */
-#define __evlist__for_each_reverse(list, evsel) \
+#define __evlist__for_each_entry_reverse(list, evsel) \
         list_for_each_entry_reverse(evsel, list, node)
 
 /**
- * evlist__for_each_reverse - iterate thru all the evsels in reverse order
+ * evlist__for_each_entry_reverse - iterate thru all the evsels in reverse order
  * @evlist: evlist instance to iterate
  * @evsel: struct evsel iterator
  */
-#define evlist__for_each_reverse(evlist, evsel) \
-       __evlist__for_each_reverse(&(evlist)->entries, evsel)
+#define evlist__for_each_entry_reverse(evlist, evsel) \
+       __evlist__for_each_entry_reverse(&(evlist)->entries, evsel)
 
 /**
- * __evlist__for_each_safe - safely iterate thru all the evsels
+ * __evlist__for_each_entry_safe - safely iterate thru all the evsels
  * @list: list_head instance to iterate
  * @tmp: struct evsel temp iterator
  * @evsel: struct evsel iterator
  */
-#define __evlist__for_each_safe(list, tmp, evsel) \
+#define __evlist__for_each_entry_safe(list, tmp, evsel) \
         list_for_each_entry_safe(evsel, tmp, list, node)
 
 /**
- * evlist__for_each_safe - safely iterate thru all the evsels
+ * evlist__for_each_entry_safe - safely iterate thru all the evsels
  * @evlist: evlist instance to iterate
  * @evsel: struct evsel iterator
  * @tmp: struct evsel temp iterator
  */
-#define evlist__for_each_safe(evlist, tmp, evsel) \
-       __evlist__for_each_safe(&(evlist)->entries, tmp, evsel)
+#define evlist__for_each_entry_safe(evlist, tmp, evsel) \
+       __evlist__for_each_entry_safe(&(evlist)->entries, tmp, evsel)
 
 void perf_evlist__set_tracking_event(struct perf_evlist *evlist,
                                     struct perf_evsel *tracking_evsel);
index 08852dde1378696d24c47c0b34bded96b9d862e8..c5cd2698281f1c71cea2dbab3e311226f5cc1c9c 100644 (file)
@@ -336,7 +336,7 @@ static int write_event_desc(int fd, struct perf_header *h __maybe_unused,
        if (ret < 0)
                return ret;
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                ret = do_write(fd, &evsel->attr, sz);
                if (ret < 0)
                        return ret;
@@ -801,7 +801,7 @@ static int write_group_desc(int fd, struct perf_header *h __maybe_unused,
        if (ret < 0)
                return ret;
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                if (perf_evsel__is_group_leader(evsel) &&
                    evsel->nr_members > 1) {
                        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,
 
        session = container_of(ph, struct perf_session, header);
 
-       evlist__for_each(session->evlist, evsel) {
+       evlist__for_each_entry(session->evlist, evsel) {
                if (perf_evsel__is_group_leader(evsel) &&
                    evsel->nr_members > 1) {
                        fprintf(fp, "# group: %s{%s", evsel->group_name ?: "",
@@ -1703,7 +1703,7 @@ perf_evlist__find_by_index(struct perf_evlist *evlist, int idx)
 {
        struct perf_evsel *evsel;
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                if (evsel->idx == idx)
                        return evsel;
        }
@@ -2075,7 +2075,7 @@ static int process_group_desc(struct perf_file_section *section __maybe_unused,
        session->evlist->nr_groups = nr_groups;
 
        i = nr = 0;
-       evlist__for_each(session->evlist, evsel) {
+       evlist__for_each_entry(session->evlist, evsel) {
                if (evsel->idx == (int) desc[i].leader_idx) {
                        evsel->leader = evsel;
                        /* {anon_group} is a dummy name */
@@ -2383,7 +2383,7 @@ int perf_session__write_header(struct perf_session *session,
 
        lseek(fd, sizeof(f_header), SEEK_SET);
 
-       evlist__for_each(session->evlist, evsel) {
+       evlist__for_each_entry(session->evlist, evsel) {
                evsel->id_offset = lseek(fd, 0, SEEK_CUR);
                err = do_write(fd, evsel->id, evsel->ids * sizeof(u64));
                if (err < 0) {
@@ -2394,7 +2394,7 @@ int perf_session__write_header(struct perf_session *session,
 
        attr_offset = lseek(fd, 0, SEEK_CUR);
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                f_attr = (struct perf_file_attr){
                        .attr = evsel->attr,
                        .ids  = {
@@ -2828,7 +2828,7 @@ static int perf_evlist__prepare_tracepoint_events(struct perf_evlist *evlist,
 {
        struct perf_evsel *pos;
 
-       evlist__for_each(evlist, pos) {
+       evlist__for_each_entry(evlist, pos) {
                if (pos->attr.type == PERF_TYPE_TRACEPOINT &&
                    perf_evsel__prepare_tracepoint_event(pos, pevent))
                        return -1;
@@ -3127,7 +3127,7 @@ int perf_event__synthesize_attrs(struct perf_tool *tool,
        struct perf_evsel *evsel;
        int err = 0;
 
-       evlist__for_each(session->evlist, evsel) {
+       evlist__for_each_entry(session->evlist, evsel) {
                err = perf_event__synthesize_attr(tool, &evsel->attr, evsel->ids,
                                                  evsel->id, process);
                if (err) {
index d9826cce68013e1c7302239885cfd9e83bd82320..e1fcc8d7c01a838934fd838df385af1d39ffa943 100644 (file)
@@ -2199,7 +2199,7 @@ size_t perf_evlist__fprintf_nr_events(struct perf_evlist *evlist, FILE *fp)
        struct perf_evsel *pos;
        size_t ret = 0;
 
-       evlist__for_each(evlist, pos) {
+       evlist__for_each_entry(evlist, pos) {
                ret += fprintf(fp, "%s stats:\n", perf_evsel__name(pos));
                ret += events_stats__fprintf(&evsel__hists(pos)->stats, fp);
        }
index 9df99608556332289b499622f11a5a402e6b875a..ecec73f6fe5a9623662c735219f0755a47e0cb7a 100644 (file)
@@ -777,7 +777,7 @@ static int intel_bts_synth_events(struct intel_bts *bts,
        u64 id;
        int err;
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                if (evsel->attr.type == bts->pmu_type && evsel->ids) {
                        found = true;
                        break;
index a2fe3a2194cc19180e9b11709fda4013985ade4a..dc243b19197b10f912008ad333788ee1edeb2699 100644 (file)
@@ -557,7 +557,7 @@ static bool intel_pt_exclude_kernel(struct intel_pt *pt)
 {
        struct perf_evsel *evsel;
 
-       evlist__for_each(pt->session->evlist, evsel) {
+       evlist__for_each_entry(pt->session->evlist, evsel) {
                if (intel_pt_get_config(pt, &evsel->attr, NULL) &&
                    !evsel->attr.exclude_kernel)
                        return false;
@@ -573,7 +573,7 @@ static bool intel_pt_return_compression(struct intel_pt *pt)
        if (!pt->noretcomp_bit)
                return true;
 
-       evlist__for_each(pt->session->evlist, evsel) {
+       evlist__for_each_entry(pt->session->evlist, evsel) {
                if (intel_pt_get_config(pt, &evsel->attr, &config) &&
                    (config & pt->noretcomp_bit))
                        return false;
@@ -593,7 +593,7 @@ static unsigned int intel_pt_mtc_period(struct intel_pt *pt)
        for (shift = 0, config = pt->mtc_freq_bits; !(config & 1); shift++)
                config >>= 1;
 
-       evlist__for_each(pt->session->evlist, evsel) {
+       evlist__for_each_entry(pt->session->evlist, evsel) {
                if (intel_pt_get_config(pt, &evsel->attr, &config))
                        return (config & pt->mtc_freq_bits) >> shift;
        }
@@ -609,7 +609,7 @@ static bool intel_pt_timeless_decoding(struct intel_pt *pt)
        if (!pt->tsc_bit || !pt->cap_user_time_zero)
                return true;
 
-       evlist__for_each(pt->session->evlist, evsel) {
+       evlist__for_each_entry(pt->session->evlist, evsel) {
                if (!(evsel->attr.sample_type & PERF_SAMPLE_TIME))
                        return true;
                if (intel_pt_get_config(pt, &evsel->attr, &config)) {
@@ -626,7 +626,7 @@ static bool intel_pt_tracing_kernel(struct intel_pt *pt)
 {
        struct perf_evsel *evsel;
 
-       evlist__for_each(pt->session->evlist, evsel) {
+       evlist__for_each_entry(pt->session->evlist, evsel) {
                if (intel_pt_get_config(pt, &evsel->attr, NULL) &&
                    !evsel->attr.exclude_kernel)
                        return true;
@@ -643,7 +643,7 @@ static bool intel_pt_have_tsc(struct intel_pt *pt)
        if (!pt->tsc_bit)
                return false;
 
-       evlist__for_each(pt->session->evlist, evsel) {
+       evlist__for_each_entry(pt->session->evlist, evsel) {
                if (intel_pt_get_config(pt, &evsel->attr, &config)) {
                        if (config & pt->tsc_bit)
                                have_tsc = true;
@@ -1851,7 +1851,7 @@ static int intel_pt_synth_events(struct intel_pt *pt,
        u64 id;
        int err;
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                if (evsel->attr.type == pt->pmu_type && evsel->ids) {
                        found = true;
                        break;
@@ -1931,7 +1931,7 @@ static int intel_pt_synth_events(struct intel_pt *pt,
                pt->sample_transactions = true;
                pt->transactions_id = id;
                id += 1;
-               evlist__for_each(evlist, evsel) {
+               evlist__for_each_entry(evlist, evsel) {
                        if (evsel->id && evsel->id[0] == pt->transactions_id) {
                                if (evsel->name)
                                        zfree(&evsel->name);
@@ -1969,7 +1969,7 @@ static struct perf_evsel *intel_pt_find_sched_switch(struct perf_evlist *evlist)
 {
        struct perf_evsel *evsel;
 
-       evlist__for_each_reverse(evlist, evsel) {
+       evlist__for_each_entry_reverse(evlist, evsel) {
                const char *name = perf_evsel__name(evsel);
 
                if (!strcmp(name, "sched:sched_switch"))
@@ -1983,7 +1983,7 @@ static bool intel_pt_find_switch(struct perf_evlist *evlist)
 {
        struct perf_evsel *evsel;
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                if (evsel->attr.context_switch)
                        return true;
        }
index 86afe9618bb0d917306ff3912203f81b6fee40b4..9f3305f6b6d5871ebde2c27f4ca1b2ac59953340 100644 (file)
@@ -108,7 +108,7 @@ jit_validate_events(struct perf_session *session)
        /*
         * check that all events use CLOCK_MONOTONIC
         */
-       evlist__for_each(session->evlist, evsel) {
+       evlist__for_each_entry(session->evlist, evsel) {
                if (evsel->attr.use_clockid == 0 || evsel->attr.clockid != CLOCK_MONOTONIC)
                        return -1;
        }
index d15e335842b796b450a32fae970c0dfab8510ef4..ebd87b773f562d29b3c02f1ca0dbbd57173d8df8 100644 (file)
@@ -1396,7 +1396,7 @@ int parse_events__modifier_event(struct list_head *list, char *str, bool add)
        if (!add && get_event_modifier(&mod, str, NULL))
                return -EINVAL;
 
-       __evlist__for_each(list, evsel) {
+       __evlist__for_each_entry(list, evsel) {
                if (add && get_event_modifier(&mod, str, evsel))
                        return -EINVAL;
 
@@ -1422,7 +1422,7 @@ int parse_events_name(struct list_head *list, char *name)
 {
        struct perf_evsel *evsel;
 
-       __evlist__for_each(list, evsel) {
+       __evlist__for_each_entry(list, evsel) {
                if (!evsel->name)
                        evsel->name = strdup(name);
        }
index 98f127abfa42a2d9b8d06b24b6c17090781c87fb..65c6c73d28fe4094fac7a0df5a9773c7f3cab939 100644 (file)
@@ -957,7 +957,7 @@ static PyObject *pyrf_evlist__item(PyObject *obj, Py_ssize_t i)
        if (i >= pevlist->evlist.nr_entries)
                return NULL;
 
-       evlist__for_each(&pevlist->evlist, pos) {
+       evlist__for_each_entry(&pevlist->evlist, pos) {
                if (i-- == 0)
                        break;
        }
index 481792c7484bd7109be072b6ea22f3fb8cf13089..98bf584853ea28e0fd9ab3828aa1e83f9d4010e5 100644 (file)
@@ -148,7 +148,7 @@ void perf_evlist__config(struct perf_evlist *evlist, struct record_opts *opts,
 
        use_comm_exec = perf_can_comm_exec();
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                perf_evsel__config(evsel, opts, callchain);
                if (evsel->tracking && use_comm_exec)
                        evsel->attr.comm_exec = 1;
@@ -161,18 +161,18 @@ void perf_evlist__config(struct perf_evlist *evlist, struct record_opts *opts,
                 * match the id.
                 */
                use_sample_identifier = perf_can_sample_identifier();
-               evlist__for_each(evlist, evsel)
+               evlist__for_each_entry(evlist, evsel)
                        perf_evsel__set_sample_id(evsel, use_sample_identifier);
        } else if (evlist->nr_entries > 1) {
                struct perf_evsel *first = perf_evlist__first(evlist);
 
-               evlist__for_each(evlist, evsel) {
+               evlist__for_each_entry(evlist, evsel) {
                        if (evsel->attr.sample_type == first->attr.sample_type)
                                continue;
                        use_sample_identifier = perf_can_sample_identifier();
                        break;
                }
-               evlist__for_each(evlist, evsel)
+               evlist__for_each_entry(evlist, evsel)
                        perf_evsel__set_sample_id(evsel, use_sample_identifier);
        }
 
index 43be0c5a6a268a44a2b20b4bf82e87e1a12c7067..078d4962649420b341df7283b6a5f440d0da2a6b 100644 (file)
@@ -83,7 +83,7 @@ static bool perf_session__has_comm_exec(struct perf_session *session)
 {
        struct perf_evsel *evsel;
 
-       evlist__for_each(session->evlist, evsel) {
+       evlist__for_each_entry(session->evlist, evsel) {
                if (evsel->attr.comm_exec)
                        return true;
        }
@@ -1872,7 +1872,7 @@ bool perf_session__has_traces(struct perf_session *session, const char *msg)
 {
        struct perf_evsel *evsel;
 
-       evlist__for_each(session->evlist, evsel) {
+       evlist__for_each_entry(session->evlist, evsel) {
                if (evsel->attr.type == PERF_TYPE_TRACEPOINT)
                        return true;
        }
@@ -1954,7 +1954,7 @@ struct perf_evsel *perf_session__find_first_evtype(struct perf_session *session,
 {
        struct perf_evsel *pos;
 
-       evlist__for_each(session->evlist, pos) {
+       evlist__for_each_entry(session->evlist, pos) {
                if (pos->attr.type == type)
                        return pos;
        }
@@ -2109,7 +2109,7 @@ int perf_event__synthesize_id_index(struct perf_tool *tool,
        max_nr = (UINT16_MAX - sizeof(struct id_index_event)) /
                 sizeof(struct id_index_entry);
 
-       evlist__for_each(evlist, evsel)
+       evlist__for_each_entry(evlist, evsel)
                nr += evsel->ids;
 
        n = nr > max_nr ? max_nr : nr;
@@ -2122,7 +2122,7 @@ int perf_event__synthesize_id_index(struct perf_tool *tool,
        ev->id_index.header.size = sz;
        ev->id_index.nr = n;
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                u32 j;
 
                for (j = 0; j < evsel->ids; j++) {
index a764139af485f2f745e763cec5d30b47e76a4c95..5854b4660a49fe2b59f02a236bc398658f388b47 100644 (file)
@@ -2069,7 +2069,7 @@ static struct perf_evsel *find_evsel(struct perf_evlist *evlist, char *event_nam
        }
 
        full_name = !!strchr(event_name, ':');
-       evlist__for_each(evlist, pos) {
+       evlist__for_each_entry(evlist, pos) {
                /* case 2 */
                if (full_name && !strcmp(pos->name, event_name))
                        return pos;
@@ -2125,7 +2125,7 @@ static int add_all_dynamic_fields(struct perf_evlist *evlist, bool raw_trace,
        int ret;
        struct perf_evsel *evsel;
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                if (evsel->attr.type != PERF_TYPE_TRACEPOINT)
                        continue;
 
@@ -2143,7 +2143,7 @@ static int add_all_matching_fields(struct perf_evlist *evlist,
        struct perf_evsel *evsel;
        struct format_field *field;
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                if (evsel->attr.type != PERF_TYPE_TRACEPOINT)
                        continue;
 
@@ -2456,7 +2456,7 @@ static const char *get_default_sort_order(struct perf_evlist *evlist)
        if (evlist == NULL)
                goto out_no_evlist;
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                if (evsel->attr.type != PERF_TYPE_TRACEPOINT) {
                        use_trace = false;
                        break;
index c1ba255f2abea92b5082b1a14996c9bd0ecb4532..39345c2ddfc22edcfde844e5eb95b72930f4eeda 100644 (file)
@@ -162,7 +162,7 @@ int perf_evlist__alloc_stats(struct perf_evlist *evlist, bool alloc_raw)
 {
        struct perf_evsel *evsel;
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                if (perf_evsel__alloc_stats(evsel, alloc_raw))
                        goto out_free;
        }
@@ -178,7 +178,7 @@ void perf_evlist__free_stats(struct perf_evlist *evlist)
 {
        struct perf_evsel *evsel;
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                perf_evsel__free_stat_priv(evsel);
                perf_evsel__free_counts(evsel);
                perf_evsel__free_prev_raw_counts(evsel);
@@ -189,7 +189,7 @@ void perf_evlist__reset_stats(struct perf_evlist *evlist)
 {
        struct perf_evsel *evsel;
 
-       evlist__for_each(evlist, evsel) {
+       evlist__for_each_entry(evlist, evsel) {
                perf_evsel__reset_stat_priv(evsel);
                perf_evsel__reset_counts(evsel);
        }