From: David Ahern <dsahern@gmail.com>
To: acme@ghostprotocols.net, linux-kernel@vger.kernel.org
Cc: David Ahern <dsahern@gmail.com>,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Subject: Re: [PATCH] perf probe: Improve error message when function not found
Date: Thu, 26 Dec 2013 08:43:49 -0500 [thread overview]
Message-ID: <52BC3295.3020007@gmail.com> (raw)
In-Reply-To: <1387562649-25929-1-git-send-email-dsahern@gmail.com>
Masami:
If you do not have any problems with this version please Ack so Arnaldo
will pick it up.
Thanks,
David
On 12/20/13, 1:04 PM, David Ahern wrote:
> 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)
>
> yet 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>
>
> diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
> index 9c6989ca2bea..2eac49096840 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 symbol in %s. Is it a global variable?\n",
> + name);
> goto out;
> }
>
>
next prev parent reply other threads:[~2013-12-26 13:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-20 18:04 [PATCH] perf probe: Improve error message when function not found David Ahern
2013-12-26 13:43 ` David Ahern [this message]
2013-12-27 7:34 ` Masami Hiramatsu
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=52BC3295.3020007@gmail.com \
--to=dsahern@gmail.com \
--cc=acme@ghostprotocols.net \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=srikar@linux.vnet.ibm.com \
/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