Skip to content

Commit e74d2ae

Browse files
Addressing reviewers (1)
1 parent 0782911 commit e74d2ae

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

bolt/include/bolt/Utils/CommandLineOpts.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ extern llvm::cl::OptionCategory BinaryAnalysisCategory;
3333
extern llvm::cl::opt<unsigned> AlignText;
3434
extern llvm::cl::opt<unsigned> AlignFunctions;
3535
extern llvm::cl::opt<bool> AggregateOnly;
36+
extern llvm::cl::opt<bool> ArmSPE;
3637
extern llvm::cl::opt<unsigned> BucketsPerLine;
3738
extern llvm::cl::opt<bool> DiffOnly;
3839
extern llvm::cl::opt<bool> EnableBAT;

bolt/lib/Profile/DataAggregator.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1190,6 +1190,7 @@ DataAggregator::parseSpeAsBasicSamples() {
11901190
ErrorOr<uint64_t> AddrResTo = parseHexField(FieldSeparator);
11911191
if (std::error_code EC = AddrResTo.getError())
11921192
return EC;
1193+
11931194
consumeAllRemainingFS();
11941195

11951196
ErrorOr<uint64_t> AddrResFrom = parseHexField(FieldSeparator, true);
@@ -1209,12 +1210,13 @@ DataAggregator::parseSpeAsBasicSamples() {
12091210

12101211
if (!BC->HasFixedLoadAddress)
12111212
adjustAddress(Address, MMapInfoIter->second);
1213+
12121214
return PerfBasicSample{Event.get(), Address};
12131215
};
12141216

12151217
// Show more meaningful event names on boltdata.
12161218
if (Event->str() == "instructions:")
1217-
Event = *AddrResTo != 0x0 ? "branch-spe:" : "instruction-spe:";
1219+
Event = *AddrResTo != 0x0 ? "branches-spe:" : "instructions-spe:";
12181220

12191221
return std::make_pair(genBasicSample(*AddrResFrom),
12201222
genBasicSample(*AddrResTo));

bolt/tools/driver/llvm-bolt.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ static cl::opt<std::string> InputFilename(cl::Positional,
5151
cl::Required, cl::cat(BoltCategory),
5252
cl::sub(cl::SubCommand::getAll()));
5353

54-
extern cl::opt<bool> ArmSPE;
55-
5654
static cl::opt<std::string>
5755
InputDataFilename("data",
5856
cl::desc("<data file>"),
@@ -241,7 +239,7 @@ int main(int argc, char **argv) {
241239
RewriteInstance &RI = *RIOrErr.get();
242240

243241
if (opts::AggregateOnly && !RI.getBinaryContext().isAArch64() &&
244-
opts::ArmSPE == 1) {
242+
opts::ArmSPE) {
245243
errs() << "BOLT-ERROR: -spe is available only on AArch64.\n";
246244
exit(1);
247245
}

bolt/unittests/Profile/PerfSpeEvents.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ TEST_F(PerfSpeEventsTestHelper, SpeBranches) {
110110
"1234 instructions: d002 d001\n"
111111
"1234 instructions: e002 e001\n";
112112

113-
EXPECT_TRUE(checkEvents(1234, 10, {"branch-spe:"}));
113+
EXPECT_TRUE(checkEvents(1234, 10, {"branches-spe:"}));
114114
}
115115

116116
TEST_F(PerfSpeEventsTestHelper, SpeBranchesAndCycles) {
@@ -127,7 +127,7 @@ TEST_F(PerfSpeEventsTestHelper, SpeBranchesAndCycles) {
127127
"1234 instructions: d002 d001\n"
128128
"1234 instructions: e002 e001\n";
129129

130-
EXPECT_TRUE(checkEvents(1234, 8, {"branch-spe:", "cycles:u:"}));
130+
EXPECT_TRUE(checkEvents(1234, 8, {"branches-spe:", "cycles:u:"}));
131131
}
132132

133133
TEST_F(PerfSpeEventsTestHelper, SpeAnyEventAndCycles) {
@@ -144,8 +144,8 @@ TEST_F(PerfSpeEventsTestHelper, SpeAnyEventAndCycles) {
144144
"1234 instructions: 0 d001\n"
145145
"1234 instructions: e002 e001\n";
146146

147-
EXPECT_TRUE(
148-
checkEvents(1234, 6, {"cycles:u:", "instruction-spe:", "branch-spe:"}));
147+
EXPECT_TRUE(checkEvents(1234, 6,
148+
{"cycles:u:", "instructions-spe:", "branches-spe:"}));
149149
}
150150

151151
TEST_F(PerfSpeEventsTestHelper, SpeNoBranchPairsRecorded) {
@@ -164,7 +164,7 @@ TEST_F(PerfSpeEventsTestHelper, SpeNoBranchPairsRecorded) {
164164
"1234 cycles:u: 0 d001\n"
165165
"1234 instructions: 0 e001\n";
166166

167-
EXPECT_TRUE(checkEvents(1234, 5, {"instruction-spe:", "cycles:u:"}));
167+
EXPECT_TRUE(checkEvents(1234, 5, {"instructions-spe:", "cycles:u:"}));
168168

169169
std::string Stderr = testing::internal::GetCapturedStderr();
170170
EXPECT_EQ(Stderr, "PERF2BOLT-WARNING: no SPE branches found\n");

0 commit comments

Comments
 (0)