From: Prarit Bhargava <prarit@redhat.com> Date: Tue, 10 Feb 2009 10:22:55 -0500 Subject: [misc] ia64, s390: add kernel version to panic output Message-id: 20090210152254.8377.19228.sendpatchset@prarit.bos.redhat.com O-Subject: [RHEL5 PATCH]: add kernel version to panic output on ia64 and s390 Bugzilla: 484403 RH-Acked-by: Neil Horman <nhorman@redhat.com> RH-Acked-by: Anton Arapov <aarapov@redhat.com> RH-Acked-by: Dave Anderson <anderson@redhat.com> Output the kernel version during a panic on ia64 and s390. All other arches do this except these two. Patch is based on code in 2.6.29. Before patch (on ia64): psr : 00001210085a6010 ifs : 8000000000000186 ip : [<a00000021ed680f1>] Tainted: G ip is at init_prarit+0x31/0xc0 [prarit] After patch: psr : 00001210085a6010 ifs : 8000000000000186 ip : [<a00000021ed680f1>] Tainted: G (2.6.18-130.el5.bz484403.4) ip is at init_prarit+0x31/0xc0 [prarit] Succesfully tested on ia64 and one of the s390s in RDU. Resolves BZ 484403. diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c index 90ab0a8..38c9c8b 100644 --- a/arch/ia64/kernel/process.c +++ b/arch/ia64/kernel/process.c @@ -29,6 +29,7 @@ #include <linux/efi.h> #include <linux/interrupt.h> #include <linux/delay.h> +#include <linux/utsname.h> #include <asm/cpu.h> #include <asm/delay.h> @@ -108,8 +109,9 @@ show_regs (struct pt_regs *regs) print_modules(); printk("\nPid: %d, CPU %d, comm: %20s\n", current->pid, smp_processor_id(), current->comm); - printk("psr : %016lx ifs : %016lx ip : [<%016lx>] %s\n", - regs->cr_ipsr, regs->cr_ifs, ip, print_tainted()); + printk("psr : %016lx ifs : %016lx ip : [<%016lx>] %s (%s)\n", + regs->cr_ipsr, regs->cr_ifs, ip, print_tainted(), + system_utsname.release); print_symbol("ip is at %s\n", ip); printk("unat: %016lx pfs : %016lx rsc : %016lx\n", regs->ar_unat, regs->ar_pfs, regs->ar_rsc); diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c index d5dbc8c..77b8634 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c @@ -36,6 +36,7 @@ #include <linux/init.h> #include <linux/module.h> #include <linux/notifier.h> +#include <linux/utsname.h> #include <asm/uaccess.h> #include <asm/pgtable.h> @@ -164,7 +165,11 @@ void show_regs(struct pt_regs *regs) { struct task_struct *tsk = current; - printk("CPU: %d %s\n", task_thread_info(tsk)->cpu, print_tainted()); + printk("CPU: %d %s %s %.*s\n", + task_thread_info(tsk)->cpu, print_tainted(), + system_utsname.release, + (int)strcspn(system_utsname.version, " "), + system_utsname.version); printk("Process %s (pid: %d, task: %p, ksp: %p)\n", current->comm, current->pid, (void *) tsk, (void *) tsk->thread.ksp);