summaryrefslogtreecommitdiff
path: root/simpleperf/dso.cpp
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2021-08-16 13:37:35 -0700
committerYabin Cui <yabinc@google.com>2021-08-16 13:46:20 -0700
commit1e16b20c973bf8ac7fa5207bab3cfff3fc1249c3 (patch)
treea42c601486f653cd120eabc0eff5956126ec98c3 /simpleperf/dso.cpp
parent1265cc902d0d8cdaa5a8f964510de04cc5c32362 (diff)
downloadextras-1e16b20c973bf8ac7fa5207bab3cfff3fc1249c3.tar.gz
simpleperf: support JIT method name with signature.
When using debug_info instead of mini_debug_info, ART exports JIT method name with signature. So simpleperf needs to remove the signature when converting JIT frames and deobfuscating method names. Bug: 195892224 Test: run simpleperf_unit_test Change-Id: I08d2b95cf21e8653e946833e442315a09e7bd723
Diffstat (limited to 'simpleperf/dso.cpp')
-rw-r--r--simpleperf/dso.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/simpleperf/dso.cpp b/simpleperf/dso.cpp
index 8d002388..db70a879 100644
--- a/simpleperf/dso.cpp
+++ b/simpleperf/dso.cpp
@@ -229,6 +229,20 @@ void Symbol::SetDemangledName(std::string_view name) const {
}
}
+std::string_view Symbol::FunctionNameForJITSymbol() const {
+ // Name with signature is like "void ctep.v(cteo, ctgc, ctbn)".
+ std::string_view name = DemangledName();
+ auto brace_pos = name.find('(');
+ if (brace_pos != name.npos) {
+ name = name.substr(0, brace_pos);
+ auto space_pos = name.rfind(' ');
+ if (space_pos != name.npos) {
+ name = name.substr(space_pos + 1);
+ }
+ }
+ return name;
+}
+
static bool CompareSymbolToAddr(const Symbol& s, uint64_t addr) {
return s.addr < addr;
}