[PATCH] D92816: [llvm-profgen][NFC] Fix test failure by making unwinder's output deterministic
Lei Wang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 7 22:02:28 PST 2020
wlei created this revision.
Herald added subscribers: hoy, wenlei, lxfind, mgrang.
wlei requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D92816
Files:
llvm/test/tools/llvm-profgen/inline-cs-noprobe.test
llvm/tools/llvm-profgen/PerfReader.cpp
Index: llvm/tools/llvm-profgen/PerfReader.cpp
===================================================================
--- llvm/tools/llvm-profgen/PerfReader.cpp
+++ llvm/tools/llvm-profgen/PerfReader.cpp
@@ -199,7 +199,12 @@
}
static void printSampleCounter(ContextRangeCounter &Counter) {
+ std::map<std::string, RangeSample> SortedCounter;
+ // Use sorted container to make the output deterministic
for (auto Range : Counter) {
+ SortedCounter[Range.first] = Range.second;
+ }
+ for (auto Range : SortedCounter) {
outs() << Range.first << "\n";
for (auto I : Range.second) {
outs() << " (" << format("%" PRIx64, I.first.first) << ", "
Index: llvm/test/tools/llvm-profgen/inline-cs-noprobe.test
===================================================================
--- llvm/test/tools/llvm-profgen/inline-cs-noprobe.test
+++ llvm/test/tools/llvm-profgen/inline-cs-noprobe.test
@@ -10,13 +10,14 @@
; CHECK: 1: 14
; CHECK-UNWINDER: Binary(inline-cs-noprobe.perfbin)'s Range Counter:
-; CHECK-UNWINDER: main:1 @ foo:3.2 @ bar
-; CHECK-UNWINDER: (6af, 6bb): 14
; CHECK-UNWINDER: main:1 @ foo
; CHECK-UNWINDER: (670, 6ad): 1
; CHECK-UNWINDER: (67e, 69b): 1
; CHECK-UNWINDER: (67e, 6ad): 13
; CHECK-UNWINDER: (6bd, 6c8): 14
+; CHECK-UNWINDER: main:1 @ foo:3.2 @ bar
+; CHECK-UNWINDER: (6af, 6bb): 14
+
; CHECK-UNWINDER: Binary(inline-cs-noprobe.perfbin)'s Branch Counter:
; CHECK-UNWINDER: main:1 @ foo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92816.310088.patch
Type: text/x-patch
Size: 1449 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201208/81433cd1/attachment.bin>
More information about the llvm-commits
mailing list