RFC perf probe: Attempt to improve C++ probing
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest6 patches 3 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | perf probe: Do not exclude mangled C++ funcstools/ | +1 | 0 replies | |
| 2/6 | perf probe: Parse linerange for C++ functionstools/ | +56 | 0 replies | |
| 3/6 | perf probe: Make listing of C++ functions worktools/ tools/ | +48 | 0 replies | |
| 4/6 | perf probe: Show variables for C++ functionstools/ tools/ tools/ | +76 | 0 replies | |
| 5/6 | perf probe: Make listing of variables work for C++ functionstools/ | +56 | 0 replies | |
| 6/6 | perf probe: Make it possible to add a C++ uprobetools/ | +11 | 0 replies |
Reviews trailers per patch
None of the 6 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Masami Hiramatsu |
|---|---|
| Series | A-b |
| 1/6 | |
| 2/6 | |
| 3/6 | |
| 4/6 | |
| 5/6 | |
| 6/6 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [RFC 0/6] perf probe: Attempt to improve C++ probing
From: Holger Hans Peter Freyther <[email protected]>
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.
This has seen very little testing outside the following commands.
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"
Holger Hans Peter Freyther (6):
perf probe: Do not exclude mangled C++ funcs
perf probe: Parse linerange for C++ functions
perf probe: Make listing of C++ functions work perf probe: Show variables for C++ functions
perf probe: Make listing of variables work for C++ functions perf probe: Make it possible to add a C++ uprobe
tools/perf/builtin-probe.c | 2 +- tools/perf/util/probe-event.c | 77 ++++++++++++++++++++- tools/perf/util/probe-finder.c | 152 ++++++++++++++++++++++++++++++----------- tools/perf/util/probe-finder.h | 3 + tools/perf/util/string.c | 57 ++++++++++++++++ tools/perf/util/string2.h | 1 + 6 files changed, 247 insertions(+), 45 deletions(-)
Signature · 1 line
2.7.4