Ignore ART frames in fdtrack traces.

Trying to find a leak this year, it was very annoying that our traces
were mostly filled with "junk" frames from the JNI implementation,
making it quite a struggle to see what the actual calling code was...

Bug: http://b/236197847
Test: treehugger
Change-Id: I69e7d9b6432e1872e238168ebf3dc36feb7de7df
This commit is contained in:
Elliott Hughes 2022-12-12 21:40:31 +00:00
parent a5bce1b630
commit 263faa90e1

View file

@ -71,7 +71,11 @@ static constexpr size_t kFdTableSize = 4096;
static constexpr size_t kStackDepth = 32;
// Skip any initial frames from libfdtrack.so.
static std::vector<std::string> kSkipFdtrackLib [[clang::no_destroy]] = {"libfdtrack.so"};
// Also ignore frames from ART (http://b/236197847) because we'd rather spend
// our precious few frames on the actual Java calling code rather than the
// implementation of JNI!
static std::vector<std::string> kSkipFdtrackLib
[[clang::no_destroy]] = {"libfdtrack.so", "libart.so"};
static bool installed = false;
static std::array<FdEntry, kFdTableSize> stack_traces [[clang::no_destroy]];