* [PATCH] powerpc: Use new printk extension %pS to print symbols on oops
@ 2008-07-07 3:44 Benjamin Herrenschmidt
2008-07-07 17:08 ` Linus Torvalds
0 siblings, 1 reply; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2008-07-07 3:44 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Linus Torvalds
This changes the oops and backtrace code to use the new %pS
printk extension to print out symbols rather than manually
calling print_symbol.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kernel/process.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
--- linux-work.orig/arch/powerpc/kernel/process.c 2008-07-07 10:16:53.000000000 +1000
+++ linux-work/arch/powerpc/kernel/process.c 2008-07-07 11:04:32.000000000 +1000
@@ -484,10 +484,8 @@ void show_regs(struct pt_regs * regs)
* Lookup NIP late so we have the best change of getting the
* above info out without failing
*/
- printk("NIP ["REG"] ", regs->nip);
- print_symbol("%s\n", regs->nip);
- printk("LR ["REG"] ", regs->link);
- print_symbol("%s\n", regs->link);
+ printk("NIP ["REG"] %pS\n", regs->nip, (void *)regs->nip);
+ printk("LR ["REG"] %pS\n", regs->link, (void *)regs->link);
#endif
show_stack(current, (unsigned long *) regs->gpr[1]);
if (!user_mode(regs))
@@ -971,8 +969,7 @@ void show_stack(struct task_struct *tsk,
newsp = stack[0];
ip = stack[STACK_FRAME_LR_SAVE];
if (!firstframe || ip != lr) {
- printk("["REG"] ["REG"] ", sp, ip);
- print_symbol("%s", ip);
+ printk("["REG"] ["REG"] %pS", sp, ip, (void *)ip);
if (firstframe)
printk(" (unreliable)");
printk("\n");
@@ -987,10 +984,9 @@ void show_stack(struct task_struct *tsk,
&& stack[STACK_FRAME_MARKER] == STACK_FRAME_REGS_MARKER) {
struct pt_regs *regs = (struct pt_regs *)
(sp + STACK_FRAME_OVERHEAD);
- printk("--- Exception: %lx", regs->trap);
- print_symbol(" at %s\n", regs->nip);
lr = regs->link;
- print_symbol(" LR = %s\n", lr);
+ printk("--- Exception: %lx at %pS\n LR = %pS\n",
+ regs->trap, (void *)regs->nip, (void *)lr);
firstframe = 1;
}
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] powerpc: Use new printk extension %pS to print symbols on oops
2008-07-07 3:44 [PATCH] powerpc: Use new printk extension %pS to print symbols on oops Benjamin Herrenschmidt
@ 2008-07-07 17:08 ` Linus Torvalds
2008-07-07 22:20 ` Benjamin Herrenschmidt
2008-07-27 5:40 ` David Woodhouse
0 siblings, 2 replies; 5+ messages in thread
From: Linus Torvalds @ 2008-07-07 17:08 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
On Mon, 7 Jul 2008, Benjamin Herrenschmidt wrote:
>
> This changes the oops and backtrace code to use the new %pS
> printk extension to print out symbols rather than manually
> calling print_symbol.
Ok, I ended up committing the suppor for '%pS' early (as a series of
smaller patches to make it clearer), just because it makes it easier for
different people to start converthing things with the infrastructure in
place.
But I wasn't planning on actually merging any of the conversions until
after 2.6.26 (ie there will be no actual _users_ of '%pS' in 2.6.26)
Linus
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] powerpc: Use new printk extension %pS to print symbols on oops
2008-07-07 17:08 ` Linus Torvalds
@ 2008-07-07 22:20 ` Benjamin Herrenschmidt
2008-07-27 5:40 ` David Woodhouse
1 sibling, 0 replies; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2008-07-07 22:20 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linuxppc-dev
On Mon, 2008-07-07 at 10:08 -0700, Linus Torvalds wrote:
> > This changes the oops and backtrace code to use the new %pS
> > printk extension to print out symbols rather than manually
> > calling print_symbol.
>
> Ok, I ended up committing the suppor for '%pS' early (as a series of
> smaller patches to make it clearer), just because it makes it easier for
> different people to start converthing things with the infrastructure in
> place.
>
> But I wasn't planning on actually merging any of the conversions until
> after 2.6.26 (ie there will be no actual _users_ of '%pS' in 2.6.26)
That's ok. I posted the patch for review/comments, I didn't intend
to have it merged before .27 opens.
Cheers,
Ben.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] powerpc: Use new printk extension %pS to print symbols on oops
2008-07-07 17:08 ` Linus Torvalds
2008-07-07 22:20 ` Benjamin Herrenschmidt
@ 2008-07-27 5:40 ` David Woodhouse
2008-07-27 17:26 ` Linus Torvalds
1 sibling, 1 reply; 5+ messages in thread
From: David Woodhouse @ 2008-07-27 5:40 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linuxppc-dev
On Mon, 2008-07-07 at 10:08 -0700, Linus Torvalds wrote:
> On Mon, 7 Jul 2008, Benjamin Herrenschmidt wrote:
> >
> > This changes the oops and backtrace code to use the new %pS
> > printk extension to print out symbols rather than manually
> > calling print_symbol.
>
> Ok, I ended up committing the suppor for '%pS' early (as a series of
> smaller patches to make it clearer), just because it makes it easier for
> different people to start converthing things with the infrastructure in
> place.
Out of interest, why is it %pS and not %Sp? Shouldn't the modifier come
first? What if we want to print a pointer immediately followed by a
capital S?
--
David Woodhouse Open Source Technology Centre
David.Woodhouse@intel.com Intel Corporation
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-07-27 17:29 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-07 3:44 [PATCH] powerpc: Use new printk extension %pS to print symbols on oops Benjamin Herrenschmidt
2008-07-07 17:08 ` Linus Torvalds
2008-07-07 22:20 ` Benjamin Herrenschmidt
2008-07-27 5:40 ` David Woodhouse
2008-07-27 17:26 ` Linus Torvalds
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).