public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Jiri Olsa <jolsa@redhat.com>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC/PATCH 2/2] perf probe: Allow weak symbols to be probed
Date: Fri, 6 Mar 2015 15:15:30 +0900	[thread overview]
Message-ID: <20150306061530.GD7872@sejong> (raw)
In-Reply-To: <54F72B61.5060809@hitachi.com>

Hi Masami,

On Thu, Mar 05, 2015 at 12:57:21AM +0900, Masami Hiramatsu wrote:
> (2015/03/04 22:52), Namhyung Kim wrote:
> > It currently prevents adding probes in weak symbols.  But there're cases
> > that given name is an only weak symbol so that we cannot add probe.
> > 
> >   $ perf probe -x /usr/lib/libc.so.6 -a calloc
> >   Failed to find symbol calloc in /usr/lib/libc-2.21.so
> >     Error: Failed to add events.
> > 
> >   $ nm /usr/lib/libc.so.6 | grep calloc
> >   000000000007b1f0 t __calloc
> >   000000000007b1f0 T __libc_calloc
> >   000000000007b1f0 W calloc
> > 
> > This change will result in duplicate probes when strong and weak symbols
> > co-exist in a binary.  But I think it's not a big problem since probes
> > at the weak symbol will never be hit anyway.
> 
> Hmm, even on my previous series, I got an error with calloc and waitpid.
> 
> $ ./perf probe -x /usr/lib64/libc-2.17.so -vvV calloc
> probe-definition(0): calloc
> symbol:calloc file:(null) line:0 offset:0 return:0 lazy:(null)
> 0 arguments
> Open Debuginfo file: /usr/lib/debug/usr/lib64/libc-2.17.so.debug
> Searching variables at calloc
> Failed to find the address of calloc
>   Error: Failed to show vars. Reason: No such file or directory (Code: -2)
> 
> However, it seems that calloc is loaded as a symbol.
> 
> $ ./perf probe -x /usr/lib64/libc-2.17.so -vvvvV calloc
> ...
> symbol__new: __xstat64 0xe7340-0xe7385
> symbol__new: calloc 0x80a90-0x80d2a
> symbol__new: msgget 0xf7940-0xf7961
> ...
> 
> FYI, without these patches, I see the same result (calloc is loaded)

I'm bit confused with the English ;-).  So you mean that now you *can*
probe calloc and waitpid with this patch, right?

Thanks,
Namhyung

  reply	other threads:[~2015-03-06  6:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-04 13:52 [RFC/PATCH 1/2] perf symbols: Allow symbol alias when loading map for symbol name Namhyung Kim
2015-03-04 13:52 ` [RFC/PATCH 2/2] perf probe: Allow weak symbols to be probed Namhyung Kim
2015-03-04 15:57   ` Masami Hiramatsu
2015-03-06  6:15     ` Namhyung Kim [this message]
2015-03-06  6:36       ` Masami Hiramatsu
2015-03-06  7:05   ` Masami Hiramatsu
2015-03-06  7:28     ` Namhyung Kim

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=20150306061530.GD7872@sejong \
    --to=namhyung@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@kernel.org \
    /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