]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ftrace: fix kexec
authorIngo Molnar <mingo@elte.hu>
Mon, 12 May 2008 19:20:43 +0000 (21:20 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 23 May 2008 18:39:05 +0000 (20:39 +0200)
disable the tracer while kexec pulls the rug from under the old
kernel.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/kernel/machine_kexec_32.c
arch/x86/kernel/machine_kexec_64.c
include/linux/ftrace.h

index d0b234c9fc318ac0f11a127f9aac87ce7de55dc6..88923fd7a6fc5c3943bee384a43860f7fe1104fd 100644 (file)
@@ -11,6 +11,8 @@
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/numa.h>
+#include <linux/ftrace.h>
+
 #include <asm/pgtable.h>
 #include <asm/pgalloc.h>
 #include <asm/tlbflush.h>
@@ -107,6 +109,8 @@ NORET_TYPE void machine_kexec(struct kimage *image)
        unsigned long page_list[PAGES_NR];
        void *control_page;
 
+       tracer_disable();
+
        /* Interrupts aren't acceptable while we reboot */
        local_irq_disable();
 
index 576a03db45112cd710cb17e268bf226d76d36012..1558fdc174f96155c8e3af95f0a2426f441848c3 100644 (file)
@@ -11,6 +11,8 @@
 #include <linux/string.h>
 #include <linux/reboot.h>
 #include <linux/numa.h>
+#include <linux/ftrace.h>
+
 #include <asm/pgtable.h>
 #include <asm/tlbflush.h>
 #include <asm/mmu_context.h>
@@ -184,6 +186,8 @@ NORET_TYPE void machine_kexec(struct kimage *image)
        unsigned long page_list[PAGES_NR];
        void *control_page;
 
+       tracer_disable();
+
        /* Interrupts aren't acceptable while we reboot */
        local_irq_disable();
 
index f5911d2d42c35474ee1f1f9ebcf12eac0e0a9cd9..a42390c1d6e1c667ee7ad08f5764fe1b3993b9c3 100644 (file)
@@ -68,6 +68,13 @@ extern void ftrace_call(void);
 extern void mcount_call(void);
 #endif
 
+static inline void tracer_disable(void)
+{
+#ifdef CONFIG_FTRACE
+       ftrace_enabled = 0;
+#endif
+}
+
 #ifdef CONFIG_FRAME_POINTER
 /* TODO: need to fix this for ARM */
 # define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0))