* [PATCH V2 1/1] perf, x86: bug fix for cycles:p and cycles:pp on SLM
@ 2015-01-12 17:42 kan.liang
2015-01-16 8:42 ` [tip:perf/urgent] perf/x86/intel: Fix bug for "cycles:p" and " cycles:pp" " tip-bot for Kan Liang
0 siblings, 1 reply; 2+ messages in thread
From: kan.liang @ 2015-01-12 17:42 UTC (permalink / raw)
To: a.p.zijlstra; +Cc: linux-kernel, ak, Kan Liang
From: Kan Liang <kan.liang@intel.com>
cycles:p and cycles:pp do not work on SLM since
86a04461a99f ("perf/x86: Revamp PEBS event selection")
UOPS_RETIRED.ALL is not a PEBS capable event, so it should not be used
to count cycle number.
Actually SLM call intel_pebs_aliases_core2 which uses INST_RETIRED.ANY_P
counts the number of cycles. It's a PEBS capable event. But inv and
cmask must be set to count cycles.
Considering SLM allows all events as PEBS with no flags, here only
INST_RETIRED.ANY_P, inv=1, cmask=16 need to specially handled.
Signed-off-by: Kan Liang <kan.liang@intel.com>
---
Changes since V1
- Only handle INST_RETIRED.ANY_P, inv=1, cmask=16
arch/x86/kernel/cpu/perf_event_intel_ds.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/cpu/perf_event_intel_ds.c b/arch/x86/kernel/cpu/perf_event_intel_ds.c
index 3c895d4..0739833 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_ds.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c
@@ -568,8 +568,8 @@ struct event_constraint intel_atom_pebs_event_constraints[] = {
};
struct event_constraint intel_slm_pebs_event_constraints[] = {
- /* UOPS_RETIRED.ALL, inv=1, cmask=16 (cycles:p). */
- INTEL_FLAGS_EVENT_CONSTRAINT(0x108001c2, 0xf),
+ /* INST_RETIRED.ANY_P, inv=1, cmask=16 (cycles:p). */
+ INTEL_FLAGS_EVENT_CONSTRAINT(0x108000c0, 0x1),
/* Allow all events as PEBS with no flags */
INTEL_ALL_EVENT_CONSTRAINT(0, 0x1),
EVENT_CONSTRAINT_END
--
1.7.11.7
^ permalink raw reply [flat|nested] 2+ messages in thread
* [tip:perf/urgent] perf/x86/intel: Fix bug for "cycles:p" and " cycles:pp" on SLM
2015-01-12 17:42 [PATCH V2 1/1] perf, x86: bug fix for cycles:p and cycles:pp on SLM kan.liang
@ 2015-01-16 8:42 ` tip-bot for Kan Liang
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Kan Liang @ 2015-01-16 8:42 UTC (permalink / raw)
To: linux-tip-commits
Cc: kan.liang, torvalds, acme, linux-kernel, hpa, tglx, peterz, mingo
Commit-ID: 33636732dcd7cc738a5913bb730d663c6b03c8fb
Gitweb: http://git.kernel.org/tip/33636732dcd7cc738a5913bb730d663c6b03c8fb
Author: Kan Liang <kan.liang@intel.com>
AuthorDate: Mon, 12 Jan 2015 17:42:21 +0000
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 16 Jan 2015 09:06:59 +0100
perf/x86/intel: Fix bug for "cycles:p" and "cycles:pp" on SLM
cycles:p and cycles:pp do not work on SLM since commit:
86a04461a99f ("perf/x86: Revamp PEBS event selection")
UOPS_RETIRED.ALL is not a PEBS capable event, so it should not be used
to count cycle number.
Actually SLM calls intel_pebs_aliases_core2() which uses INST_RETIRED.ANY_P
to count the number of cycles. It's a PEBS capable event. But inv and
cmask must be set to count cycles.
Considering SLM allows all events as PEBS with no flags, only
INST_RETIRED.ANY_P, inv=1, cmask=16 needs to handled specially.
Signed-off-by: Kan Liang <kan.liang@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1421084541-31639-1-git-send-email-kan.liang@intel.com
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/kernel/cpu/perf_event_intel_ds.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/cpu/perf_event_intel_ds.c b/arch/x86/kernel/cpu/perf_event_intel_ds.c
index 3c895d4..0739833 100644
--- a/arch/x86/kernel/cpu/perf_event_intel_ds.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c
@@ -568,8 +568,8 @@ struct event_constraint intel_atom_pebs_event_constraints[] = {
};
struct event_constraint intel_slm_pebs_event_constraints[] = {
- /* UOPS_RETIRED.ALL, inv=1, cmask=16 (cycles:p). */
- INTEL_FLAGS_EVENT_CONSTRAINT(0x108001c2, 0xf),
+ /* INST_RETIRED.ANY_P, inv=1, cmask=16 (cycles:p). */
+ INTEL_FLAGS_EVENT_CONSTRAINT(0x108000c0, 0x1),
/* Allow all events as PEBS with no flags */
INTEL_ALL_EVENT_CONSTRAINT(0, 0x1),
EVENT_CONSTRAINT_END
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-01-16 8:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-12 17:42 [PATCH V2 1/1] perf, x86: bug fix for cycles:p and cycles:pp on SLM kan.liang
2015-01-16 8:42 ` [tip:perf/urgent] perf/x86/intel: Fix bug for "cycles:p" and " cycles:pp" " tip-bot for Kan Liang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome