Skip to content

perf-probe fixes for C++

Masami Hiramatsu lkml 1 version In review

Get series with b4
b4 am 147464488719.29804.13099016520754675018.stgit@devbox

Versions newest first

  1. v1 Latest4 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4perf-probe: Ignore the error of finding inline instancetools/perf/util/probe-finder.c+3 -20 replies
2/4perf-probe: Skip if the function address is 0tools/perf/util/probe-finder.c+11 -10 replies
3/4perf-probe: Fix to cut off incompatible chars from group nametools/perf/util/probe-event.c+7 -30 replies
4/4perf-probe: Match linkage name with mangled nametools/perf/util/dwarf-aux.c tools/perf/util/dwarf-aux.h+29 -20 replies

Reviews trailers per patch

None of the 4 patches has a Reviewed-by or Acked-by.

PatchJiri Olsa
SeriesT-b
1/4
2/4
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH perf/core 0/4] perf-probe fixes for C++

Hi,

Here is a series of patches for fixing several issues when probing on C++ binaries.

- Ignore inlined function definition if it has no instance [1/4]
- Skip (inlined/normal) functions which entry address is 0 [2/4]
- Cut off the filename for group name if it includes characters which can not be used for C symbol name [3/4]
- Search mangled symbol name from debuginfo [4/4]

So, with this series, perf-probe can handle "mangled symbol" or "method name" as below;
----

  $ ./perf probe -x /usr/lib64/libstdc++.so.6 \
    -D _ZNKSt15basic_fstreamXXIwSt11char_traitsIwEE7is_openEv
  p:probe_libstdc/_ZNKSt15basic_fstreamXXIwSt11char_traitsIwEE7is_openEv
  /usr/lib64/libstdc++.so.6.0.22:0x8ca60
  $ ./perf probe -x /usr/lib64/libstdc++.so.6 -D is_open
  p:probe_libstdc/is_open /usr/lib64/libstdc++.so.6.0.22:0x8ca80
  p:probe_libstdc/is_open_1 /usr/lib64/libstdc++.so.6.0.22:0x8ca70
  p:probe_libstdc/is_open_2 /usr/lib64/libstdc++.so.6.0.22:0x8ca60
  p:probe_libstdc/is_open_3 /usr/lib64/libstdc++.so.6.0.22:0xb0ad0
  p:probe_libstdc/is_open_4 /usr/lib64/libstdc++.so.6.0.22:0xecca9
  ----

Jiri and Thomas, could you try this if you need it?

TODO:
- Support demangled method name(in short), like std::basic_fstream::is_open.

Thank you,

---

Masami Hiramatsu (4):
perf-probe: Ignore the error of finding inline instance
perf-probe: Skip if the function address is 0
perf-probe: Fix to cut off incompatible chars from group name
perf-probe: Match linkage name with mangled name

 tools/perf/util/dwarf-aux.c    |   28 ++++++++++++++++++++++++++--
 tools/perf/util/dwarf-aux.h    |    3 +++
 tools/perf/util/probe-event.c  |   10 +++++++---
 tools/perf/util/probe-finder.c |   17 ++++++++++++++---
 4 files changed, 50 insertions(+), 8 deletions(-)

--
Masami Hiramatsu