linux/arch/s390/kernel
Tejun Heo a43cb95d54 dump_stack: unify debug information printed by show_regs()
show_regs() is inherently arch-dependent but it does make sense to print
generic debug information and some archs already do albeit in slightly
different forms.  This patch introduces a generic function to print debug
information from show_regs() so that different archs print out the same
information and it's much easier to modify what's printed.

show_regs_print_info() prints out the same debug info as dump_stack()
does plus task and thread_info pointers.

* Archs which didn't print debug info now do.

  alpha, arc, blackfin, c6x, cris, frv, h8300, hexagon, ia64, m32r,
  metag, microblaze, mn10300, openrisc, parisc, score, sh64, sparc,
  um, xtensa

* Already prints debug info.  Replaced with show_regs_print_info().
  The printed information is superset of what used to be there.

  arm, arm64, avr32, mips, powerpc, sh32, tile, unicore32, x86

* s390 is special in that it used to print arch-specific information
  along with generic debug info.  Heiko and Martin think that the
  arch-specific extra isn't worth keeping s390 specfic implementation.
  Converted to use the generic version.

Note that now all archs print the debug info before actual register
dumps.

An example BUG() dump follows.

 kernel BUG at /work/os/work/kernel/workqueue.c:4841!
 invalid opcode: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
 Modules linked in:
 CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.9.0-rc1-work+ #7
 Hardware name: empty empty/S3992, BIOS 080011  10/26/2007
 task: ffff88007c85e040 ti: ffff88007c860000 task.ti: ffff88007c860000
 RIP: 0010:[<ffffffff8234a07e>]  [<ffffffff8234a07e>] init_workqueues+0x4/0x6
 RSP: 0000:ffff88007c861ec8  EFLAGS: 00010246
 RAX: ffff88007c861fd8 RBX: ffffffff824466a8 RCX: 0000000000000001
 RDX: 0000000000000046 RSI: 0000000000000001 RDI: ffffffff8234a07a
 RBP: ffff88007c861ec8 R08: 0000000000000000 R09: 0000000000000000
 R10: 0000000000000001 R11: 0000000000000000 R12: ffffffff8234a07a
 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 FS:  0000000000000000(0000) GS:ffff88007dc00000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
 CR2: ffff88015f7ff000 CR3: 00000000021f1000 CR4: 00000000000007f0
 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
 Stack:
  ffff88007c861ef8 ffffffff81000312 ffffffff824466a8 ffff88007c85e650
  0000000000000003 0000000000000000 ffff88007c861f38 ffffffff82335e5d
  ffff88007c862080 ffffffff8223d8c0 ffff88007c862080 ffffffff81c47760
 Call Trace:
  [<ffffffff81000312>] do_one_initcall+0x122/0x170
  [<ffffffff82335e5d>] kernel_init_freeable+0x9b/0x1c8
  [<ffffffff81c47760>] ? rest_init+0x140/0x140
  [<ffffffff81c4776e>] kernel_init+0xe/0xf0
  [<ffffffff81c6be9c>] ret_from_fork+0x7c/0xb0
  [<ffffffff81c47760>] ? rest_init+0x140/0x140
  ...

v2: Typo fix in x86-32.

v3: CPU number dropped from show_regs_print_info() as
    dump_stack_print_info() has been updated to print it.  s390
    specific implementation dropped as requested by s390 maintainers.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Chris Metcalf <cmetcalf@tilera.com>		[tile bits]
Acked-by: Richard Kuo <rkuo@codeaurora.org>		[hexagon bits]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-04-30 17:04:02 -07:00
..
vdso32 s390: add various .gitignore files. 2012-05-16 14:42:41 +02:00
vdso64 s390: add various .gitignore files. 2012-05-16 14:42:41 +02:00
.gitignore s390: add various .gitignore files. 2012-05-16 14:42:41 +02:00
asm-offsets.c s390: system call path micro optimization 2013-04-26 09:07:05 +02:00
audit.c
audit.h
base.S s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
bitmap.c s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
cache.c s390/cache: fix data/instruction cache output 2012-10-18 17:50:11 +02:00
compat_audit.c
compat_exec_domain.c s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
compat_linux.c s390: switch to generic compat sched_rr_get_interval() 2013-02-03 18:16:13 -05:00
compat_linux.h s390: switch to generic old sigaction() 2013-02-03 18:16:14 -05:00
compat_ptrace.h [S390] ptrace cleanup 2011-01-05 12:47:31 +01:00
compat_signal.c s390/signal: Add BEA to compat signal handler parameters 2013-04-17 14:07:35 +02:00
compat_wrapper.S fix compat truncate/ftruncate 2013-02-25 09:24:55 -05:00
cpcmd.c s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
crash_dump.c s390/crashdump: move fill_cpu_elf_notes() prototype to header file 2012-09-26 15:45:22 +02:00
debug.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-02-26 20:16:07 -08:00
diag.c [S390] replace diag10() with diag10_range() function 2011-05-10 17:13:43 +02:00
dis.c s390/dis: use explicit buf len 2013-04-17 14:07:25 +02:00
dumpstack.c dump_stack: unify debug information printed by show_regs() 2013-04-30 17:04:02 -07:00
early.c s390/cleanup: rename SPP to LPP 2013-02-14 15:55:24 +01:00
ebcdic.c s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
entry64.S s390: system call path micro optimization 2013-04-26 09:07:05 +02:00
entry.h s390/hibernate: Save and restore absolute zero pages 2013-04-17 14:07:30 +02:00
entry.S s390: system call path micro optimization 2013-04-26 09:07:05 +02:00
ftrace.c [S390] cleanup ftrace backend functions 2011-01-05 12:47:31 +01:00
head31.S s390/mm: let kernel text section always begin at 1MB 2012-10-09 14:16:59 +02:00
head64.S s390/mm: let kernel text section always begin at 1MB 2012-10-09 14:16:59 +02:00
head_kdump.S s390/kdump: Use 64 bit mode for 0x10000 entry point 2012-10-18 17:50:09 +02:00
head.S s390: add zEC12 code generation support 2012-11-23 11:14:31 +01:00
ipl.c s390/ipl: Implement diag308 loop for zfcpdump 2013-02-14 15:55:05 +01:00
irq.c treewide: Fix typos in printk and comment 2013-03-18 14:57:53 +01:00
jump_label.c s390/jump-label: add arch_jump_label_transform_static() 2011-10-25 11:54:37 -07:00
kprobes.c hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
lgr.c s390/sysinfo,stsi: change return code handling 2012-09-26 15:45:12 +02:00
machine_kexec.c s390/kdump: Add PM notifier for kdump 2013-04-15 13:34:44 +02:00
Makefile s390/dumpstack: fix call chain walking 2013-04-17 14:07:28 +02:00
mcount64.S s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
mcount.S s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
mem_detect.c [S390] Rework create_mem_hole() function 2011-12-27 11:27:09 +01:00
module.c s390/module: fix compile warning 2013-02-28 09:37:13 +01:00
nmi.c s390/time: rename tod clock access functions 2013-02-14 15:55:10 +01:00
os_info.c s390/smp: make absolute lowcore / cpu restart parameter accesses more robust 2012-06-14 09:09:02 +02:00
perf_cpum_cf.c s390/perf: cpum_cf: fallback to software sampling events 2013-02-14 15:55:15 +01:00
perf_event.c [S390] Fix build errors (fallout from system.h disintegration) 2012-03-30 09:41:12 +02:00
pgm_check.S s390/traps: preinitialize program check table 2012-11-23 11:14:25 +01:00
process.c s390: Use generic idle loop 2013-04-08 17:39:27 +02:00
processor.c s390/processor: use ARRAY_SIZE instead of hard coded value 2012-09-26 15:45:03 +02:00
ptrace.c s390/ptrace: add missing ifdef 2012-09-26 15:45:21 +02:00
reipl64.S s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
reipl.S s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
relocate_kernel64.S s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
relocate_kernel.S s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
runtime_instr.c s390/irq: remove split irq fields from /proc/stat 2013-01-08 10:57:07 +01:00
s390_ksyms.c s390/string: provide asm lib functions for memcpy and memcmp 2012-09-26 15:44:50 +02:00
sclp.S s390/sclp: fix addressing mode clobber 2012-11-06 22:39:51 +01:00
setup.c s390: lowcore stack pointer offsets 2013-04-26 09:07:01 +02:00
signal.c s390/uaccess: remove pointless access_ok() checks 2013-02-28 09:37:09 +01:00
smp.c Merge branch 'smp-hotplug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-04-30 07:50:17 -07:00
stacktrace.c s390/comments: unify copyright messages and remove file names 2012-07-20 11:15:04 +02:00
suspend.c s390/hibernate: Save and restore absolute zero pages 2013-04-17 14:07:30 +02:00
swsusp_asm64.S s390/hibernate: Save and restore absolute zero pages 2013-04-17 14:07:30 +02:00
sys_s390.c s390: do not clobber personality flags in sys_32_personality() 2012-08-08 07:32:56 -07:00
syscalls.S fix compat truncate/ftruncate 2013-02-25 09:24:55 -05:00
sysinfo.c s390/sysinfo,stsi: change return code handling 2012-09-26 15:45:12 +02:00
time.c s390/time: rename tod clock access functions 2013-02-14 15:55:10 +01:00
topology.c s390/topology: export cpu_topology 2013-01-08 10:57:10 +01:00
traps.c s390/dumpstack: fix call chain walking 2013-04-17 14:07:28 +02:00
vdso.c s390/mm: rename addressing_mode to s390_user_mode 2012-09-26 15:45:05 +02:00
vmlinux.lds.S s390/linker skript: discard exit.data at runtime 2013-02-14 15:55:21 +01:00
vtime.c s390: Use generic idle loop 2013-04-08 17:39:27 +02:00