diff options
Diffstat (limited to 'arch/x86/oprofile/op_model_ppro.c')
| -rw-r--r-- | arch/x86/oprofile/op_model_ppro.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/arch/x86/oprofile/op_model_ppro.c b/arch/x86/oprofile/op_model_ppro.c index f8e268e8e99..b07d25a52f0 100644 --- a/arch/x86/oprofile/op_model_ppro.c +++ b/arch/x86/oprofile/op_model_ppro.c | |||
| @@ -30,6 +30,22 @@ static int counter_width = 32; | |||
| 30 | 30 | ||
| 31 | static u64 *reset_value; | 31 | static u64 *reset_value; |
| 32 | 32 | ||
| 33 | static void ppro_shutdown(struct op_msrs const * const msrs) | ||
| 34 | { | ||
| 35 | int i; | ||
| 36 | |||
| 37 | for (i = 0; i < num_counters; ++i) { | ||
| 38 | if (!msrs->counters[i].addr) | ||
| 39 | continue; | ||
| 40 | release_perfctr_nmi(MSR_P6_PERFCTR0 + i); | ||
| 41 | release_evntsel_nmi(MSR_P6_EVNTSEL0 + i); | ||
| 42 | } | ||
| 43 | if (reset_value) { | ||
| 44 | kfree(reset_value); | ||
| 45 | reset_value = NULL; | ||
| 46 | } | ||
| 47 | } | ||
| 48 | |||
| 33 | static void ppro_fill_in_addresses(struct op_msrs * const msrs) | 49 | static void ppro_fill_in_addresses(struct op_msrs * const msrs) |
| 34 | { | 50 | { |
| 35 | int i; | 51 | int i; |
| @@ -189,23 +205,6 @@ static void ppro_stop(struct op_msrs const * const msrs) | |||
| 189 | } | 205 | } |
| 190 | } | 206 | } |
| 191 | 207 | ||
| 192 | static void ppro_shutdown(struct op_msrs const * const msrs) | ||
| 193 | { | ||
| 194 | int i; | ||
| 195 | |||
| 196 | for (i = 0; i < num_counters; ++i) { | ||
| 197 | if (!msrs->counters[i].addr) | ||
| 198 | continue; | ||
| 199 | release_perfctr_nmi(MSR_P6_PERFCTR0 + i); | ||
| 200 | release_evntsel_nmi(MSR_P6_EVNTSEL0 + i); | ||
| 201 | } | ||
| 202 | if (reset_value) { | ||
| 203 | kfree(reset_value); | ||
| 204 | reset_value = NULL; | ||
| 205 | } | ||
| 206 | } | ||
| 207 | |||
| 208 | |||
| 209 | struct op_x86_model_spec op_ppro_spec = { | 208 | struct op_x86_model_spec op_ppro_spec = { |
| 210 | .num_counters = 2, | 209 | .num_counters = 2, |
| 211 | .num_controls = 2, | 210 | .num_controls = 2, |
