]> err.no Git - linux-2.6/blobdiff - arch/x86/kernel/traps_32.c
x86: printk kernel version in WARN_ON and other dump_stack users
[linux-2.6] / arch / x86 / kernel / traps_32.c
index 47e6d10902fe88c031f3fbfbe786af363896aa49..0a4c893824792bbb540946b7bf81922e9e059fa9 100644 (file)
@@ -283,6 +283,11 @@ void dump_stack(void)
 {
        unsigned long stack;
 
+       printk("Pid: %d, comm: %.20s %s %s %.*s\n",
+               current->pid, current->comm, print_tainted(),
+               init_utsname()->release,
+               (int)strcspn(init_utsname()->version, " "),
+               init_utsname()->version);
        show_trace(current, NULL, &stack);
 }
 
@@ -295,7 +300,7 @@ void show_registers(struct pt_regs *regs)
        print_modules();
        __show_registers(regs, 0);
        printk(KERN_EMERG "Process %.*s (pid: %d, ti=%p task=%p task.ti=%p)",
-               TASK_COMM_LEN, current->comm, current->pid,
+               TASK_COMM_LEN, current->comm, task_pid_nr(current),
                current_thread_info(), current, task_thread_info(current));
        /*
         * When in-kernel, we also print out the stack and code at the
@@ -603,7 +608,7 @@ fastcall void __kprobes do_general_protection(struct pt_regs * regs,
            printk_ratelimit())
                printk(KERN_INFO
                    "%s[%d] general protection eip:%lx esp:%lx error:%lx\n",
-                   current->comm, current->pid,
+                   current->comm, task_pid_nr(current),
                    regs->eip, regs->esp, error_code);
 
        force_sig(SIGSEGV, current);
@@ -789,6 +794,8 @@ void restart_nmi(void)
 #ifdef CONFIG_KPROBES
 fastcall void __kprobes do_int3(struct pt_regs *regs, long error_code)
 {
+       trace_hardirqs_fixup();
+
        if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP)
                        == NOTIFY_STOP)
                return;