aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephane Eranian <eranian@google.com>2015-12-03 15:03:10 -0500
committerIngo Molnar <mingo@kernel.org>2016-01-06 05:15:34 -0500
commit673d188ba5b1cef6f9a41a5a18b490b2831c3ea5 (patch)
tree2520f5c66655e61d25bbc01e73e1e9881e2b3795
parent1424a09a9e1839285e948d4ea9fdfca26c9a2086 (diff)
perf/x86: Enable cycles:pp for Intel Atom
This patch updates the PEBS support for Intel Atom to provide an alias for the cycles:pp event used by perf record/top by default nowadays. On Atom, only INST_RETIRED:ANY supports PEBS, so we use this event instead with a large cmask to count cycles. Given that Core2 has the same issue, we use the intel_pebs_aliases_core2() function for Atom as well. Signed-off-by: Stephane Eranian <eranian@google.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Vince Weaver <vincent.weaver@maine.edu> Cc: kan.liang@intel.com Link: http://lkml.kernel.org/r/1449172990-30183-3-git-send-email-eranian@google.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--arch/x86/kernel/cpu/perf_event_intel.c1
-rw-r--r--arch/x86/kernel/cpu/perf_event_intel_ds.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c
index 762c6023a97f..95980c0b9561 100644
--- a/arch/x86/kernel/cpu/perf_event_intel.c
+++ b/arch/x86/kernel/cpu/perf_event_intel.c
@@ -3370,6 +3370,7 @@ __init int intel_pmu_init(void)
3370 3370
3371 x86_pmu.event_constraints = intel_gen_event_constraints; 3371 x86_pmu.event_constraints = intel_gen_event_constraints;
3372 x86_pmu.pebs_constraints = intel_atom_pebs_event_constraints; 3372 x86_pmu.pebs_constraints = intel_atom_pebs_event_constraints;
3373 x86_pmu.pebs_aliases = intel_pebs_aliases_core2;
3373 pr_cont("Atom events, "); 3374 pr_cont("Atom events, ");
3374 break; 3375 break;
3375 3376
diff --git a/arch/x86/kernel/cpu/perf_event_intel_ds.c b/arch/x86/kernel/cpu/perf_event_intel_ds.c
index a7463ed0b40e..10602f0a438f 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_ds.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c
@@ -620,6 +620,8 @@ struct event_constraint intel_atom_pebs_event_constraints[] = {
620 INTEL_FLAGS_EVENT_CONSTRAINT(0xcb, 0x1), /* MEM_LOAD_RETIRED.* */ 620 INTEL_FLAGS_EVENT_CONSTRAINT(0xcb, 0x1), /* MEM_LOAD_RETIRED.* */
621 /* INST_RETIRED.ANY_P, inv=1, cmask=16 (cycles:p). */ 621 /* INST_RETIRED.ANY_P, inv=1, cmask=16 (cycles:p). */
622 INTEL_FLAGS_EVENT_CONSTRAINT(0x108000c0, 0x01), 622 INTEL_FLAGS_EVENT_CONSTRAINT(0x108000c0, 0x01),
623 /* Allow all events as PEBS with no flags */
624 INTEL_ALL_EVENT_CONSTRAINT(0, 0x1),
623 EVENT_CONSTRAINT_END 625 EVENT_CONSTRAINT_END
624}; 626};
625 627