Commit 515dbe48 authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo
Browse files

libperf: Add perf_evlist__first()/last() functions



Add perf_evlist__first()/last() functions to libperf, as internal
functions and rename perf's origins to evlist__first/last.

Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lore.kernel.org/lkml/20190913132355.21634-29-jolsa@kernel.org


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 70c20369
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -416,7 +416,7 @@ static int cs_etm_recording_options(struct auxtrace_record *itr,
		if (err)
			goto out;

		tracking_evsel = perf_evlist__last(evlist);
		tracking_evsel = evlist__last(evlist);
		perf_evlist__set_tracking_event(evlist, tracking_evsel);

		tracking_evsel->core.attr.freq = 0;
+1 −1
Original line number Diff line number Diff line
@@ -129,7 +129,7 @@ static int arm_spe_recording_options(struct auxtrace_record *itr,
	if (err)
		return err;

	tracking_evsel = perf_evlist__last(evlist);
	tracking_evsel = evlist__last(evlist);
	perf_evlist__set_tracking_event(evlist, tracking_evsel);

	tracking_evsel->core.attr.freq = 0;
+2 −2
Original line number Diff line number Diff line
@@ -62,9 +62,9 @@ int test__intel_cqm_count_nmi_context(struct test *test __maybe_unused, int subt
		goto out;
	}

	evsel = perf_evlist__first(evlist);
	evsel = evlist__first(evlist);
	if (!evsel) {
		pr_debug("perf_evlist__first failed\n");
		pr_debug("evlist__first failed\n");
		goto out;
	}

+1 −1
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@ int test__perf_time_to_tsc(struct test *test __maybe_unused, int subtest __maybe

	perf_evlist__config(evlist, &opts, NULL);

	evsel = perf_evlist__first(evlist);
	evsel = evlist__first(evlist);

	evsel->core.attr.comm = 1;
	evsel->core.attr.disabled = 1;
+1 −1
Original line number Diff line number Diff line
@@ -231,7 +231,7 @@ static int intel_bts_recording_options(struct auxtrace_record *itr,
		if (err)
			return err;

		tracking_evsel = perf_evlist__last(evlist);
		tracking_evsel = evlist__last(evlist);

		perf_evlist__set_tracking_event(evlist, tracking_evsel);

Loading