Page MenuHomePhabricator

[llvm-profgen][NFC] Fix test failure by making unwinder's output deterministic
ClosedPublic

Authored by wlei on Dec 7 2020, 10:02 PM.

Details

Summary

Don't know why under Sanitizer build(asan/msan/ubsan), the std::unordered_map<string, ...>'s output order is reversed, make the regression test failed.

This change creates a workaround by using sorted container to make the output deterministic.

Diff Detail

Event Timeline

wlei created this revision.Dec 7 2020, 10:02 PM
wlei requested review of this revision.Dec 7 2020, 10:02 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 7 2020, 10:02 PM
wlei edited the summary of this revision. (Show Details)Dec 7 2020, 10:11 PM
wlei added reviewers: wmi, hoy, wenlei, davidxl.
hoy accepted this revision.Dec 7 2020, 10:15 PM

Thanks for the fast turnaround!

This revision is now accepted and ready to land.Dec 7 2020, 10:15 PM
wenlei accepted this revision.Dec 7 2020, 10:15 PM

Thanks for quick fix!

llvm/tools/llvm-profgen/PerfReader.cpp
202

Does this work?

std::map<std::string, RangeSample> OrderedCounter(Counter.begin(), Counter.end());

wlei added inline comments.Dec 7 2020, 10:24 PM
llvm/tools/llvm-profgen/PerfReader.cpp
202

Yeah, thanks for the suggestion!

wlei updated this revision to Diff 310090.Dec 7 2020, 10:28 PM

change according wenlei's suggestion

This revision was landed with ongoing or failed builds.Dec 7 2020, 10:37 PM
This revision was automatically updated to reflect the committed changes.