From: James Clark <james.clark@arm.com>
To: Milian Wolff <milian.wolff@kdab.com>, linux-perf-users@vger.kernel.org
Cc: Arnaldo Carvalho de Melo <acme@kenel.org>
Subject: Re: perf probe: adding probe on C++ member/namespace function or versioned symbols
Date: Thu, 9 Dec 2021 10:47:52 +0000 [thread overview]
Message-ID: <d2ddc34f-3825-4b95-e6d3-fd25604b6867@arm.com> (raw)
In-Reply-To: <2119579.vFYbnVOWES@milian-workstation>
On 08/12/2021 20:08, Milian Wolff wrote:
> Hey there,
>
> how can one escape function names for `perf probe`? It seems like the current
> parser is confused by the `:` which is common in C++ symbol names.
>
> ```
> $ perf probe -F --exec /usr/lib/libQt5Widgets.so | grep syncBacking
> QWidgetPrivate::syncBackingStore
> QWidgetPrivate::syncBackingStore
It might not be obvious, but you have to get the mangled name with 'nm -D',
and then pass the mangled name with --no-demangle to perf and then it works:
sudo ./perf probe --no-demangle --exec libQt5Widgets.so.5 --add '_ZN14QWidgetPrivate16syncBackingStoreEv'
Maybe the docs could be updated to make it clearer, or print a warning message, or
get perf to output mangled symbols in addition to demangled with -F.
>
> $ perf probe --exec /usr/lib/libQt5Widgets.so --add
> QWidgetPrivate::syncBackingStore
> Semantic error :There is non-digit char in line number.
> ...
> ```
>
> Additionally, it is also not possible to pass a versioned symbol either:
> ```
> $ nm -aD /usr/lib/libQt5Widgets.so | grep syncBacking
> 0000000000197480 T
> _ZN14QWidgetPrivate16syncBackingStoreERK7QRegion@@Qt_5_PRIVATE_API
> 00000000001973b0 T _ZN14QWidgetPrivate16syncBackingStoreEv@@Qt_5_PRIVATE_API
> Semantic error :SRC@SRC is not allowed.
If adding mangling fix doesn't work for this one, you could try removing some of
the name processing in probe-event.c like:
/* Cut off the dot suffixes (e.g. .const, .isra) and version suffixes */
p = strpbrk(nbase, ".@");
if (p && p != nbase)
*p = '\0';
> ...
> ```
>
> Is there a workaround available for this?
>
> Thanks
>
next prev parent reply other threads:[~2021-12-09 10:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-08 20:08 perf probe: adding probe on C++ member/namespace function or versioned symbols Milian Wolff
2021-12-09 10:47 ` James Clark [this message]
2021-12-15 13:10 ` Milian Wolff
2021-12-15 14:59 ` Arnaldo Carvalho de Melo
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=d2ddc34f-3825-4b95-e6d3-fd25604b6867@arm.com \
--to=james.clark@arm.com \
--cc=acme@kenel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=milian.wolff@kdab.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.