summaryrefslogtreecommitdiffstats
path: root/runtime/sym.c
diff options
context:
space:
mode:
authorWilliam Cohen <wcohen@redhat.com>2009-04-23 11:13:59 -0400
committerWilliam Cohen <wcohen@redhat.com>2009-04-23 11:13:59 -0400
commit927dab9f7b4298b4ef28ae87cdb7dafe43e5d76a (patch)
tree1cd2cc946800969a9816883a8b2f2edc27caccdb /runtime/sym.c
parent1e0a708d560ed69405e94a45d11067abae7f79a5 (diff)
parent4fecf7f1c9fd8ae54ff13677c710b75a10d8cc91 (diff)
downloadsystemtap-steved-927dab9f7b4298b4ef28ae87cdb7dafe43e5d76a.tar.gz
systemtap-steved-927dab9f7b4298b4ef28ae87cdb7dafe43e5d76a.tar.xz
systemtap-steved-927dab9f7b4298b4ef28ae87cdb7dafe43e5d76a.zip
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
Diffstat (limited to 'runtime/sym.c')
-rw-r--r--runtime/sym.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/runtime/sym.c b/runtime/sym.c
index f6f97ac2..013edd0c 100644
--- a/runtime/sym.c
+++ b/runtime/sym.c
@@ -329,8 +329,35 @@ static void _stp_symbol_print(unsigned long address)
}
}
+/** Print an user space address from a specific task symbolically.
+ * @param address The address to lookup.
+ * @param task The address to lookup.
+ * @note Symbolic lookups should not normally be done within
+ * a probe because it is too time-consuming. Use at module exit time.
+ */
+
+static void _stp_usymbol_print(unsigned long address, struct task_struct *task)
+{
+ const char *modname;
+ const char *name;
+ unsigned long offset, size;
+
+ name = _stp_kallsyms_lookup(address, &size, &offset, &modname, NULL,
+ task);
+
+ _stp_printf("%p", (int64_t) address);
+
+ if (name) {
+ if (modname && *modname)
+ _stp_printf(" : %s+%#lx/%#lx [%s]", name, offset, size, modname);
+ else
+ _stp_printf(" : %s+%#lx/%#lx", name, offset, size);
+ }
+}
+
/* Like _stp_symbol_print, except only print if the address is a valid function address */
-static int _stp_func_print(unsigned long address, int verbose, int exact)
+static int _stp_func_print(unsigned long address, int verbose, int exact,
+ struct task_struct *task)
{
const char *modname;
const char *name;
@@ -342,7 +369,7 @@ static int _stp_func_print(unsigned long address, int verbose, int exact)
else
exstr = " (inexact)";
- name = _stp_kallsyms_lookup(address, &size, &offset, &modname, NULL, NULL);
+ name = _stp_kallsyms_lookup(address, &size, &offset, &modname, NULL, task);
if (name) {
if (verbose) {