diff options
author | Kazu Hirata <kazu@google.com> | 2024-11-22 11:53:31 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-22 11:53:31 -0800 |
commit | ad2bdd8fab7b0ba05d25ec68ee06cf89e45fe369 (patch) | |
tree | 932468cd70bfb64b1f572b53fba063d7f5065d13 /llvm/unittests/ProfileData/InstrProfTest.cpp | |
parent | cf83a7fdc2dfac8220d9923a831181dccb9f7277 (diff) | |
download | llvm-ad2bdd8fab7b0ba05d25ec68ee06cf89e45fe369.zip llvm-ad2bdd8fab7b0ba05d25ec68ee06cf89e45fe369.tar.gz llvm-ad2bdd8fab7b0ba05d25ec68ee06cf89e45fe369.tar.bz2 |
[memprof] Remove MemProf format Version 1 (#117357)
This patch removes MemProf format Version 1 now that Version 2 and 3
are working well.
Diffstat (limited to 'llvm/unittests/ProfileData/InstrProfTest.cpp')
-rw-r--r-- | llvm/unittests/ProfileData/InstrProfTest.cpp | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/llvm/unittests/ProfileData/InstrProfTest.cpp b/llvm/unittests/ProfileData/InstrProfTest.cpp index 8bd39fd..f366b22 100644 --- a/llvm/unittests/ProfileData/InstrProfTest.cpp +++ b/llvm/unittests/ProfileData/InstrProfTest.cpp @@ -394,21 +394,6 @@ MemInfoBlock makePartialMIB() { return MIB; } -IndexedMemProfRecord makeRecord( - std::initializer_list<std::initializer_list<::llvm::memprof::FrameId>> - AllocFrames, - std::initializer_list<std::initializer_list<::llvm::memprof::FrameId>> - CallSiteFrames, - const MemInfoBlock &Block = makeFullMIB()) { - llvm::memprof::IndexedMemProfRecord MR; - for (const auto &Frames : AllocFrames) - MR.AllocSites.emplace_back(Frames, llvm::memprof::hashCallStack(Frames), - Block); - for (const auto &Frames : CallSiteFrames) - MR.CallSites.push_back(Frames); - return MR; -} - IndexedMemProfRecord makeRecordV2(std::initializer_list<::llvm::memprof::CallStackId> AllocFrames, std::initializer_list<::llvm::memprof::CallStackId> CallSiteFrames, @@ -456,48 +441,6 @@ MATCHER_P(EqualsRecord, Want, "") { return true; } -TEST_F(InstrProfTest, test_memprof_v0) { - ASSERT_THAT_ERROR(Writer.mergeProfileKind(InstrProfKind::MemProf), - Succeeded()); - - const IndexedMemProfRecord IndexedMR = makeRecord( - /*AllocFrames=*/ - { - {0, 1}, - {2, 3}, - }, - /*CallSiteFrames=*/{ - {4, 5}, - }); - - memprof::IndexedMemProfData MemProfData; - MemProfData.Frames = getFrameMapping(); - MemProfData.Records.try_emplace(0x9999, IndexedMR); - Writer.addMemProfData(MemProfData, Err); - - auto Profile = Writer.writeBuffer(); - readProfile(std::move(Profile)); - - auto RecordOr = Reader->getMemProfRecord(0x9999); - ASSERT_THAT_ERROR(RecordOr.takeError(), Succeeded()); - const memprof::MemProfRecord &Record = RecordOr.get(); - - std::optional<memprof::FrameId> LastUnmappedFrameId; - auto IdToFrameCallback = [&](const memprof::FrameId Id) { - auto Iter = MemProfData.Frames.find(Id); - if (Iter == MemProfData.Frames.end()) { - LastUnmappedFrameId = Id; - return memprof::Frame(0, 0, 0, false); - } - return Iter->second; - }; - - const memprof::MemProfRecord WantRecord(IndexedMR, IdToFrameCallback); - ASSERT_EQ(LastUnmappedFrameId, std::nullopt) - << "could not map frame id: " << *LastUnmappedFrameId; - EXPECT_THAT(WantRecord, EqualsRecord(Record)); -} - TEST_F(InstrProfTest, test_memprof_v2_full_schema) { const MemInfoBlock MIB = makeFullMIB(); |