diff options
author | Robert Richter <robert.richter@amd.com> | 2010-03-23 15:01:54 -0400 |
---|---|---|
committer | Robert Richter <robert.richter@amd.com> | 2010-05-04 05:35:27 -0400 |
commit | 83300ce0df6b72e156b386457aa0f0902b8c0a98 (patch) | |
tree | 0aa77779550808cd1076945b9a698dcbcca02dbe /arch/x86/oprofile/op_model_ppro.c | |
parent | d0e4120fda6f87eead438eed4d49032e12060e58 (diff) |
oprofile/x86: moving shutdown functions
Moving some code in preparation of the next patch.
Signed-off-by: Robert Richter <robert.richter@amd.com>
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 f8e268e8e992..b07d25a52f02 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, |