Subject: display last accessed sysfs file on kernel panic message From: Andrew Morton Patch-mainline: never Display the most-recently-opened sysfs file's name when oopsing. From: Adrian Bunk Build fix From: Greg Kroah-Hartman Modified to make the api call cleaner, and available to all arches if need be. Also added it to x86-64's crash dump message. Signed-off-by: Adrian Bunk Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman Automatically created from "patches.drivers/sysfs-crash-debugging.patch" by xen-port-patches.py Index: head-2008-02-26/arch/x86/kernel/traps_32-xen.c =================================================================== --- head-2008-02-26.orig/arch/x86/kernel/traps_32-xen.c 2008-02-27 17:27:13.000000000 +0100 +++ head-2008-02-26/arch/x86/kernel/traps_32-xen.c 2008-03-03 14:41:20.000000000 +0100 @@ -402,6 +402,7 @@ int __kprobes __die(const char * str, st #endif printk("\n"); + sysfs_printk_last_file(); if (notify_die(DIE_OOPS, str, regs, err, current->thread.trap_no, SIGSEGV) != NOTIFY_STOP) { Index: head-2008-02-26/arch/x86/kernel/traps_64-xen.c =================================================================== --- head-2008-02-26.orig/arch/x86/kernel/traps_64-xen.c 2008-02-27 10:01:23.000000000 +0100 +++ head-2008-02-26/arch/x86/kernel/traps_64-xen.c 2008-03-03 14:41:47.000000000 +0100 @@ -575,6 +575,7 @@ int __kprobes __die(const char * str, st printk("DEBUG_PAGEALLOC"); #endif printk("\n"); + sysfs_printk_last_file(); if (notify_die(DIE_OOPS, str, regs, err, current->thread.trap_no, SIGSEGV) == NOTIFY_STOP) return 1; show_registers(regs);