[PATCH v3 33/46] perf/x86/intel/cmt: use PERF_EV_CAP_READ_{,CPU_}PKG flags in Intel cmt
From: David Carrillo-Cisneros
Date: Sat Oct 29 2016 - 20:44:22 EST
Use new flags in CMT pmu.
Signed-off-by: David Carrillo-Cisneros <davidcc@xxxxxxxxxx>
---
arch/x86/events/intel/cmt.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/x86/events/intel/cmt.c b/arch/x86/events/intel/cmt.c
index 275d128..614b2f4 100644
--- a/arch/x86/events/intel/cmt.c
+++ b/arch/x86/events/intel/cmt.c
@@ -1733,6 +1733,15 @@ static int intel_cmt_event_init(struct perf_event *event)
INIT_LIST_HEAD(&event->hw.cmt_list);
+ /*
+ * Task events can be read in any CPU in any package. CPU events
+ * only in CPU's package. Both can read even if inactive.
+ */
+ if (event->cpu < 0)
+ event->event_caps |= PERF_EV_CAP_READ_ANY_PKG;
+ else
+ event->event_caps |= PERF_EV_CAP_READ_ANY_CPU_PKG;
+
mutex_lock(&cmt_mutex);
err = mon_group_setup_event(event);
--
2.8.0.rc3.226.g39d4020