diff options
author | Snehasish Kumar <snehasishk@google.com> | 2023-03-07 19:34:57 +0000 |
---|---|---|
committer | Snehasish Kumar <snehasishk@google.com> | 2023-03-07 20:16:15 +0000 |
commit | bcebadeba75f4c05e9879607a89ac30d892fdcad (patch) | |
tree | ac256624fd740602f15fda1e87cc8c0a514ebe27 /llvm/unittests/ProfileData/MemProfTest.cpp | |
parent | a90a7b044f7d4808b32189e4f9cf91ae49ca2218 (diff) | |
download | llvm-bcebadeba75f4c05e9879607a89ac30d892fdcad.zip llvm-bcebadeba75f4c05e9879607a89ac30d892fdcad.tar.gz llvm-bcebadeba75f4c05e9879607a89ac30d892fdcad.tar.bz2 |
[memprof] Update the isRuntime symbolization check.
Update the isRuntime check to only match against known memprof filenames
where interceptors are defined. This avoid issues where the path does
not include the directory based on how the runtime was compiled. Also
update the unittest.
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/D145521
Diffstat (limited to 'llvm/unittests/ProfileData/MemProfTest.cpp')
-rw-r--r-- | llvm/unittests/ProfileData/MemProfTest.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/llvm/unittests/ProfileData/MemProfTest.cpp b/llvm/unittests/ProfileData/MemProfTest.cpp index 0908d3b..9d79385 100644 --- a/llvm/unittests/ProfileData/MemProfTest.cpp +++ b/llvm/unittests/ProfileData/MemProfTest.cpp @@ -321,14 +321,23 @@ TEST(MemProf, SymbolizationFilter) { specifier(), false)) .Times(1) .WillRepeatedly(Return(makeInliningInfo({ - {"foo", 10, 5, 30}, + {"foo", 10, 5, 30, "memprof/memprof_test_file.cpp"}, + }))); + + EXPECT_CALL(*Symbolizer, symbolizeInlinedCode(SectionedAddress{0x5000}, + specifier(), false)) + .Times(1) + .WillRepeatedly(Return(makeInliningInfo({ + // Depending on how the runtime was compiled, only the filename + // may be present in the debug information. + {"malloc", 70, 57, 3, "memprof_malloc_linux.cpp"}, }))); CallStackMap CSM; CSM[0x1] = {0x1000, 0x2000, 0x3000, 0x4000}; // This entry should be dropped since all PCs are either not // symbolizable or belong to the runtime. - CSM[0x2] = {0x1000, 0x2000}; + CSM[0x2] = {0x1000, 0x2000, 0x5000}; llvm::MapVector<uint64_t, MemInfoBlock> Prof; Prof[0x1].AllocCount = 1; |