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

libperf: Move 'id' from 'struct evsel' to 'struct perf_evsel'



Move the 'id' array from 'struct evsel' to libperf's 'struct perf_evsel'.

Committer note:

Fix the tools/perf/util/cs-etm.c build, i.e. aarch64's CoreSight.

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-25-jolsa@kernel.org


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 8cd36f3e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ struct perf_evsel {
	struct perf_thread_map	*threads;
	struct xyarray		*fd;
	struct xyarray		*sample_id;
	u64			*id;

	/* parse modifier helper */
	int			 nr_members;
+1 −1
Original line number Diff line number Diff line
@@ -1298,7 +1298,7 @@ static int cs_etm__synth_events(struct cs_etm_auxtrace *etm,
	attr.read_format = evsel->core.attr.read_format;

	/* create new id val to be a fixed offset from evsel id */
	id = evsel->id[0] + 1000000000;
	id = evsel->core.id[0] + 1000000000;

	if (!id)
		id = 1;
+1 −1
Original line number Diff line number Diff line
@@ -482,7 +482,7 @@ void perf_evlist__id_add(struct evlist *evlist, struct evsel *evsel,
			 int cpu, int thread, u64 id)
{
	perf_evlist__id_hash(evlist, evsel, cpu, thread, id);
	evsel->id[evsel->ids++] = id;
	evsel->core.id[evsel->ids++] = id;
}

int perf_evlist__id_add_fd(struct evlist *evlist,
+3 −3
Original line number Diff line number Diff line
@@ -1239,8 +1239,8 @@ int perf_evsel__alloc_id(struct evsel *evsel, int ncpus, int nthreads)
	if (evsel->core.sample_id == NULL)
		return -ENOMEM;

	evsel->id = zalloc(ncpus * nthreads * sizeof(u64));
	if (evsel->id == NULL) {
	evsel->core.id = zalloc(ncpus * nthreads * sizeof(u64));
	if (evsel->core.id == NULL) {
		xyarray__delete(evsel->core.sample_id);
		evsel->core.sample_id = NULL;
		return -ENOMEM;
@@ -1253,7 +1253,7 @@ static void perf_evsel__free_id(struct evsel *evsel)
{
	xyarray__delete(evsel->core.sample_id);
	evsel->core.sample_id = NULL;
	zfree(&evsel->id);
	zfree(&evsel->core.id);
	evsel->ids = 0;
}

+0 −1
Original line number Diff line number Diff line
@@ -116,7 +116,6 @@ struct evsel {
	struct perf_evsel	core;
	struct evlist	*evlist;
	char			*filter;
	u64			*id;
	struct perf_counts	*counts;
	struct perf_counts	*prev_raw_counts;
	int			idx;
Loading