diff options
author | Snehasish Kumar <snehasishk@google.com> | 2022-05-24 23:58:36 +0000 |
---|---|---|
committer | Snehasish Kumar <snehasishk@google.com> | 2022-05-25 21:17:44 +0000 |
commit | ec51971eae02a031bbfd992cf59e1f6acdadbeeb (patch) | |
tree | f45cdb4dad95b93f28beca6d8f05ae3179d64d5c /llvm/unittests/ProfileData/MemProfTest.cpp | |
parent | 10f41a214767219ef369b217f685eb545b80e386 (diff) | |
download | llvm-ec51971eae02a031bbfd992cf59e1f6acdadbeeb.zip llvm-ec51971eae02a031bbfd992cf59e1f6acdadbeeb.tar.gz llvm-ec51971eae02a031bbfd992cf59e1f6acdadbeeb.tar.bz2 |
[memprof] Keep and display symbol names in the RawMemProfReader.
Extend the Frame struct to hold the symbol name if requested
when a RawMemProfReader object is constructed. This change updates the
tests and removes the need to pass --debug to obtain the mapping from
GUID to symbol names.
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/D126344
Diffstat (limited to 'llvm/unittests/ProfileData/MemProfTest.cpp')
-rw-r--r-- | llvm/unittests/ProfileData/MemProfTest.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/unittests/ProfileData/MemProfTest.cpp b/llvm/unittests/ProfileData/MemProfTest.cpp index 48d6ee7..4808481 100644 --- a/llvm/unittests/ProfileData/MemProfTest.cpp +++ b/llvm/unittests/ProfileData/MemProfTest.cpp @@ -104,6 +104,11 @@ MATCHER_P4(FrameContains, FunctionName, LineOffset, Column, Inline, "") { *result_listener << "Hash mismatch"; return false; } + if (F.SymbolName.hasValue() && F.SymbolName.getValue() != FunctionName) { + *result_listener << "SymbolName mismatch\nWant: " << FunctionName + << "\nGot: " << F.SymbolName.getValue(); + return false; + } if (F.LineOffset == LineOffset && F.Column == Column && F.IsInlineFrame == Inline) { return true; @@ -154,7 +159,8 @@ TEST(MemProf, FillsValue) { auto Seg = makeSegments(); - RawMemProfReader Reader(std::move(Symbolizer), Seg, Prof, CSM); + RawMemProfReader Reader(std::move(Symbolizer), Seg, Prof, CSM, + /*KeepName=*/true); llvm::DenseMap<llvm::GlobalValue::GUID, MemProfRecord> Records; for (const auto &Pair : Reader) { |