summaryrefslogtreecommitdiffstats
path: root/runtime/sym.c
diff options
context:
space:
mode:
authorhunt <hunt>2008-01-15 16:57:20 +0000
committerhunt <hunt>2008-01-15 16:57:20 +0000
commit68c2e2a316c7a22d058041dcba205b1e3309477d (patch)
tree39fca2263ea173fee015777ba8ed96f124e642dd /runtime/sym.c
parentd94d159d9524a9b705c2704ca15b5014a24c923e (diff)
downloadsystemtap-steved-68c2e2a316c7a22d058041dcba205b1e3309477d.tar.gz
systemtap-steved-68c2e2a316c7a22d058041dcba205b1e3309477d.tar.xz
systemtap-steved-68c2e2a316c7a22d058041dcba205b1e3309477d.zip
Add support for memory allocation tracking.
Diffstat (limited to 'runtime/sym.c')
-rw-r--r--runtime/sym.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/runtime/sym.c b/runtime/sym.c
index c40f48db..56c93064 100644
--- a/runtime/sym.c
+++ b/runtime/sym.c
@@ -193,7 +193,7 @@ void _stp_symbol_print (unsigned long address)
_stp_printf ("%p", (int64_t)address);
if (name) {
- if (modname)
+ if (modname && *modname)
_stp_printf (" : %s+%#lx/%#lx [%s]", name, offset, size, modname);
else
_stp_printf (" : %s+%#lx/%#lx", name, offset, size);
@@ -202,22 +202,28 @@ void _stp_symbol_print (unsigned long address)
/* Like _stp_symbol_print, except only print if the address is a valid function address */
-void _stp_func_print (unsigned long address, int verbose)
+void _stp_func_print (unsigned long address, int verbose, int exact)
{
char *modname;
const char *name;
unsigned long offset, size;
+ char *exstr;
+
+ if (exact)
+ exstr = "";
+ else
+ exstr = " (inexact)";
name = _stp_kallsyms_lookup(address, &size, &offset, &modname, NULL);
if (name) {
if (verbose) {
- if (modname)
- _stp_printf (" %p : %s+%#lx/%#lx [%s]\n",
- (int64_t)address, name, offset, size, modname);
+ if (modname && *modname)
+ _stp_printf (" %p : %s+%#lx/%#lx [%s]%s\n",
+ (int64_t)address, name, offset, size, modname, exstr);
else
- _stp_printf (" %p : %s+%#lx/%#lx\n",
- (int64_t)address, name, offset, size);
+ _stp_printf (" %p : %s+%#lx/%#lx%s\n",
+ (int64_t)address, name, offset, size, exstr);
} else
_stp_printf ("%p ", (int64_t)address);
}