public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] perf probe: Improve error message when function not found
@ 2013-12-02  0:07 David Ahern
  2013-12-02  0:07 ` [PATCH 2/2] perf probe: Allow user to specify address within executable David Ahern
  2013-12-02  5:59 ` [PATCH 1/2] perf probe: Improve error message when function not found Masami Hiramatsu
  0 siblings, 2 replies; 17+ messages in thread
From: David Ahern @ 2013-12-02  0:07 UTC (permalink / raw)
  To: acme, linux-kernel; +Cc: David Ahern, Masami Hiramatsu, Srikar Dronamraju

When requesting a function from a userspace library the error message to
the user is less than helpful. e.g.,

    perf probe -x /lib64/libpthread-2.14.90.so -a 'lock_full=__pthread_mutex_lock_full'
    no symbols found in /lib64/libpthread-2.14.90.so, maybe install a debug package?
    Failed to load map.
       Error: Failed to add events. (-22)

In this cae the symbol really does exist but is a local symbol which is
filtered:

    nm /lib64/libpthread-2.14.90.so | grep __pthread_mutex_lock_full
    0000000000005700 t __pthread_mutex_lock_full

With this patch:
    perf probe -x /lib64/libpthread-2.14.90.so -a 'lock_full=__pthread_mutex_lock_full'

    no symbols found in /lib64/libpthread-2.14.90.so, maybe install a debug package?
    Failed to find function in /lib64/libpthread-2.14.90.so. Perhaps it is a local variable?
      Error: Failed to add events. (-22)

Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
---
 tools/perf/util/probe-event.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 9c6989ca2bea..638071b7bdd2 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -2309,7 +2309,8 @@ static int convert_name_to_addr(struct perf_probe_event *pev, const char *exec)
 	}
 	available_func_filter = strfilter__new(function, NULL);
 	if (map__load(map, filter_available_functions)) {
-		pr_err("Failed to load map.\n");
+		pr_err("Failed to find requested function in %s. Perhaps it is a local variable?\n",
+		       name);
 		goto out;
 	}
 
-- 
1.8.3.4 (Apple Git-47)


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2013-12-08 17:51 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-02  0:07 [PATCH 1/2] perf probe: Improve error message when function not found David Ahern
2013-12-02  0:07 ` [PATCH 2/2] perf probe: Allow user to specify address within executable David Ahern
2013-12-02  5:53   ` Masami Hiramatsu
2013-12-02  6:15   ` Masami Hiramatsu
2013-12-02 14:49     ` David Ahern
2013-12-02 17:55       ` David Ahern
2013-12-03  9:24         ` Masami Hiramatsu
2013-12-03 15:58           ` David Ahern
2013-12-04  1:22             ` Masami Hiramatsu
2013-12-04  1:44               ` David Ahern
2013-12-04  7:39                 ` Masami Hiramatsu
2013-12-08 17:50                   ` David Ahern
2013-12-02  5:59 ` [PATCH 1/2] perf probe: Improve error message when function not found Masami Hiramatsu
2013-12-02 14:52   ` David Ahern
2013-12-03  5:12     ` Masami Hiramatsu
2013-12-03 15:15       ` David Ahern
2013-12-04  1:23         ` Masami Hiramatsu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox