@@ -81,11 +81,10 @@ struct PerfSpeEventsTestHelper : public testing::Test {
81
81
std::unique_ptr<ObjectFile> ObjFile;
82
82
std::unique_ptr<BinaryContext> BC;
83
83
84
- // Helper function to export lists to show the mismatch
85
- void exportBrStackEventMismatch (
84
+ // / Helper function to export lists to show the mismatch.
85
+ void reportBrStackEventMismatch (
86
86
const std::unordered_map<Trace, TakenBranchInfo, TraceHash> &BranchLBRs,
87
87
const std::vector<MockBranchInfo> &ExpectedSamples) {
88
- // Simple export where they differ
89
88
llvm::errs () << " BranchLBRs items: \n " ;
90
89
for (const auto &AggrLBR : BranchLBRs)
91
90
llvm::errs () << " {" << AggrLBR.first .From << " , " << AggrLBR.first .To
@@ -98,7 +97,7 @@ struct PerfSpeEventsTestHelper : public testing::Test {
98
97
<< " , " << BI.MispredCount << " }" << " \n " ;
99
98
}
100
99
101
- // Parse and check SPE brstack as LBR.
100
+ // / Parse and check SPE brstack as LBR.
102
101
void parseAndCheckBrstackEvents (
103
102
uint64_t PID, const std::vector<MockBranchInfo> &ExpectedSamples) {
104
103
DataAggregator DA (" <pseudo input>" );
@@ -111,11 +110,10 @@ struct PerfSpeEventsTestHelper : public testing::Test {
111
110
112
111
EXPECT_EQ (DA.BranchLBRs .size (), ExpectedSamples.size ());
113
112
if (DA.BranchLBRs .size () != ExpectedSamples.size ())
114
- exportBrStackEventMismatch (DA.BranchLBRs , ExpectedSamples);
113
+ reportBrStackEventMismatch (DA.BranchLBRs , ExpectedSamples);
115
114
116
115
for (const MockBranchInfo &BI : ExpectedSamples) {
117
- // / Check whether the key exists, throws 'std::out_of_range'
118
- // / if the container does not have an element with the specified key.
116
+ // Check that each key exists and that it matches.
119
117
EXPECT_NO_THROW (DA.BranchLBRs .at (Trace (BI.From , BI.To )));
120
118
121
119
EXPECT_EQ (DA.BranchLBRs .at (Trace (BI.From , BI.To )).MispredCount ,
0 commit comments