[PATCH v3 21/46] perf/x86/intel/cmt: use newly introduced event_terminate

From: David Carrillo-Cisneros
Date: Sat Oct 29 2016 - 20:47:39 EST


The change from event_destroy to event_terminate allows to check
if the event is a event cgroup during event destuction, before
generic code clears event->cgrp.

Signed-off-by: David Carrillo-Cisneros <davidcc@xxxxxxxxxx>
---
arch/x86/events/intel/cmt.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/x86/events/intel/cmt.c b/arch/x86/events/intel/cmt.c
index a5b7d2d..f7da8cf 100644
--- a/arch/x86/events/intel/cmt.c
+++ b/arch/x86/events/intel/cmt.c
@@ -1349,7 +1349,7 @@ static int intel_cmt_event_add(struct perf_event *event, int mode)
return 0;
}

-static void intel_cmt_event_destroy(struct perf_event *event)
+static void intel_cmt_event_terminate(struct perf_event *event)
{
struct monr *monr;

@@ -1385,8 +1385,6 @@ static int intel_cmt_event_init(struct perf_event *event)
event->attr.sample_period) /* no sampling */
return -EINVAL;

- event->destroy = intel_cmt_event_destroy;
-
INIT_LIST_HEAD(&event->hw.cmt_list);

mutex_lock(&cmt_mutex);
@@ -1439,6 +1437,7 @@ static struct pmu intel_cmt_pmu = {
.attr_groups = intel_cmt_attr_groups,
.task_ctx_nr = perf_sw_context,
.event_init = intel_cmt_event_init,
+ .event_terminate = intel_cmt_event_terminate,
.add = intel_cmt_event_add,
.del = intel_cmt_event_stop,
.start = intel_cmt_event_start,
--
2.8.0.rc3.226.g39d4020