Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e5cadb93 authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo
Browse files

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: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 3bd03c95
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
+4 −4
Original line number Diff line number Diff line
@@ -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);
+5 −5
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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];

+3 −3
Original line number Diff line number Diff line
@@ -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;
Loading