Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[S390] Print kernel version in dump_stack() and show_regs().

Also print PREEMPT and/or SMP if the kernel was configured that way.
Makes s390 look a bit more like other architectures.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by

Heiko Carstens and committed by
Martin Schwidefsky
5c699714 5fd9c6e2

+27 -11
+10 -8
arch/s390/kernel/process.c
··· 36 36 #include <linux/init.h> 37 37 #include <linux/module.h> 38 38 #include <linux/notifier.h> 39 - 39 + #include <linux/utsname.h> 40 40 #include <asm/uaccess.h> 41 41 #include <asm/pgtable.h> 42 42 #include <asm/system.h> ··· 182 182 183 183 void show_regs(struct pt_regs *regs) 184 184 { 185 - struct task_struct *tsk = current; 186 - 187 - printk("CPU: %d %s\n", task_thread_info(tsk)->cpu, print_tainted()); 188 - printk("Process %s (pid: %d, task: %p, ksp: %p)\n", 189 - current->comm, task_pid_nr(current), (void *) tsk, 190 - (void *) tsk->thread.ksp); 191 - 185 + print_modules(); 186 + printk("CPU: %d %s %s %.*s\n", 187 + task_thread_info(current)->cpu, print_tainted(), 188 + init_utsname()->release, 189 + (int)strcspn(init_utsname()->version, " "), 190 + init_utsname()->version); 191 + printk("Process %s (pid: %d, task: %p, ksp: %p)\n", 192 + current->comm, current->pid, current, 193 + (void *) current->thread.ksp); 192 194 show_registers(regs); 193 195 /* Show stack backtrace if pt_regs is from kernel mode */ 194 196 if (!(regs->psw.mask & PSW_MASK_PSTATE))
+17 -3
arch/s390/kernel/traps.c
··· 31 31 #include <linux/reboot.h> 32 32 #include <linux/kprobes.h> 33 33 #include <linux/bug.h> 34 + #include <linux/utsname.h> 34 35 #include <asm/system.h> 35 36 #include <asm/uaccess.h> 36 37 #include <asm/io.h> ··· 169 168 */ 170 169 void dump_stack(void) 171 170 { 171 + printk("CPU: %d %s %s %.*s\n", 172 + task_thread_info(current)->cpu, print_tainted(), 173 + init_utsname()->release, 174 + (int)strcspn(init_utsname()->version, " "), 175 + init_utsname()->version); 176 + printk("Process %s (pid: %d, task: %p, ksp: %p)\n", 177 + current->comm, current->pid, current, 178 + (void *) current->thread.ksp); 172 179 show_stack(NULL, NULL); 173 180 } 174 - 175 181 EXPORT_SYMBOL(dump_stack); 176 182 177 183 static inline int mask_bits(struct pt_regs *regs, unsigned long bits) ··· 266 258 console_verbose(); 267 259 spin_lock_irq(&die_lock); 268 260 bust_spinlocks(1); 269 - printk("%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter); 270 - print_modules(); 261 + printk("%s: %04lx [#%d] ", str, err & 0xffff, ++die_counter); 262 + #ifdef CONFIG_PREEMPT 263 + printk("PREEMPT "); 264 + #endif 265 + #ifdef CONFIG_SMP 266 + printk("SMP"); 267 + #endif 268 + printk("\n"); 271 269 notify_die(DIE_OOPS, str, regs, err, current->thread.trap_no, SIGSEGV); 272 270 show_regs(regs); 273 271 bust_spinlocks(0);