* [PATCH] powerpc/perf_counter: Enable SDAR in continous sample mode
@ 2009-09-22 3:01 Anton Blanchard
2009-10-28 4:31 ` Anton Blanchard
0 siblings, 1 reply; 2+ messages in thread
From: Anton Blanchard @ 2009-09-22 3:01 UTC (permalink / raw)
To: paulus, benh, a.p.zijlstra, mingo; +Cc: linuxppc-dev
In continuous sampling mode we want the SDAR to update. While we can
select between dcache misses and erat misses, a decent default is to
enable both.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux.trees.git/arch/powerpc/kernel/power7-pmu.c
===================================================================
--- linux.trees.git.orig/arch/powerpc/kernel/power7-pmu.c 2009-07-22 08:41:50.000000000 +1000
+++ linux.trees.git/arch/powerpc/kernel/power7-pmu.c 2009-07-22 09:22:54.000000000 +1000
@@ -54,6 +54,10 @@
* Bits in MMCRA
*/
+/* These bits control when the SDAR updates when in continous sampling mode */
+#define MMCRA_SDAR_DCACHE_MISS 30
+#define MMCRA_SDAR_ERAT_MISS 29
+
/*
* Layout of constraint bits:
* 6666555555555544444444443333333333222222222211111111110000000000
@@ -230,7 +234,8 @@ static int power7_compute_mmcr(u64 event
unsigned int hwc[], unsigned long mmcr[])
{
unsigned long mmcr1 = 0;
- unsigned long mmcra = 0;
+ unsigned long mmcra = (1 << MMCRA_SDAR_DCACHE_MISS) |
+ (1 << MMCRA_SDAR_ERAT_MISS);
unsigned int pmc, unit, combine, l2sel, psel;
unsigned int pmc_inuse = 0;
int i;
Index: linux.trees.git/arch/powerpc/kernel/power5-pmu.c
===================================================================
--- linux.trees.git.orig/arch/powerpc/kernel/power5-pmu.c 2009-07-22 09:07:17.000000000 +1000
+++ linux.trees.git/arch/powerpc/kernel/power5-pmu.c 2009-07-22 09:22:52.000000000 +1000
@@ -76,6 +76,10 @@
* Bits in MMCRA
*/
+/* These bits control when the SDAR updates when in continous sampling mode */
+#define MMCRA_SDAR_DCACHE_MISS 30
+#define MMCRA_SDAR_ERAT_MISS 29
+
/*
* Layout of constraint bits:
* 6666555555555544444444443333333333222222222211111111110000000000
@@ -390,7 +394,8 @@ static int power5_compute_mmcr(u64 event
unsigned int hwc[], unsigned long mmcr[])
{
unsigned long mmcr1 = 0;
- unsigned long mmcra = 0;
+ unsigned long mmcra = (1 << MMCRA_SDAR_DCACHE_MISS) |
+ (1 << MMCRA_SDAR_ERAT_MISS);
unsigned int pmc, unit, byte, psel;
unsigned int ttm, grp;
int i, isbus, bit, grsel;
Index: linux.trees.git/arch/powerpc/kernel/power6-pmu.c
===================================================================
--- linux.trees.git.orig/arch/powerpc/kernel/power6-pmu.c 2009-07-22 09:07:14.000000000 +1000
+++ linux.trees.git/arch/powerpc/kernel/power6-pmu.c 2009-07-22 09:22:45.000000000 +1000
@@ -51,6 +51,14 @@
#define MMCR1_PMCSEL_MSK 0xff
/*
+ * Bits in MMCRA
+ */
+
+/* These bits control when the SDAR updates when in continous sampling mode */
+#define MMCRA_SDAR_DCACHE_MISS 30
+#define MMCRA_SDAR_ERAT_MISS 29
+
+/*
* Map of which direct events on which PMCs are marked instruction events.
* Indexed by PMCSEL value >> 1.
* Bottom 4 bits are a map of which PMCs are interesting,
@@ -178,7 +186,8 @@ static int p6_compute_mmcr(u64 event[],
unsigned int hwc[], unsigned long mmcr[])
{
unsigned long mmcr1 = 0;
- unsigned long mmcra = 0;
+ unsigned long mmcra = (1 << MMCRA_SDAR_DCACHE_MISS) |
+ (1 << MMCRA_SDAR_ERAT_MISS);
int i;
unsigned int pmc, ev, b, u, s, psel;
unsigned int ttmset = 0;
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] powerpc/perf_counter: Enable SDAR in continous sample mode
2009-09-22 3:01 [PATCH] powerpc/perf_counter: Enable SDAR in continous sample mode Anton Blanchard
@ 2009-10-28 4:31 ` Anton Blanchard
0 siblings, 0 replies; 2+ messages in thread
From: Anton Blanchard @ 2009-10-28 4:31 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
In continuous sampling mode we want the SDAR to update. While we can
select between dcache misses and erat misses, a decent default is to
enable both.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Moved MMCRA definitions into asm/reg.h.
Index: linux.trees.git/arch/powerpc/kernel/power7-pmu.c
===================================================================
--- linux.trees.git.orig/arch/powerpc/kernel/power7-pmu.c 2009-10-28 14:02:08.000000000 +1100
+++ linux.trees.git/arch/powerpc/kernel/power7-pmu.c 2009-10-28 14:03:04.000000000 +1100
@@ -51,10 +51,6 @@
#define MMCR1_PMCSEL_MSK 0xff
/*
- * Bits in MMCRA
- */
-
-/*
* Layout of constraint bits:
* 6666555555555544444444443333333333222222222211111111110000000000
* 3210987654321098765432109876543210987654321098765432109876543210
@@ -230,7 +226,7 @@ static int power7_compute_mmcr(u64 event
unsigned int hwc[], unsigned long mmcr[])
{
unsigned long mmcr1 = 0;
- unsigned long mmcra = 0;
+ unsigned long mmcra = MMCRA_SDAR_DCACHE_MISS | MMCRA_SDAR_ERAT_MISS;
unsigned int pmc, unit, combine, l2sel, psel;
unsigned int pmc_inuse = 0;
int i;
Index: linux.trees.git/arch/powerpc/kernel/power5-pmu.c
===================================================================
--- linux.trees.git.orig/arch/powerpc/kernel/power5-pmu.c 2009-10-28 14:02:08.000000000 +1100
+++ linux.trees.git/arch/powerpc/kernel/power5-pmu.c 2009-10-28 14:03:04.000000000 +1100
@@ -73,10 +73,6 @@
#define MMCR1_PMCSEL_MSK 0x7f
/*
- * Bits in MMCRA
- */
-
-/*
* Layout of constraint bits:
* 6666555555555544444444443333333333222222222211111111110000000000
* 3210987654321098765432109876543210987654321098765432109876543210
@@ -390,7 +386,7 @@ static int power5_compute_mmcr(u64 event
unsigned int hwc[], unsigned long mmcr[])
{
unsigned long mmcr1 = 0;
- unsigned long mmcra = 0;
+ unsigned long mmcra = MMCRA_SDAR_DCACHE_MISS | MMCRA_SDAR_ERAT_MISS;
unsigned int pmc, unit, byte, psel;
unsigned int ttm, grp;
int i, isbus, bit, grsel;
Index: linux.trees.git/arch/powerpc/kernel/power6-pmu.c
===================================================================
--- linux.trees.git.orig/arch/powerpc/kernel/power6-pmu.c 2009-10-28 14:02:08.000000000 +1100
+++ linux.trees.git/arch/powerpc/kernel/power6-pmu.c 2009-10-28 14:03:04.000000000 +1100
@@ -178,7 +178,7 @@ static int p6_compute_mmcr(u64 event[],
unsigned int hwc[], unsigned long mmcr[])
{
unsigned long mmcr1 = 0;
- unsigned long mmcra = 0;
+ unsigned long mmcra = MMCRA_SDAR_DCACHE_MISS | MMCRA_SDAR_ERAT_MISS;
int i;
unsigned int pmc, ev, b, u, s, psel;
unsigned int ttmset = 0;
Index: linux.trees.git/arch/powerpc/include/asm/reg.h
===================================================================
--- linux.trees.git.orig/arch/powerpc/include/asm/reg.h 2009-10-28 14:02:08.000000000 +1100
+++ linux.trees.git/arch/powerpc/include/asm/reg.h 2009-10-28 14:03:33.000000000 +1100
@@ -489,6 +489,8 @@
#define SPRN_MMCR1 798
#define SPRN_MMCRA 0x312
#define MMCRA_SDSYNC 0x80000000UL /* SDAR synced with SIAR */
+#define MMCRA_SDAR_DCACHE_MISS 0x40000000UL
+#define MMCRA_SDAR_ERAT_MISS 0x20000000UL
#define MMCRA_SIHV 0x10000000UL /* state of MSR HV when SIAR set */
#define MMCRA_SIPR 0x08000000UL /* state of MSR PR when SIAR set */
#define MMCRA_SLOT 0x07000000UL /* SLOT bits (37-39) */
Index: linux.trees.git/arch/powerpc/kernel/power5+-pmu.c
===================================================================
--- linux.trees.git.orig/arch/powerpc/kernel/power5+-pmu.c 2009-10-28 14:03:57.000000000 +1100
+++ linux.trees.git/arch/powerpc/kernel/power5+-pmu.c 2009-10-28 14:03:58.000000000 +1100
@@ -73,10 +73,6 @@
#define MMCR1_PMCSEL_MSK 0x7f
/*
- * Bits in MMCRA
- */
-
-/*
* Layout of constraint bits:
* 6666555555555544444444443333333333222222222211111111110000000000
* 3210987654321098765432109876543210987654321098765432109876543210
Index: linux.trees.git/arch/powerpc/kernel/ppc970-pmu.c
===================================================================
--- linux.trees.git.orig/arch/powerpc/kernel/ppc970-pmu.c 2009-10-28 14:03:57.000000000 +1100
+++ linux.trees.git/arch/powerpc/kernel/ppc970-pmu.c 2009-10-28 14:03:58.000000000 +1100
@@ -84,10 +84,6 @@ static short mmcr1_adder_bits[8] = {
};
/*
- * Bits in MMCRA
- */
-
-/*
* Layout of constraint bits:
* 6666555555555544444444443333333333222222222211111111110000000000
* 3210987654321098765432109876543210987654321098765432109876543210
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-10-28 4:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-22 3:01 [PATCH] powerpc/perf_counter: Enable SDAR in continous sample mode Anton Blanchard
2009-10-28 4:31 ` Anton Blanchard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).