aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/i386/oprofile/op_model_ppro.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/arch/i386/oprofile/op_model_ppro.c b/arch/i386/oprofile/op_model_ppro.c
index f88e05ba8eb3..ca2447e05e15 100644
--- a/arch/i386/oprofile/op_model_ppro.c
+++ b/arch/i386/oprofile/op_model_ppro.c
@@ -138,11 +138,14 @@ static int ppro_check_ctrs(struct pt_regs * const regs,
138static void ppro_start(struct op_msrs const * const msrs) 138static void ppro_start(struct op_msrs const * const msrs)
139{ 139{
140 unsigned int low,high; 140 unsigned int low,high;
141 int i;
141 142
142 if (reset_value[0]) { 143 for (i = 0; i < NUM_COUNTERS; ++i) {
143 CTRL_READ(low, high, msrs, 0); 144 if (reset_value[i]) {
144 CTRL_SET_ACTIVE(low); 145 CTRL_READ(low, high, msrs, i);
145 CTRL_WRITE(low, high, msrs, 0); 146 CTRL_SET_ACTIVE(low);
147 CTRL_WRITE(low, high, msrs, i);
148 }
146 } 149 }
147} 150}
148 151
@@ -150,11 +153,14 @@ static void ppro_start(struct op_msrs const * const msrs)
150static void ppro_stop(struct op_msrs const * const msrs) 153static void ppro_stop(struct op_msrs const * const msrs)
151{ 154{
152 unsigned int low,high; 155 unsigned int low,high;
156 int i;
153 157
154 if (reset_value[0]) { 158 for (i = 0; i < NUM_COUNTERS; ++i) {
155 CTRL_READ(low, high, msrs, 0); 159 if (!reset_value[i])
160 continue;
161 CTRL_READ(low, high, msrs, i);
156 CTRL_SET_INACTIVE(low); 162 CTRL_SET_INACTIVE(low);
157 CTRL_WRITE(low, high, msrs, 0); 163 CTRL_WRITE(low, high, msrs, i);
158 } 164 }
159} 165}
160 166