android_kernel_motorola_sm6225/arch/ia64/kernel
Tejun Heo 196779b9b4 dump_stack: consolidate dump_stack() implementations and unify their behaviors
Both dump_stack() and show_stack() are currently implemented by each
architecture.  show_stack(NULL, NULL) dumps the backtrace for the
current task as does dump_stack().  On some archs, dump_stack() prints
extra information - pid, utsname and so on - in addition to the
backtrace while the two are identical on other archs.

The usages in arch-independent code of the two functions indicate
show_stack(NULL, NULL) should print out bare backtrace while
dump_stack() is used for debugging purposes when something went wrong,
so it does make sense to print additional information on the task which
triggered dump_stack().

There's no reason to require archs to implement two separate but mostly
identical functions.  It leads to unnecessary subtle information.

This patch expands the dummy fallback dump_stack() implementation in
lib/dump_stack.c such that it prints out debug information (taken from
x86) and invokes show_stack(NULL, NULL) and drops arch-specific
dump_stack() implementations in all archs except blackfin.  Blackfin's
dump_stack() does something wonky that I don't understand.

Debug information can be printed separately by calling
dump_stack_print_info() so that arch-specific dump_stack()
implementation can still emit the same debug information.  This is used
in blackfin.

This patch brings the following behavior changes.

* On some archs, an extra level in backtrace for show_stack() could be
  printed.  This is because the top frame was determined in
  dump_stack() on those archs while generic dump_stack() can't do that
  reliably.  It can be compensated by inlining dump_stack() but not
  sure whether that'd be necessary.

* Most archs didn't use to print debug info on dump_stack().  They do
  now.

An example WARN dump follows.

 WARNING: at kernel/workqueue.c:4841 init_workqueues+0x35/0x505()
 Hardware name: empty
 Modules linked in:
 CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.9.0-rc1-work+ #9
  0000000000000009 ffff88007c861e08 ffffffff81c614dc ffff88007c861e48
  ffffffff8108f50f ffffffff82228240 0000000000000040 ffffffff8234a03c
  0000000000000000 0000000000000000 0000000000000000 ffff88007c861e58
 Call Trace:
  [<ffffffff81c614dc>] dump_stack+0x19/0x1b
  [<ffffffff8108f50f>] warn_slowpath_common+0x7f/0xc0
  [<ffffffff8108f56a>] warn_slowpath_null+0x1a/0x20
  [<ffffffff8234a071>] init_workqueues+0x35/0x505
  ...

v2: CPU number added to the generic debug info as requested by s390
    folks and dropped the s390 specific dump_stack().  This loses %ksp
    from the debug message which the maintainers think isn't important
    enough to keep the s390-specific dump_stack() implementation.

    dump_stack_print_info() is moved to kernel/printk.c from
    lib/dump_stack.c.  Because linkage is per objecct file,
    dump_stack_print_info() living in the same lib file as generic
    dump_stack() means that archs which implement custom dump_stack()
    - at this point, only blackfin - can't use dump_stack_print_info()
    as that will bring in the generic version of dump_stack() too.  v1
    The v1 patch broke build on blackfin due to this issue.  The build
    breakage was reported by Fengguang Wu.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Vineet Gupta <vgupta@synopsys.com>
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
Acked-by: Vineet Gupta <vgupta@synopsys.com>
Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>	[s390 bits]
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
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
..
cpufreq [CPUFREQ] use dynamic debug instead of custom infrastructure 2011-05-04 11:50:57 -04:00
.gitignore [IA64] Cleanup generated file not ignored by .gitignore 2008-08-04 11:06:16 -07:00
acpi-ext.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
acpi.c IA64: drivers: remove __dev* attributes. 2013-01-03 15:57:13 -08:00
asm-offsets.c cputime: Generic on-demand virtual cputime accounting 2013-01-27 19:23:27 +01:00
audit.c [IA64] Remove COMPAT_IA32 support 2010-02-08 10:42:17 -08:00
brl_emu.c
crash.c sysctl: Drop & in front of every proc_handler. 2009-11-18 08:37:40 -08:00
crash_dump.c crash_dump: export is_kdump_kernel to modules, consolidate elfcorehdr_addr, setup_elfcorehdr and saved_max_pfn 2011-03-23 19:47:19 -07:00
cyclone.c ia64: Replace clocksource.fsys_mmio with generic arch data 2011-07-14 17:57:09 -07:00
dma-mapping.c ia64: Add export.h to arch/ia64 specific files as required 2011-10-31 19:30:58 -04:00
efi.c /dev/mem: use phys_addr_t for physical addresses 2012-10-24 15:32:50 -07:00
efi_stub.S [IA64] make efi_stub.S fit in 80 cols 2006-06-21 14:35:28 -07:00
elfcore.c elf coredump: add extended numbering support 2010-03-06 11:26:46 -08:00
entry.h Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
entry.S cputime: Generic on-demand virtual cputime accounting 2013-01-27 19:23:27 +01:00
err_inject.c cpu: convert 'cpu' and 'machinecheck' sysdev_class to a regular subsystem 2011-12-21 14:29:42 -08:00
esi.c tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
esi_stub.S [IA64] esi-support 2006-06-21 11:19:22 -07:00
fsys.S Fix broken fsys_getppid() 2013-03-19 16:14:52 -07:00
fsyscall_gtod_data.h ia64: vsyscall: Use seqcount instead of seqlock 2012-03-15 18:17:59 -07:00
ftrace.c ftrace, ia64: IA64 dynamic ftrace support 2009-01-14 12:11:31 +01:00
gate-data.S Rename .data.gate to .data..gate. 2010-03-03 11:25:59 +01:00
gate.lds.S Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
gate.S Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
head.S cputime: Generic on-demand virtual cputime accounting 2013-01-27 19:23:27 +01:00
ia64_ksyms.c treewide: Put a space between #include and FILE 2012-06-28 11:44:36 +02:00
init_task.c Rename .data.init_task to .data..init_task. 2010-03-03 11:25:58 +01:00
iosapic.c Fix kexec oops when iosapic was removed 2013-03-19 16:14:53 -07:00
irq.c Fix initialization of CMCI/CMCP interrupts 2013-04-02 09:37:06 -07:00
irq_ia64.c random: remove rand_initialize_irq() 2012-07-19 10:38:32 -04:00
irq_lsapic.c ia64: Convert lsapic to new irq_chip functions 2011-03-29 14:48:02 +02:00
ivt.S cputime: Generic on-demand virtual cputime accounting 2013-01-27 19:23:27 +01:00
jprobes.S [IA64] Move include/asm-ia64 to arch/ia64/include/asm 2008-08-01 10:21:21 -07:00
kprobes.c hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
machine_kexec.c [IA64] kexec: Move the dereference below the NULL test 2012-09-10 14:31:23 -07:00
machvec.c Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
Makefile iommu: Rename the DMAR and INTR_REMAP config options 2011-09-21 10:22:03 +02:00
Makefile.gate Rename .data.gate to .data..gate. 2010-03-03 11:25:59 +01:00
mca.c Fix initialization of CMCI/CMCP interrupts 2013-04-02 09:37:06 -07:00
mca_asm.S percpu: make percpu symbols in ia64 unique 2009-10-29 22:34:14 +09:00
mca_drv.c Remove cast for kmalloc return value 2013-03-19 16:14:53 -07:00
mca_drv.h [IA64] mca style cleanup 2008-02-04 15:42:06 -08:00
mca_drv_asm.S [IA64] mca style cleanup 2008-02-04 15:42:06 -08:00
minstate.h cputime: Generic on-demand virtual cputime accounting 2013-01-27 19:23:27 +01:00
module.c modules: make arch's use default loader hooks 2011-07-24 22:06:04 +09:30
msi_ia64.c arch/ia64: remove references to cpu_*_map 2012-03-28 17:14:36 -07:00
nr-irqs.c ia64/pv_ops/xen: define the nubmer of irqs which xen needs. 2008-10-17 10:06:59 -07:00
numa.c [IA64] Minimize per_cpu reservations. 2008-04-08 13:51:35 -07:00
pal.S [IA64] reformat pal.S to fit in 80 columns, fix typos 2006-10-17 14:54:19 -07:00
palinfo.c palinfo fixes 2013-04-09 14:09:44 -04:00
paravirt.c static keys: Introduce 'struct static_key', static_key_true()/false() and static_key_slow_[inc|dec]() 2012-02-24 10:05:59 +01:00
paravirt_inst.h ia64/pv_ops: paravirtualized instruction checker. 2008-10-17 10:12:54 -07:00
paravirt_patch.c ia64/pv_op/binarypatch: add helper functions to support binary patching for paravirt_ops. 2009-03-26 11:02:31 -07:00
paravirt_patchlist.c [IA64] Fix build error in paravirt_patchlist.c 2009-06-17 09:04:40 -07:00
paravirt_patchlist.h ia64/pv_ops: gate page paravirtualization. 2009-03-26 10:51:02 -07:00
paravirtentry.S Rename .data.read_mostly to .data..read_mostly. 2010-03-03 11:26:00 +01:00
patch.c Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
pci-dma.c iommu: Remove group_mf 2012-06-25 13:48:30 +02:00
pci-swiotlb.c X86 & IA64: adapt for dma_map_ops changes 2012-03-28 16:36:31 +02:00
perfmon.c ia64: Use generic idle loop 2013-04-08 17:39:25 +02:00
perfmon_default_smpl.c Fix common misspellings 2011-03-31 11:26:23 -03:00
perfmon_generic.h
perfmon_itanium.h
perfmon_mckinley.h [IA64] spelling fixes: arch/ia64/ 2007-05-11 14:55:43 -07:00
perfmon_montecito.h [IA64] sparse cleanups 2006-12-07 10:48:19 -08:00
process.c dump_stack: consolidate dump_stack() implementations and unify their behaviors 2013-04-30 17:04:02 -07:00
ptrace.c ia64: kill thread_matches(), unexport ptrace_check_attach() 2013-01-20 12:26:05 -08:00
relocate_kernel.S percpu: make percpu symbols in ia64 unique 2009-10-29 22:34:14 +09:00
sal.c [IA64] Update check_sal_cache_flush to use platform_send_ipi() 2008-06-11 16:40:33 -07:00
salinfo.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
setup.c ia64 idle: delete pm_idle 2013-02-17 23:37:06 -05:00
sigframe.h [IA64] Add TIF_RESTORE_SIGMASK 2007-05-08 14:51:59 -07:00
signal.c ia64: switch to generic sigaltstack 2013-02-03 18:15:58 -05:00
smp.c Merge branch 'akpm' (Andrew's patch-bomb) 2012-03-28 17:19:28 -07:00
smpboot.c ia64: Use generic idle loop 2013-04-08 17:39:25 +02:00
stacktrace.c [IA64] Add CONFIG_STACKTRACE_SUPPORT 2010-09-23 13:52:07 -07:00
sys_ia64.c mm: use vm_unmapped_area() on ia64 architecture 2013-02-22 13:46:59 -08:00
time.c kvm: Prepare to add generic guest entry/exit callbacks 2013-01-27 20:35:40 +01:00
topology.c [IA64] Resolve name space collision for cache_show() 2012-11-07 15:51:04 -08:00
traps.c taint: add explicit flag to show whether lock dep is still OK. 2013-01-21 17:17:57 +10:30
unaligned.c [IA64] use __ratelimit 2010-05-18 14:45:54 -07:00
uncached.c Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
unwind.c Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
unwind_decoder.c
unwind_i.h
vmlinux.lds.S Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00