diff options
-rw-r--r-- | arch/x86/oprofile/nmi_int.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c index dca7240aeb26..f0fb44725d80 100644 --- a/arch/x86/oprofile/nmi_int.c +++ b/arch/x86/oprofile/nmi_int.c | |||
@@ -258,6 +258,12 @@ static int nmi_switch_event(void) | |||
258 | return 0; | 258 | return 0; |
259 | } | 259 | } |
260 | 260 | ||
261 | static inline void mux_init(struct oprofile_operations *ops) | ||
262 | { | ||
263 | if (has_mux()) | ||
264 | ops->switch_events = nmi_switch_event; | ||
265 | } | ||
266 | |||
261 | #else | 267 | #else |
262 | 268 | ||
263 | inline int op_x86_phys_to_virt(int phys) { return phys; } | 269 | inline int op_x86_phys_to_virt(int phys) { return phys; } |
@@ -265,6 +271,7 @@ static inline void nmi_shutdown_mux(void) { } | |||
265 | static inline int nmi_setup_mux(void) { return 1; } | 271 | static inline int nmi_setup_mux(void) { return 1; } |
266 | static inline void | 272 | static inline void |
267 | nmi_cpu_setup_mux(int cpu, struct op_msrs const * const msrs) { } | 273 | nmi_cpu_setup_mux(int cpu, struct op_msrs const * const msrs) { } |
274 | static inline void mux_init(struct oprofile_operations *ops) { } | ||
268 | 275 | ||
269 | #endif | 276 | #endif |
270 | 277 | ||
@@ -682,9 +689,6 @@ int __init op_nmi_init(struct oprofile_operations *ops) | |||
682 | ops->start = nmi_start; | 689 | ops->start = nmi_start; |
683 | ops->stop = nmi_stop; | 690 | ops->stop = nmi_stop; |
684 | ops->cpu_type = cpu_type; | 691 | ops->cpu_type = cpu_type; |
685 | #ifdef CONFIG_OPROFILE_EVENT_MULTIPLEX | ||
686 | ops->switch_events = nmi_switch_event; | ||
687 | #endif | ||
688 | 692 | ||
689 | if (model->init) | 693 | if (model->init) |
690 | ret = model->init(ops); | 694 | ret = model->init(ops); |
@@ -694,6 +698,8 @@ int __init op_nmi_init(struct oprofile_operations *ops) | |||
694 | if (!model->num_virt_counters) | 698 | if (!model->num_virt_counters) |
695 | model->num_virt_counters = model->num_counters; | 699 | model->num_virt_counters = model->num_counters; |
696 | 700 | ||
701 | mux_init(ops); | ||
702 | |||
697 | init_sysfs(); | 703 | init_sysfs(); |
698 | using_nmi = 1; | 704 | using_nmi = 1; |
699 | printk(KERN_INFO "oprofile: using NMI interrupt.\n"); | 705 | printk(KERN_INFO "oprofile: using NMI interrupt.\n"); |