Commit 47172912 authored by Ian Rogers's avatar Ian Rogers Committed by Arnaldo Carvalho de Melo
Browse files

perf evlist: Missing TPEBS close in evlist__close()



The libperf evsel close won't close TPEBS events properly.

Add a test to do this. The libperf close routine is used in
evlist__close() for affinity reasons.

Signed-off-by: default avatarIan Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Dapeng Mi <dapeng1.mi@linux.intel.com>
Cc: Dr. David Alan Gilbert <linux@treblig.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Falcon <thomas.falcon@intel.com>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Cc: Yang Li <yang.lee@linux.alibaba.com>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent ff854817
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1356,6 +1356,8 @@ void evlist__close(struct evlist *evlist)
		return;

	evlist__for_each_cpu(evlist_cpu_itr, evlist, &affinity) {
		if (evlist_cpu_itr.cpu_map_idx == 0 && evsel__is_retire_lat(evlist_cpu_itr.evsel))
			evsel__tpebs_close(evlist_cpu_itr.evsel);
		perf_evsel__close_cpu(&evlist_cpu_itr.evsel->core,
				      evlist_cpu_itr.cpu_map_idx);
	}