[PATCH] [17/45] i386: make Oprofile call shutdown() only once per session

Andi Kleen
2007-09-21T20:50:46Z

From: Stephane Eranian <eranian@hpl.hp.com>

Oprofile: call model->shutdown() only once to avoid calling release_ev*()
multiple times

Signed-off-by: Stephane Eranian <eranian@hpl.hp.com>
Signed-off-by: Andi Kleen <ak@suse.de>

---
arch/i386/oprofile/nmi_int.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux/arch/i386/oprofile/nmi_int.c
===================================================================
--- linux.orig/arch/i386/oprofile/nmi_int.c
+++ linux/arch/i386/oprofile/nmi_int.c
@@ -269,7 +269,6 @@ static void nmi_cpu_shutdown(void * dumm
apic_write(APIC_LVTPC, saved_lvtpc[cpu]);
apic_write(APIC_LVTERR, v);
nmi_restore_registers(msrs);
- model->shutdown(msrs);
}

@@ -278,6 +277,7 @@ static void nmi_shutdown(void)
nmi_enabled = 0;
on_each_cpu(nmi_cpu_shutdown, NULL, 0, 1);
unregister_die_notifier(&profile_exceptions_nb);
+ model->shutdown(cpu_msrs);
free_msrs();
}