Skip to content

[memprof] Use addCallStack in a unit test (NFC) #119651

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions llvm/unittests/ProfileData/MemProfTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,14 +556,12 @@ TEST(MemProf, MissingCallStackId) {
}

TEST(MemProf, MissingFrameId) {
IndexedAllocationInfo AI(0x222, makePartialMIB(), getHotColdSchema());

IndexedMemProfRecord IndexedMR;
IndexedMR.AllocSites.push_back(AI);

// An empty Frame map to trigger a mapping error.
IndexedMemProfData MemProfData;
MemProfData.CallStacks.insert({0x222, {2, 3}});
auto CSId = MemProfData.addCallStack(SmallVector<FrameId>{2, 3});

IndexedMemProfRecord IndexedMR;
IndexedMR.AllocSites.emplace_back(CSId, makePartialMIB(), getHotColdSchema());

FrameIdConverter<decltype(MemProfData.Frames)> FrameIdConv(
MemProfData.Frames);
Expand Down
Loading