perf/x86: Use PMUEF_READ_CPU_PKG in uncore events
authorDavid Carrillo-Cisneros <davidcc@google.com>
Wed, 17 Aug 2016 20:55:07 +0000 (13:55 -0700)
committerIngo Molnar <mingo@kernel.org>
Thu, 18 Aug 2016 08:54:34 +0000 (10:54 +0200)
Add flag to Intel's uncore and RAPL.

Signed-off-by: David Carrillo-Cisneros <davidcc@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Stephane Eranian <eranian@google.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul Turner <pjt@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vegard Nossum <vegard.nossum@gmail.com>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Link: http://lkml.kernel.org/r/1471467307-61171-5-git-send-email-davidcc@google.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/events/intel/rapl.c
arch/x86/events/intel/uncore.c
arch/x86/events/intel/uncore_snb.c

index 28865938aadf267e42829c3393cc405b0bf0672e..62bebcca64cc110a7d7ae136491dcdd3747155bd 100644 (file)
@@ -357,6 +357,8 @@ static int rapl_pmu_event_init(struct perf_event *event)
        if (event->cpu < 0)
                return -EINVAL;
 
+       event->event_caps |= PERF_EV_CAP_READ_ACTIVE_PKG;
+
        /*
         * check event is known (determines counter)
         */
index 463dc7a5a6c3b1ad8aff48aa6507db85f857463c..7b3cc8be328253c743613d32cfe7e2e54a8a0bb6 100644 (file)
@@ -664,6 +664,8 @@ static int uncore_pmu_event_init(struct perf_event *event)
        event->cpu = box->cpu;
        event->pmu_private = box;
 
+       event->event_caps |= PERF_EV_CAP_READ_ACTIVE_PKG;
+
        event->hw.idx = -1;
        event->hw.last_tag = ~0ULL;
        event->hw.extra_reg.idx = EXTRA_REG_NONE;
index 9d35ec0cb8fc916ba3b4b63f5bdb1b6ebda5de55..5f845eef9a4d682a3598c13946dbdec9fb70adeb 100644 (file)
@@ -388,6 +388,8 @@ static int snb_uncore_imc_event_init(struct perf_event *event)
        event->cpu = box->cpu;
        event->pmu_private = box;
 
+       event->event_caps |= PERF_EV_CAP_READ_ACTIVE_PKG;
+
        event->hw.idx = -1;
        event->hw.last_tag = ~0ULL;
        event->hw.extra_reg.idx = EXTRA_REG_NONE;