<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/arch/x86/kernel/dumpstack_32.c, branch v3.14</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>dump_stack: unify debug information printed by show_regs()</title>
<updated>2013-05-01T00:04:02+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2013-04-30T22:27:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=a43cb95d547a061ed5bf1acb28e0f5fd575e26c1'/>
<id>a43cb95d547a061ed5bf1acb28e0f5fd575e26c1</id>
<content type='text'>
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:[&lt;ffffffff8234a07e&gt;]  [&lt;ffffffff8234a07e&gt;] 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:
  [&lt;ffffffff81000312&gt;] do_one_initcall+0x122/0x170
  [&lt;ffffffff82335e5d&gt;] kernel_init_freeable+0x9b/0x1c8
  [&lt;ffffffff81c47760&gt;] ? rest_init+0x140/0x140
  [&lt;ffffffff81c4776e&gt;] kernel_init+0xe/0xf0
  [&lt;ffffffff81c6be9c&gt;] ret_from_fork+0x7c/0xb0
  [&lt;ffffffff81c47760&gt;] ? 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 &lt;tj@kernel.org&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
Acked-by: Jesper Nilsson &lt;jesper.nilsson@axis.com&gt;
Cc: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Cc: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Cc: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Cc: Fengguang Wu &lt;fengguang.wu@intel.com&gt;
Cc: Mike Frysinger &lt;vapier@gentoo.org&gt;
Cc: Vineet Gupta &lt;vgupta@synopsys.com&gt;
Cc: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Acked-by: Chris Metcalf &lt;cmetcalf@tilera.com&gt;		[tile bits]
Acked-by: Richard Kuo &lt;rkuo@codeaurora.org&gt;		[hexagon bits]
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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:[&lt;ffffffff8234a07e&gt;]  [&lt;ffffffff8234a07e&gt;] 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:
  [&lt;ffffffff81000312&gt;] do_one_initcall+0x122/0x170
  [&lt;ffffffff82335e5d&gt;] kernel_init_freeable+0x9b/0x1c8
  [&lt;ffffffff81c47760&gt;] ? rest_init+0x140/0x140
  [&lt;ffffffff81c4776e&gt;] kernel_init+0xe/0xf0
  [&lt;ffffffff81c6be9c&gt;] ret_from_fork+0x7c/0xb0
  [&lt;ffffffff81c47760&gt;] ? 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 &lt;tj@kernel.org&gt;
Acked-by: David S. Miller &lt;davem@davemloft.net&gt;
Acked-by: Jesper Nilsson &lt;jesper.nilsson@axis.com&gt;
Cc: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Cc: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Cc: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Cc: Fengguang Wu &lt;fengguang.wu@intel.com&gt;
Cc: Mike Frysinger &lt;vapier@gentoo.org&gt;
Cc: Vineet Gupta &lt;vgupta@synopsys.com&gt;
Cc: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Acked-by: Chris Metcalf &lt;cmetcalf@tilera.com&gt;		[tile bits]
Acked-by: Richard Kuo &lt;rkuo@codeaurora.org&gt;		[hexagon bits]
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86: Move call to print_modules() out of show_regs()</title>
<updated>2012-06-20T12:33:48+00:00</updated>
<author>
<name>Jan Beulich</name>
<email>JBeulich@suse.com</email>
</author>
<published>2012-06-18T10:40:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=0fa0e2f02e8edfbdb5f86d1cab0fa6dc0517489f'/>
<id>0fa0e2f02e8edfbdb5f86d1cab0fa6dc0517489f</id>
<content type='text'>
Printing the list of loaded modules is really unrelated to what
this function is about, and is particularly unnecessary in the
context of the SysRQ key handling (gets printed so far over and
over).

It should really be the caller of the function to decide whether
this piece of information is useful (and to avoid redundantly
printing it).

Signed-off-by: Jan Beulich &lt;jbeulich@suse.com&gt;
Link: http://lkml.kernel.org/r/4FDF21A4020000780008A67F@nat28.tlf.novell.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Printing the list of loaded modules is really unrelated to what
this function is about, and is particularly unnecessary in the
context of the SysRQ key handling (gets printed so far over and
over).

It should really be the caller of the function to decide whether
this piece of information is useful (and to avoid redundantly
printing it).

Signed-off-by: Jan Beulich &lt;jbeulich@suse.com&gt;
Link: http://lkml.kernel.org/r/4FDF21A4020000780008A67F@nat28.tlf.novell.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86/debug: Add KERN_&lt;LEVEL&gt; to bare printks, convert printks to pr_&lt;level&gt;</title>
<updated>2012-06-06T07:17:22+00:00</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2012-05-22T02:50:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=c767a54ba0657e52e6edaa97cbe0b0a8bf1c1655'/>
<id>c767a54ba0657e52e6edaa97cbe0b0a8bf1c1655</id>
<content type='text'>
Use a more current logging style:

 - Bare printks should have a KERN_&lt;LEVEL&gt; for consistency's sake
 - Add pr_fmt where appropriate
 - Neaten some macro definitions
 - Convert some Ok output to OK
 - Use "%s: ", __func__ in pr_fmt for summit
 - Convert some printks to pr_&lt;level&gt;

Message output is not identical in all cases.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Cc: levinsasha928@gmail.com
Link: http://lkml.kernel.org/r/1337655007.24226.10.camel@joe2Laptop
[ merged two similar patches, tidied up the changelog ]
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use a more current logging style:

 - Bare printks should have a KERN_&lt;LEVEL&gt; for consistency's sake
 - Add pr_fmt where appropriate
 - Neaten some macro definitions
 - Convert some Ok output to OK
 - Use "%s: ", __func__ in pr_fmt for summit
 - Convert some printks to pr_&lt;level&gt;

Message output is not identical in all cases.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Cc: levinsasha928@gmail.com
Link: http://lkml.kernel.org/r/1337655007.24226.10.camel@joe2Laptop
[ merged two similar patches, tidied up the changelog ]
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86: Avoid double stack traces with show_regs()</title>
<updated>2012-05-09T09:44:42+00:00</updated>
<author>
<name>Jan Beulich</name>
<email>JBeulich@suse.com</email>
</author>
<published>2012-05-09T07:47:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=57da8b960b9a25646a8ddb5a9c1d0b5978e69bec'/>
<id>57da8b960b9a25646a8ddb5a9c1d0b5978e69bec</id>
<content type='text'>
What was called show_registers() so far already showed a stack
trace for kernel faults, and kernel_stack_pointer() isn't even
valid to be used for faults from user mode, hence it was
pointless for show_regs() to call show_trace() after
show_registers().

Simply rename show_registers() to show_regs() and eliminate
the old definition.

Signed-off-by: Jan Beulich &lt;jbeulich@suse.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Link: http://lkml.kernel.org/r/4FAA3D3902000078000826E1@nat28.tlf.novell.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
What was called show_registers() so far already showed a stack
trace for kernel faults, and kernel_stack_pointer() isn't even
valid to be used for faults from user mode, hence it was
pointless for show_regs() to call show_trace() after
show_registers().

Simply rename show_registers() to show_regs() and eliminate
the old definition.

Signed-off-by: Jan Beulich &lt;jbeulich@suse.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Link: http://lkml.kernel.org/r/4FAA3D3902000078000826E1@nat28.tlf.novell.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86/32: Print control and debug registers for kerenel context</title>
<updated>2012-03-08T09:57:35+00:00</updated>
<author>
<name>Jan Beulich</name>
<email>JBeulich@suse.com</email>
</author>
<published>2012-03-08T09:23:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=c7e23289a6aa95048a78b252b462f24ca6cf7f96'/>
<id>c7e23289a6aa95048a78b252b462f24ca6cf7f96</id>
<content type='text'>
While for a user mode register dump it may be reasonable to skip
those (albeit x86-64 doesn't do so), for kernel mode dumps these
should be printed to make sure all information possibly
necessary for analysis is available.

Signed-off-by: Jan Beulich &lt;jbeulich@suse.com&gt;
Link: http://lkml.kernel.org/r/4F58889202000078000770E7@nat28.tlf.novell.com
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While for a user mode register dump it may be reasonable to skip
those (albeit x86-64 doesn't do so), for kernel mode dumps these
should be printed to make sure all information possibly
necessary for analysis is available.

Signed-off-by: Jan Beulich &lt;jbeulich@suse.com&gt;
Link: http://lkml.kernel.org/r/4F58889202000078000770E7@nat28.tlf.novell.com
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86, dumpstack: Fix code bytes breakage due to missing KERN_CONT</title>
<updated>2011-12-19T21:09:56+00:00</updated>
<author>
<name>Clemens Ladisch</name>
<email>clemens@ladisch.de</email>
</author>
<published>2011-12-19T21:07:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=13f541c10b30fc6529200d7f9a0073217709622f'/>
<id>13f541c10b30fc6529200d7f9a0073217709622f</id>
<content type='text'>
When printing the code bytes in show_registers(), the markers around the
byte at the fault address could make the printk() format string look
like a valid log level and facility code.  This would prevent this byte
from being printed and result in a spurious newline:

[ 7555.765589] Code: 8b 32 e9 94 00 00 00 81 7d 00 ff 00 00 00 0f 87 96 00 00 00 48 8b 83 c0 00 00 00 44 89 e2 44 89 e6 48 89 df 48 8b 80 d8 02 00 00
[ 7555.765683]  8b 48 28 48 89 d0 81 e2 ff 0f 00 00 48 c1 e8 0c 48 c1 e0 04

Add KERN_CONT where needed, and elsewhere in show_registers() for
consistency.

Signed-off-by: Clemens Ladisch &lt;clemens@ladisch.de&gt;
Link: http://lkml.kernel.org/r/4EEFA7AE.9020407@ladisch.de
Signed-off-by: H. Peter Anvin &lt;hpa@linux.intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When printing the code bytes in show_registers(), the markers around the
byte at the fault address could make the printk() format string look
like a valid log level and facility code.  This would prevent this byte
from being printed and result in a spurious newline:

[ 7555.765589] Code: 8b 32 e9 94 00 00 00 81 7d 00 ff 00 00 00 0f 87 96 00 00 00 48 8b 83 c0 00 00 00 44 89 e2 44 89 e6 48 89 df 48 8b 80 d8 02 00 00
[ 7555.765683]  8b 48 28 48 89 d0 81 e2 ff 0f 00 00 48 c1 e8 0c 48 c1 e0 04

Add KERN_CONT where needed, and elsewhere in show_registers() for
consistency.

Signed-off-by: Clemens Ladisch &lt;clemens@ladisch.de&gt;
Link: http://lkml.kernel.org/r/4EEFA7AE.9020407@ladisch.de
Signed-off-by: H. Peter Anvin &lt;hpa@linux.intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86, dumpstack: Correct stack dump info when frame pointer is available</title>
<updated>2011-03-18T09:51:42+00:00</updated>
<author>
<name>Namhyung Kim</name>
<email>namhyung@gmail.com</email>
</author>
<published>2011-03-18T02:40:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=e8e999cf3cc733482e390b02ff25a64cecdc0b64'/>
<id>e8e999cf3cc733482e390b02ff25a64cecdc0b64</id>
<content type='text'>
Current stack dump code scans entire stack and check each entry
contains a pointer to kernel code. If CONFIG_FRAME_POINTER=y it
could mark whether the pointer is valid or not based on value of
the frame pointer. Invalid entries could be preceded by '?' sign.

However this was not going to happen because scan start point
was always higher than the frame pointer so that they could not
meet.

Commit 9c0729dc8062 ("x86: Eliminate bp argument from the stack
tracing routines") delayed bp acquisition point, so the bp was
read in lower frame, thus all of the entries were marked
invalid.

This patch fixes this by reverting above commit while retaining
stack_frame() helper as suggested by Frederic Weisbecker.

End result looks like below:

before:

 [    3.508329] Call Trace:
 [    3.508551]  [&lt;ffffffff814f35c9&gt;] ? panic+0x91/0x199
 [    3.508662]  [&lt;ffffffff814f3739&gt;] ? printk+0x68/0x6a
 [    3.508770]  [&lt;ffffffff81a981b2&gt;] ? mount_block_root+0x257/0x26e
 [    3.508876]  [&lt;ffffffff81a9821f&gt;] ? mount_root+0x56/0x5a
 [    3.508975]  [&lt;ffffffff81a98393&gt;] ? prepare_namespace+0x170/0x1a9
 [    3.509216]  [&lt;ffffffff81a9772b&gt;] ? kernel_init+0x1d2/0x1e2
 [    3.509335]  [&lt;ffffffff81003894&gt;] ? kernel_thread_helper+0x4/0x10
 [    3.509442]  [&lt;ffffffff814f6880&gt;] ? restore_args+0x0/0x30
 [    3.509542]  [&lt;ffffffff81a97559&gt;] ? kernel_init+0x0/0x1e2
 [    3.509641]  [&lt;ffffffff81003890&gt;] ? kernel_thread_helper+0x0/0x10

after:

 [    3.522991] Call Trace:
 [    3.523351]  [&lt;ffffffff814f35b9&gt;] panic+0x91/0x199
 [    3.523468]  [&lt;ffffffff814f3729&gt;] ? printk+0x68/0x6a
 [    3.523576]  [&lt;ffffffff81a981b2&gt;] mount_block_root+0x257/0x26e
 [    3.523681]  [&lt;ffffffff81a9821f&gt;] mount_root+0x56/0x5a
 [    3.523780]  [&lt;ffffffff81a98393&gt;] prepare_namespace+0x170/0x1a9
 [    3.523885]  [&lt;ffffffff81a9772b&gt;] kernel_init+0x1d2/0x1e2
 [    3.523987]  [&lt;ffffffff81003894&gt;] kernel_thread_helper+0x4/0x10
 [    3.524228]  [&lt;ffffffff814f6880&gt;] ? restore_args+0x0/0x30
 [    3.524345]  [&lt;ffffffff81a97559&gt;] ? kernel_init+0x0/0x1e2
 [    3.524445]  [&lt;ffffffff81003890&gt;] ? kernel_thread_helper+0x0/0x10

 -v5:
   * fix build breakage with oprofile

 -v4:
   * use 0 instead of regs-&gt;bp
   * separate out printk changes

 -v3:
   * apply comment from Frederic
   * add a couple of printk fixes

Signed-off-by: Namhyung Kim &lt;namhyung@gmail.com&gt;
Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Acked-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Soren Sandmann &lt;ssp@redhat.com&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Cc: Robert Richter &lt;robert.richter@amd.com&gt;
LKML-Reference: &lt;1300416006-3163-1-git-send-email-namhyung@gmail.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Current stack dump code scans entire stack and check each entry
contains a pointer to kernel code. If CONFIG_FRAME_POINTER=y it
could mark whether the pointer is valid or not based on value of
the frame pointer. Invalid entries could be preceded by '?' sign.

However this was not going to happen because scan start point
was always higher than the frame pointer so that they could not
meet.

Commit 9c0729dc8062 ("x86: Eliminate bp argument from the stack
tracing routines") delayed bp acquisition point, so the bp was
read in lower frame, thus all of the entries were marked
invalid.

This patch fixes this by reverting above commit while retaining
stack_frame() helper as suggested by Frederic Weisbecker.

End result looks like below:

before:

 [    3.508329] Call Trace:
 [    3.508551]  [&lt;ffffffff814f35c9&gt;] ? panic+0x91/0x199
 [    3.508662]  [&lt;ffffffff814f3739&gt;] ? printk+0x68/0x6a
 [    3.508770]  [&lt;ffffffff81a981b2&gt;] ? mount_block_root+0x257/0x26e
 [    3.508876]  [&lt;ffffffff81a9821f&gt;] ? mount_root+0x56/0x5a
 [    3.508975]  [&lt;ffffffff81a98393&gt;] ? prepare_namespace+0x170/0x1a9
 [    3.509216]  [&lt;ffffffff81a9772b&gt;] ? kernel_init+0x1d2/0x1e2
 [    3.509335]  [&lt;ffffffff81003894&gt;] ? kernel_thread_helper+0x4/0x10
 [    3.509442]  [&lt;ffffffff814f6880&gt;] ? restore_args+0x0/0x30
 [    3.509542]  [&lt;ffffffff81a97559&gt;] ? kernel_init+0x0/0x1e2
 [    3.509641]  [&lt;ffffffff81003890&gt;] ? kernel_thread_helper+0x0/0x10

after:

 [    3.522991] Call Trace:
 [    3.523351]  [&lt;ffffffff814f35b9&gt;] panic+0x91/0x199
 [    3.523468]  [&lt;ffffffff814f3729&gt;] ? printk+0x68/0x6a
 [    3.523576]  [&lt;ffffffff81a981b2&gt;] mount_block_root+0x257/0x26e
 [    3.523681]  [&lt;ffffffff81a9821f&gt;] mount_root+0x56/0x5a
 [    3.523780]  [&lt;ffffffff81a98393&gt;] prepare_namespace+0x170/0x1a9
 [    3.523885]  [&lt;ffffffff81a9772b&gt;] kernel_init+0x1d2/0x1e2
 [    3.523987]  [&lt;ffffffff81003894&gt;] kernel_thread_helper+0x4/0x10
 [    3.524228]  [&lt;ffffffff814f6880&gt;] ? restore_args+0x0/0x30
 [    3.524345]  [&lt;ffffffff81a97559&gt;] ? kernel_init+0x0/0x1e2
 [    3.524445]  [&lt;ffffffff81003890&gt;] ? kernel_thread_helper+0x0/0x10

 -v5:
   * fix build breakage with oprofile

 -v4:
   * use 0 instead of regs-&gt;bp
   * separate out printk changes

 -v3:
   * apply comment from Frederic
   * add a couple of printk fixes

Signed-off-by: Namhyung Kim &lt;namhyung@gmail.com&gt;
Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Acked-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Soren Sandmann &lt;ssp@redhat.com&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Cc: Robert Richter &lt;robert.richter@amd.com&gt;
LKML-Reference: &lt;1300416006-3163-1-git-send-email-namhyung@gmail.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86: Eliminate bp argument from the stack tracing routines</title>
<updated>2010-11-18T13:37:34+00:00</updated>
<author>
<name>Soeren Sandmann Pedersen</name>
<email>sandmann@redhat.com</email>
</author>
<published>2010-11-05T09:59:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=9c0729dc8062bed96189bd14ac6d4920f3958743'/>
<id>9c0729dc8062bed96189bd14ac6d4920f3958743</id>
<content type='text'>
The various stack tracing routines take a 'bp' argument in which the
caller is supposed to provide the base pointer to use, or 0 if doesn't
have one. Since bp is garbage whenever CONFIG_FRAME_POINTER is not
defined, this means all callers in principle should either always pass
0, or be conditional on CONFIG_FRAME_POINTER.

However, there are only really three use cases for stack tracing:

(a) Trace the current task, including IRQ stack if any
(b) Trace the current task, but skip IRQ stack
(c) Trace some other task

In all cases, if CONFIG_FRAME_POINTER is not defined, bp should just
be 0.  If it _is_ defined, then

- in case (a) bp should be gotten directly from the CPU's register, so
  the caller should pass NULL for regs,

- in case (b) the caller should should pass the IRQ registers to
  dump_trace(),

- in case (c) bp should be gotten from the top of the task's stack, so
  the caller should pass NULL for regs.

Hence, the bp argument is not necessary because the combination of
task and regs is sufficient to determine an appropriate value for bp.

This patch introduces a new inline function stack_frame(task, regs)
that computes the desired bp. This function is then called from the
two versions of dump_stack().

Signed-off-by: Soren Sandmann &lt;ssp@redhat.com&gt;
Acked-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Arjan van de Ven &lt;arjan@infradead.org&gt;,
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;,
Cc: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;,
LKML-Reference: &lt;m3oc9rop28.fsf@dhcp-100-3-82.bos.redhat.com&gt;&gt;
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The various stack tracing routines take a 'bp' argument in which the
caller is supposed to provide the base pointer to use, or 0 if doesn't
have one. Since bp is garbage whenever CONFIG_FRAME_POINTER is not
defined, this means all callers in principle should either always pass
0, or be conditional on CONFIG_FRAME_POINTER.

However, there are only really three use cases for stack tracing:

(a) Trace the current task, including IRQ stack if any
(b) Trace the current task, but skip IRQ stack
(c) Trace some other task

In all cases, if CONFIG_FRAME_POINTER is not defined, bp should just
be 0.  If it _is_ defined, then

- in case (a) bp should be gotten directly from the CPU's register, so
  the caller should pass NULL for regs,

- in case (b) the caller should should pass the IRQ registers to
  dump_trace(),

- in case (c) bp should be gotten from the top of the task's stack, so
  the caller should pass NULL for regs.

Hence, the bp argument is not necessary because the combination of
task and regs is sufficient to determine an appropriate value for bp.

This patch introduces a new inline function stack_frame(task, regs)
that computes the desired bp. This function is then called from the
two versions of dump_stack().

Signed-off-by: Soren Sandmann &lt;ssp@redhat.com&gt;
Acked-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Arjan van de Ven &lt;arjan@infradead.org&gt;,
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;,
Cc: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;,
LKML-Reference: &lt;m3oc9rop28.fsf@dhcp-100-3-82.bos.redhat.com&gt;&gt;
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86, printk: Get rid of &lt;0&gt; from stack output</title>
<updated>2010-10-23T18:03:03+00:00</updated>
<author>
<name>Jiri Slaby</name>
<email>jslaby@suse.cz</email>
</author>
<published>2010-10-20T14:48:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=e4072a9a9d186fe86293effe8828faa4be75b4a4'/>
<id>e4072a9a9d186fe86293effe8828faa4be75b4a4</id>
<content type='text'>
The stack output currently looks like this:

 7fffffffffffffff 0000000a00000000 ffffffff81093341 0000000000000046
&lt;0&gt; ffff88003a545fd8 0000000000000000 0000000000000000 00007fffa39769c0
&lt;0&gt; ffff88003e403f58 ffffffff8102fc4c ffff88003e403f58 ffff88003e403f78

The superfluous &lt;0&gt; are caused by recent printk KERN_CONT
change. &lt;*&gt; is now ignored in printk unless some text follows
the level and even then it still has to be the first in the
format message.

Note that the log_lvl parameter is now completely ignored in
show_stack_log_lvl and the stack is dumped with the default
level (like for quite some time already). It behaves the same as
the rest of the dump, function traces are dumped in the very
same manner. Only Code and maybe some lines are printed with
EMERG level.

Unfortunately I see no way how to fix this conceptually to have
the whole oops/BUG/panic output with the same level, so this
removed only the superfluous characters for the time being.

Just for illustration:

&lt;4&gt;Process kworker/0:0 (pid: 0, threadinfo ffff88003c8a6000, task ffff88003c85c100)
&lt;0&gt;Stack:
&lt;4&gt; ffffffff818022c0 0000000a00000001 0000000000000001 0000000000000046
&lt;4&gt; ffff88003c8a7fd8 0000000000000001 ffff88003c8a7e58 0000000000000000
&lt;4&gt; ffff88003e503f48 ffffffff8102fc4c ffff88003e503f48 ffff88003e503f68
&lt;0&gt;Call Trace:
&lt;0&gt; &lt;IRQ&gt;
&lt;4&gt; [&lt;ffffffff8102fc4c&gt;] ? call_softirq+0x1c/0x30 ...
&lt;0&gt;Code: 00 01 00 00 65 8b 04 25 80 c5 00 00 c7 45 ...

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Cc: jirislaby@gmail.com
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
LKML-Reference: &lt;1287586131-16222-1-git-send-email-jslaby@suse.cz&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The stack output currently looks like this:

 7fffffffffffffff 0000000a00000000 ffffffff81093341 0000000000000046
&lt;0&gt; ffff88003a545fd8 0000000000000000 0000000000000000 00007fffa39769c0
&lt;0&gt; ffff88003e403f58 ffffffff8102fc4c ffff88003e403f58 ffff88003e403f78

The superfluous &lt;0&gt; are caused by recent printk KERN_CONT
change. &lt;*&gt; is now ignored in printk unless some text follows
the level and even then it still has to be the first in the
format message.

Note that the log_lvl parameter is now completely ignored in
show_stack_log_lvl and the stack is dumped with the default
level (like for quite some time already). It behaves the same as
the rest of the dump, function traces are dumped in the very
same manner. Only Code and maybe some lines are printed with
EMERG level.

Unfortunately I see no way how to fix this conceptually to have
the whole oops/BUG/panic output with the same level, so this
removed only the superfluous characters for the time being.

Just for illustration:

&lt;4&gt;Process kworker/0:0 (pid: 0, threadinfo ffff88003c8a6000, task ffff88003c85c100)
&lt;0&gt;Stack:
&lt;4&gt; ffffffff818022c0 0000000a00000001 0000000000000001 0000000000000046
&lt;4&gt; ffff88003c8a7fd8 0000000000000001 ffff88003c8a7e58 0000000000000000
&lt;4&gt; ffff88003e503f48 ffffffff8102fc4c ffff88003e503f48 ffff88003e503f68
&lt;0&gt;Call Trace:
&lt;0&gt; &lt;IRQ&gt;
&lt;4&gt; [&lt;ffffffff8102fc4c&gt;] ? call_softirq+0x1c/0x30 ...
&lt;0&gt;Code: 00 01 00 00 65 8b 04 25 80 c5 00 00 c7 45 ...

Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Cc: jirislaby@gmail.com
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
LKML-Reference: &lt;1287586131-16222-1-git-send-email-jslaby@suse.cz&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86: Unify dumpstack.h and stacktrace.h</title>
<updated>2010-06-08T21:29:52+00:00</updated>
<author>
<name>Frederic Weisbecker</name>
<email>fweisbec@gmail.com</email>
</author>
<published>2010-05-19T19:35:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=c9cf4dbb4d9ca715d8fedf13301a53296429abc6'/>
<id>c9cf4dbb4d9ca715d8fedf13301a53296429abc6</id>
<content type='text'>
arch/x86/include/asm/stacktrace.h and arch/x86/kernel/dumpstack.h
declare headers of objects that deal with the same topic.
Actually most of the files that include stacktrace.h also include
dumpstack.h

Although dumpstack.h seems more reserved for internals of stack
traces, those are quite often needed to define specialized stack
trace operations. And perf event arch headers are going to need
access to such low level operations anyway. So don't continue to
bother with dumpstack.h as it's not anymore about isolated deep
internals.

v2: fix struct stack_frame definition conflict in sysprof

Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Soeren Sandmann &lt;sandmann@daimi.au.dk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
arch/x86/include/asm/stacktrace.h and arch/x86/kernel/dumpstack.h
declare headers of objects that deal with the same topic.
Actually most of the files that include stacktrace.h also include
dumpstack.h

Although dumpstack.h seems more reserved for internals of stack
traces, those are quite often needed to define specialized stack
trace operations. And perf event arch headers are going to need
access to such low level operations anyway. So don't continue to
bother with dumpstack.h as it's not anymore about isolated deep
internals.

v2: fix struct stack_frame definition conflict in sysprof

Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Soeren Sandmann &lt;sandmann@daimi.au.dk&gt;
</pre>
</div>
</content>
</entry>
</feed>
