summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhunt <hunt>2007-05-16 01:56:12 +0000
committerhunt <hunt>2007-05-16 01:56:12 +0000
commit4f295b51c85ada0efca7594604ada44853ac32d5 (patch)
treea742fc02095a3eb655d6caa0f612790e72dbd6eb
parent3c3dbd3bc57a1db3972ee9ebbf15d95402375146 (diff)
downloadsystemtap-steved-4f295b51c85ada0efca7594604ada44853ac32d5.tar.gz
systemtap-steved-4f295b51c85ada0efca7594604ada44853ac32d5.tar.xz
systemtap-steved-4f295b51c85ada0efca7594604ada44853ac32d5.zip
2007-05-15 Martin Hunt <hunt@redhat.com>
* vsprintf.c: Add comment about %p. * regs.c, stack*.c, sym.c: Fix %p calls.
-rw-r--r--runtime/ChangeLog5
-rw-r--r--runtime/regs.c2
-rw-r--r--runtime/stack-i386.c6
-rw-r--r--runtime/stack-ia64.c2
-rw-r--r--runtime/stack-ppc64.c8
-rw-r--r--runtime/stack-s390.c12
-rw-r--r--runtime/stack-x86_64.c4
-rw-r--r--runtime/stack.c6
-rw-r--r--runtime/sym.c4
-rw-r--r--runtime/vsprintf.c1
10 files changed, 28 insertions, 22 deletions
diff --git a/runtime/ChangeLog b/runtime/ChangeLog
index f7b7e84d..d2cd0404 100644
--- a/runtime/ChangeLog
+++ b/runtime/ChangeLog
@@ -1,3 +1,8 @@
+2007-05-15 Martin Hunt <hunt@redhat.com>
+
+ * vsprintf.c: Add comment about %p.
+ * regs.c, stack*.c, sym.c: Fix %p calls.
+
2007-04-27 Martin Hunt <hunt@redhat.com>
* runtime.h: Improve check for debugfs in kernel.
diff --git a/runtime/regs.c b/runtime/regs.c
index ead4ed8f..227a237e 100644
--- a/runtime/regs.c
+++ b/runtime/regs.c
@@ -184,7 +184,7 @@ void _stp_print_regs(struct pt_regs * regs)
_stp_printf("NIP: %016lX XER: %08X LR: %016lX CTR: %016lX\n",
regs->nip, (unsigned int)regs->xer, regs->link, regs->ctr);
- _stp_printf("REGS: %p TRAP: %04lx\n", regs, regs->trap);
+ _stp_printf("REGS: %016lx TRAP: %04lx\n", (long)regs, regs->trap);
_stp_printf("MSR: %016lx CR: %08X\n",
regs->msr, (unsigned int)regs->ccr);
_stp_printf("DAR: %016lx DSISR: %016lx\n",
diff --git a/runtime/stack-i386.c b/runtime/stack-i386.c
index d10a8cfe..161e22ee 100644
--- a/runtime/stack-i386.c
+++ b/runtime/stack-i386.c
@@ -31,7 +31,7 @@ _stp_show_trace_unwind(struct unwind_frame_info *info, int verbose)
_stp_symbol_print (UNW_PC(info));
_stp_print_char ('\n');
} else
- _stp_printf ("%p ", UNW_PC(info));
+ _stp_printf ("0x%08lx ", UNW_PC(info));
if (arch_unw_user_mode(info))
break;
}
@@ -78,7 +78,7 @@ static void __stp_stack_print (struct pt_regs *regs, int verbose, int levels)
_stp_symbol_print (addr);
_stp_print_char('\n');
} else
- _stp_printf ("%p ", (void *)addr);
+ _stp_printf ("0x%08lx ", addr);
ebp = *(unsigned long *)ebp;
}
}
@@ -95,7 +95,7 @@ static void __stp_stack_print (struct pt_regs *regs, int verbose, int levels)
_stp_symbol_print(addr);
_stp_print_char('\n');
} else
- _stp_printf ("%p ", (void *)addr);
+ _stp_printf ("0x%08lx ", addr);
}
}
#endif
diff --git a/runtime/stack-ia64.c b/runtime/stack-ia64.c
index 4ad045da..cab25a0b 100644
--- a/runtime/stack-ia64.c
+++ b/runtime/stack-ia64.c
@@ -44,7 +44,7 @@ static void __stp_show_stack_addr(struct unw_frame_info *info, void *arg)
skip = 0;
continue;
}
- _stp_printf ("%p ", ip);
+ _stp_printf ("0x%016lx ", ip);
} while (unw_unwind(info) >= 0);
}
diff --git a/runtime/stack-ppc64.c b/runtime/stack-ppc64.c
index 4d4e49bb..3dc38526 100644
--- a/runtime/stack-ppc64.c
+++ b/runtime/stack-ppc64.c
@@ -23,14 +23,14 @@ static void __stp_stack_print (struct pt_regs *regs, int verbose, int levels)
ip = _sp[2];
if (!firstframe || ip != lr) {
if (verbose) {
- _stp_printf("[%p] [%p] ", sp, ip);
+ _stp_printf("[0x%016lx] [0x%016lx] ", sp, ip);
_stp_symbol_print(ip);
if (firstframe)
_stp_print(" (unreliable)");
_stp_print_char('\n');
}
else
- _stp_printf("%p ", ip);
+ _stp_printf("0x%016lx ", ip);
}
firstframe = 0;
/*
@@ -51,8 +51,8 @@ static void __stp_stack_print (struct pt_regs *regs, int verbose, int levels)
firstframe = 1;
}
else {
- _stp_printf("%p ",regs->nip);
- _stp_printf("%p ",regs->link);
+ _stp_printf("0x%016lx ",regs->nip);
+ _stp_printf("0x%016lx ",regs->link);
}
}
diff --git a/runtime/stack-s390.c b/runtime/stack-s390.c
index fcf634ed..c9654102 100644
--- a/runtime/stack-s390.c
+++ b/runtime/stack-s390.c
@@ -24,11 +24,11 @@ __stp_show_stack (unsigned long sp, unsigned long low,
sf = (struct stack_frame *) sp;
ip = sf->gprs[8] & PSW_ADDR_INSN;
if (verbose) {
- _stp_printf("[%p] [%p] ", sp, ip);
+ _stp_printf("[%p] [%p] ", (int64_t)sp, (int64_t)ip);
_stp_symbol_print(ip);
_stp_print_char('\n');
}else{
- _stp_printf("%p ", ip);
+ _stp_printf("%p ", (int64_t)ip);
}
/* Follow the back_chain */
while (1) {
@@ -41,11 +41,11 @@ __stp_show_stack (unsigned long sp, unsigned long low,
sf = (struct stack_frame *) sp;
ip = sf->gprs[8] & PSW_ADDR_INSN;
if (verbose) {
- _stp_printf("[%p] [%p] ", sp, ip);
+ _stp_printf("[%p] [%p] ", (int64_t)sp, (int64_t)ip);
_stp_symbol_print(ip);
_stp_print_char('\n');
}else{
- _stp_printf("%p ", ip);
+ _stp_printf("%p ", (int64_t)ip);
}
}
/* Zero backchain detected, check for interrupt frame. */
@@ -54,11 +54,11 @@ __stp_show_stack (unsigned long sp, unsigned long low,
return sp;
regs = (struct pt_regs *) sp;
if (verbose) {
- _stp_printf("[%p] [%p] ", sp, ip);
+ _stp_printf("[%p] [%p] ", (int64_t)sp, (int64_t)ip);
_stp_symbol_print(ip);
_stp_print_char('\n');
}else{
- _stp_printf("%p ", ip);
+ _stp_printf("%p ", (int64_t)ip);
}
low = sp;
sp = regs->gprs[15];
diff --git a/runtime/stack-x86_64.c b/runtime/stack-x86_64.c
index b8875edb..15bac801 100644
--- a/runtime/stack-x86_64.c
+++ b/runtime/stack-x86_64.c
@@ -30,7 +30,7 @@ static int _stp_show_trace_unwind(struct unwind_frame_info *info, int verbose)
_stp_symbol_print (UNW_PC(info));
_stp_print_char('\n');
} else
- _stp_printf ("%p ", UNW_PC(info));
+ _stp_printf ("0x%016lx ", UNW_PC(info));
if (arch_unw_user_mode(info))
break;
}
@@ -66,7 +66,7 @@ static void __stp_stack_print (struct pt_regs *regs, int verbose, int levels)
_stp_symbol_print(addr);
_stp_print_char('\n');
} else
- _stp_printf("%p ", (void *)addr);
+ _stp_printf("0x%016lx ", addr);
}
}
}
diff --git a/runtime/stack.c b/runtime/stack.c
index 51be05bd..dcf23e06 100644
--- a/runtime/stack.c
+++ b/runtime/stack.c
@@ -84,7 +84,7 @@ void _stp_stack_print(struct pt_regs *regs, int verbose, struct kretprobe_instan
}
_stp_print_char('\n');
} else
- _stp_printf ("%p ", REG_IP(regs));
+ _stp_printf ("%p ", (int64_t)REG_IP(regs));
__stp_stack_print (regs, verbose, 0);
}
@@ -116,9 +116,9 @@ void _stp_stack_snprint (char *str, int size, struct pt_regs *regs, int verbose,
void _stp_ustack_print (char *str)
{
struct pt_regs *nregs = ((struct pt_regs *) (THREAD_SIZE + (unsigned long) current->thread_info)) - 1;
- _stp_printf ("%p : [user]\n", REG_IP(nregs));
+ _stp_printf ("%p : [user]\n", (int64_t)REG_IP(nregs));
if (REG_SP(nregs))
- _stp_printf ("%p : [user]\n", *(unsigned long *)REG_SP(nregs));
+ _stp_printf ("%p : [user]\n", (int64_t)(*(unsigned long *)REG_SP(nregs)));
}
#endif /* 0 */
diff --git a/runtime/sym.c b/runtime/sym.c
index 8d344b4a..d8ad3f2c 100644
--- a/runtime/sym.c
+++ b/runtime/sym.c
@@ -180,7 +180,7 @@ void _stp_symbol_print (unsigned long address)
name = _stp_kallsyms_lookup(address, &size, &offset, &modname, NULL);
- _stp_printf ("%p", (void *)address);
+ _stp_printf ("%p", (int64_t)address);
if (name) {
if (modname)
@@ -200,7 +200,7 @@ void _stp_symbol_snprint (char *str, size_t len, unsigned long address)
if (name)
strlcpy(str, name, len);
else
- snprintf(str, len, "%p", (void *)address);
+ _stp_snprintf(str, len, "%p", (int64_t)address);
}
/** @} */
diff --git a/runtime/vsprintf.c b/runtime/vsprintf.c
index eb47e156..0e52f5c3 100644
--- a/runtime/vsprintf.c
+++ b/runtime/vsprintf.c
@@ -295,6 +295,7 @@ int _stp_vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
break;
case 'p':
+ /* Note that %p takes an int64_t argument. */
len = 2*sizeof(void *) + 2;
flags |= STP_ZEROPAD;