linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: systemtap@sourceware.org
Cc: linuxppc-dev@ozlabs.org, Jim Keniston <jkenisto@us.ibm.com>
Subject: [PATCH 4/4] powerpc: Improve backtrace output for ppc32
Date: Fri, 4 Dec 2009 02:32:06 +0300	[thread overview]
Message-ID: <20091203233206.GD3416@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <20091203233059.GA28186@oksana.dev.rtsoft.ru>

0x%016lx format causes a lot of unnecessary zero-padding on ppc32, so
let's use %p instead.

Before:

--- Exception: c00095c8 at 0xc02cff60 : _edata+0x1f60/0x2000 [kernel]
    LR =0xc02aef58 : per_cpu__runqueues+0x0/0x400 [kernel]
[0x00000000c02cfed0] [0x00000000c00113fc] 0xc00113fc : ret_from_except+0x0/0x14 [kernel] (unreliable)

After:

--- Exception: c00095c8 at 0xc02cff60 : _edata+0x1f60/0x2000 [kernel]
    LR =0xc02aef58 : per_cpu__runqueues+0x0/0x400 [kernel]
[0xc02cfed0] [0xc00113fc] 0xc00113fc : ret_from_except+0x0/0x14 [kernel] (unreliable)

p.s.
Note that the second and the third columns are dups, this is because
_stp_symbol_print(ip) also prints ip. Though, for now I wouldn't touch
this since I'm not sure if anybody depends on the current columns count
or "[]" around addresses.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
 runtime/stack-ppc.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/runtime/stack-ppc.c b/runtime/stack-ppc.c
index df2db15..e3b3ede 100644
--- a/runtime/stack-ppc.c
+++ b/runtime/stack-ppc.c
@@ -24,14 +24,15 @@ static void __stp_stack_print (struct pt_regs *regs, int verbose, int levels,
 		ip = _sp[STACK_FRAME_LR_SAVE];
 		if (!firstframe || ip != lr) {
 			if (verbose) {
-				_stp_printf("[0x%016lx] [0x%016lx] ", sp, ip);
+				_stp_printf("[%p] [%p] ",
+					    (int64_t)sp, (int64_t)ip);
 				_stp_symbol_print(ip);
 				if (firstframe)
 					_stp_print(" (unreliable)");
 				_stp_print_char('\n');
 			}
 			else
-				_stp_printf("0x%016lx ", ip);
+				_stp_printf("%p ", (int64_t)ip);
 		}
 		firstframe = 0;
 		/*
@@ -52,8 +53,8 @@ static void __stp_stack_print (struct pt_regs *regs, int verbose, int levels,
 				firstframe = 1;
 			}
 			else {
-				_stp_printf("0x%016lx ",regs->nip);
-				_stp_printf("0x%016lx ",regs->link);
+				_stp_printf("%p ", (int64_t)regs->nip);
+				_stp_printf("%p ", (int64_t)regs->link);
 			}
 		}
 
-- 
1.6.3.3

      parent reply	other threads:[~2009-12-03 23:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-03 23:30 [PATCH 0/4] systemtap: Some more powerpc patches Anton Vorontsov
2009-12-03 23:31 ` [PATCH 1/4] powerpc: Fix thinko in _stp_arg() Anton Vorontsov
2009-12-04  4:21   ` Ananth N Mavinakayanahalli
2009-12-03 23:31 ` [PATCH 2/4] powerpc: Fix longlong args handling Anton Vorontsov
2009-12-03 23:32 ` [PATCH 3/4] powerpc: Adjust registers.stp for ppc32 Anton Vorontsov
2009-12-03 23:32 ` Anton Vorontsov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091203233206.GD3416@oksana.dev.rtsoft.ru \
    --to=avorontsov@ru.mvista.com \
    --cc=jkenisto@us.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=systemtap@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).