linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Holger Freyther <automatic+kernel@freyther.de>
Cc: linux-perf-users@vger.kernel.org,
	Holger Hans Peter Freyther <holgar+kernel@google.com>,
	Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>,
	Jiri Olsa <jolsa@kernel.org>, Wang Nan <wangnan0@huawei.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [RFC 0/6] perf probe: Attempt to improve C++ probing
Date: Mon, 14 May 2018 13:11:54 -0300	[thread overview]
Message-ID: <20180514161154.GU13491@kernel.org> (raw)
In-Reply-To: <20180513110617.91669-1-automatic+kernel@freyther.de>

Em Sun, May 13, 2018 at 07:06:11PM +0800, Holger Freyther escreveu:
> From: Holger Hans Peter Freyther <holgar+kernel@google.com>
 
> Currently perf probe -x app --funcs will list and demangle C++ functions
> but the other probe actions can't work with them. When asking probe to not
> demangle it will not list any of the application symbols creating the
> impression that there are no symbols at all.
 
> Make --funcs --no-demangle list all C++ functions and modify the handling
> for listing code, variables and adding the uprobe work with the demangled
> C++ function name.
 
> I tried to keep this as minimal as possible but having to keep the dso in
> the debuginfo and passing it everywhere to be able to demangle the linkage
> name isn't pretty (and for C++ demangling the struct dso is not of much
> use. Maybe having a static "empty" dso could avoid a lot of the changes).
 
> Maybe the easiest first patch is to default to --no-demangle and change
> the DEFAULT_FUNC_FILTER to not include mangled C++ symbols. The remaining
> tooling would work then.
 
> My test set includes:
 
>  ./perf probe -x . -L "std::vector<int, std::allocator<int> >::at"
>  ./perf probe -x . -L "std::vector<int, std::allocator<int> >::at:2-3"
> 
>  ./perf probe -x . -V "std::vector<int, std::allocator<int> >::at"
>  ./perf probe -x . -V "std::vector<int, std::allocator<int> >::at:2"
>  ./perf probe -x . -V "std::vector<int, std::allocator<int> >::size%return"

Great stuff! Masami already gave his Acked-by, please address Namhyung's
concerns and consider adding a 'perf test' entry for C++ symbols found
in libstdc++, placing some probe in place and then running some program
that uses that function, then parsing the output of some tool using that
probe, something like you'll find in "perf test inet_pton", see:

[acme@jouet perf]$ ls -la tools/perf/tests/shell/
total 28
drwxrwxr-x. 3 acme acme 4096 May 11 11:53 .
drwxrwxr-x. 4 acme acme 4096 May 11 11:53 ..
drwxrwxr-x. 2 acme acme 4096 Apr 12 14:48 lib
-rwxrwxr-x. 1 acme acme  302 Apr 12 14:48 probe_vfs_getname.sh
-rwxrwxr-x. 1 acme acme 2050 May 11 11:53 record+probe_libc_inet_pton.sh
-rwxrwxr-x. 1 acme acme 1185 Apr 12 14:48 record+script_probe_vfs_getname.sh
-rwxrwxr-x. 1 acme acme 1176 Apr 12 14:48 trace+probe_vfs_getname.sh
[acme@jouet perf]$ 

[root@jouet ~]# perf test inet_pton
64: probe libc's inet_pton & backtrace it with ping       : Ok
[root@jouet ~]# perf test -v inet_pton
64: probe libc's inet_pton & backtrace it with ping       :
--- start ---
test child forked, pid 2441
ping 2478 0 143807.377533: probe_libc:inet_pton: (7f7259040e40)
113e40 __GI___inet_pton (/usr/lib64/libc-2.26.so)
e02b4 getaddrinfo (/usr/lib64/libc-2.26.so)
2f40 [unknown] (/usr/bin/ping)
test child finished with 0
---- end ----
probe libc's inet_pton & backtrace it with ping: Ok
[root@jouet ~]#

- Arnaldo

           reply	other threads:[~2018-05-14 16:11 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20180513110617.91669-1-automatic+kernel@freyther.de>]

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=20180514161154.GU13491@kernel.org \
    --to=acme@kernel.org \
    --cc=automatic+kernel@freyther.de \
    --cc=holgar+kernel@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=namhyung@kernel.org \
    --cc=ravi.bangoria@linux.vnet.ibm.com \
    --cc=wangnan0@huawei.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;
as well as URLs for NNTP newsgroup(s).