diff options
Diffstat (limited to 'arch/mips/oprofile/op_model_mipsxx.c')
-rw-r--r-- | arch/mips/oprofile/op_model_mipsxx.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/arch/mips/oprofile/op_model_mipsxx.c b/arch/mips/oprofile/op_model_mipsxx.c index 9d08608aaa51..4f94fa261aae 100644 --- a/arch/mips/oprofile/op_model_mipsxx.c +++ b/arch/mips/oprofile/op_model_mipsxx.c | |||
@@ -35,7 +35,7 @@ | |||
35 | #define vpe_id() smp_processor_id() | 35 | #define vpe_id() smp_processor_id() |
36 | #else | 36 | #else |
37 | #define WHAT 0 | 37 | #define WHAT 0 |
38 | #define vpe_id() smp_processor_id() | 38 | #define vpe_id() 0 |
39 | #endif | 39 | #endif |
40 | 40 | ||
41 | #define __define_perf_accessors(r, n, np) \ | 41 | #define __define_perf_accessors(r, n, np) \ |
@@ -74,13 +74,13 @@ static inline void w_c0_ ## r ## n(unsigned int value) \ | |||
74 | 74 | ||
75 | __define_perf_accessors(perfcntr, 0, 2) | 75 | __define_perf_accessors(perfcntr, 0, 2) |
76 | __define_perf_accessors(perfcntr, 1, 3) | 76 | __define_perf_accessors(perfcntr, 1, 3) |
77 | __define_perf_accessors(perfcntr, 2, 2) | 77 | __define_perf_accessors(perfcntr, 2, 0) |
78 | __define_perf_accessors(perfcntr, 3, 2) | 78 | __define_perf_accessors(perfcntr, 3, 1) |
79 | 79 | ||
80 | __define_perf_accessors(perfctrl, 0, 2) | 80 | __define_perf_accessors(perfctrl, 0, 2) |
81 | __define_perf_accessors(perfctrl, 1, 3) | 81 | __define_perf_accessors(perfctrl, 1, 3) |
82 | __define_perf_accessors(perfctrl, 2, 2) | 82 | __define_perf_accessors(perfctrl, 2, 0) |
83 | __define_perf_accessors(perfctrl, 3, 2) | 83 | __define_perf_accessors(perfctrl, 3, 1) |
84 | 84 | ||
85 | struct op_mips_model op_model_mipsxx_ops; | 85 | struct op_mips_model op_model_mipsxx_ops; |
86 | 86 | ||
@@ -97,7 +97,6 @@ static void mipsxx_reg_setup(struct op_counter_config *ctr) | |||
97 | int i; | 97 | int i; |
98 | 98 | ||
99 | /* Compute the performance counter control word. */ | 99 | /* Compute the performance counter control word. */ |
100 | /* For now count kernel and user mode */ | ||
101 | for (i = 0; i < counters; i++) { | 100 | for (i = 0; i < counters; i++) { |
102 | reg.control[i] = 0; | 101 | reg.control[i] = 0; |
103 | reg.counter[i] = 0; | 102 | reg.counter[i] = 0; |
@@ -234,9 +233,6 @@ static inline int n_counters(void) | |||
234 | counters = __n_counters(); | 233 | counters = __n_counters(); |
235 | } | 234 | } |
236 | 235 | ||
237 | #ifdef CONFIG_MIPS_MT_SMP | ||
238 | counters >> 1; | ||
239 | #endif | ||
240 | return counters; | 236 | return counters; |
241 | } | 237 | } |
242 | 238 | ||
@@ -270,6 +266,10 @@ static int __init mipsxx_init(void) | |||
270 | 266 | ||
271 | reset_counters(counters); | 267 | reset_counters(counters); |
272 | 268 | ||
269 | #ifdef CONFIG_MIPS_MT_SMP | ||
270 | counters >>= 1; | ||
271 | #endif | ||
272 | |||
273 | op_model_mipsxx_ops.num_counters = counters; | 273 | op_model_mipsxx_ops.num_counters = counters; |
274 | switch (current_cpu_data.cputype) { | 274 | switch (current_cpu_data.cputype) { |
275 | case CPU_20KC: | 275 | case CPU_20KC: |
@@ -326,7 +326,11 @@ static int __init mipsxx_init(void) | |||
326 | 326 | ||
327 | static void mipsxx_exit(void) | 327 | static void mipsxx_exit(void) |
328 | { | 328 | { |
329 | reset_counters(op_model_mipsxx_ops.num_counters); | 329 | int counters = op_model_mipsxx_ops.num_counters; |
330 | #ifdef CONFIG_MIPS_MT_SMP | ||
331 | counters <<= 1; | ||
332 | #endif | ||
333 | reset_counters(counters); | ||
330 | 334 | ||
331 | perf_irq = null_perf_irq; | 335 | perf_irq = null_perf_irq; |
332 | } | 336 | } |