@@ -49,9 +49,7 @@ static cl::opt<bool>
49
49
cl::desc (" aggregate basic samples (without LBR info)" ),
50
50
cl::cat(AggregatorCategory));
51
51
52
- cl::opt<bool > ArmSPE (" spe" ,
53
- cl::desc (" Enable Arm SPE mode. Can combine with `--nl` "
54
- " to use in no-lbr mode" ),
52
+ cl::opt<bool > ArmSPE (" spe" , cl::desc(" Enable Arm SPE mode." ),
55
53
cl::cat(AggregatorCategory));
56
54
57
55
static cl::opt<std::string>
@@ -181,7 +179,10 @@ void DataAggregator::start() {
181
179
findPerfExecutable ();
182
180
183
181
if (opts::ArmSPE) {
184
- // pid from_ip to_ip predicted/missed not-taken?
182
+ // pid from_ip to_ip flags
183
+ // where flags could be:
184
+ // P/M: whether branch was Predicted or Mispredicted.
185
+ // N: optionally appears when the branch was Not-Taken (ie fall-through)
185
186
// 12345 0x123/0x456/PN/-/-/8/RET/-
186
187
launchPerfProcess (" SPE brstack events" , MainEventsPPI,
187
188
" script -F pid,brstack --itrace=bl" ,
@@ -1012,7 +1013,8 @@ ErrorOr<DataAggregator::LBREntry> DataAggregator::parseLBREntry() {
1012
1013
if (std::error_code EC = MispredStrRes.getError ())
1013
1014
return EC;
1014
1015
StringRef MispredStr = MispredStrRes.get ();
1015
- // SPE brstack mispredicted flags might be two characters long: 'PN' or 'MN'.
1016
+ // SPE brstack mispredicted flags might be up to two characters long:
1017
+ // 'PN' or 'MN'. Where 'N' optionally appears.
1016
1018
bool ValidStrSize = opts::ArmSPE
1017
1019
? MispredStr.size () >= 1 && MispredStr.size () <= 2
1018
1020
: MispredStr.size () == 1 ;
@@ -1542,7 +1544,7 @@ void DataAggregator::printBranchStacksDiagnostics(
1542
1544
std::error_code DataAggregator::parseBranchEvents () {
1543
1545
std::string BranchEventTypeStr =
1544
1546
!opts::ArmSPE ? " branch events" : " SPE branch events in LBR-format" ;
1545
- outs () << " PERF2BOLT: " << BranchEventTypeStr << " ...\n " ;
1547
+ outs () << " PERF2BOLT: parse " << BranchEventTypeStr << " ...\n " ;
1546
1548
NamedRegionTimer T (" parseBranch" , " Parsing " + BranchEventTypeStr,
1547
1549
TimerGroupName, TimerGroupDesc, opts::TimeAggregator);
1548
1550
@@ -1599,8 +1601,11 @@ std::error_code DataAggregator::parseBranchEvents() {
1599
1601
else
1600
1602
errs ()
1601
1603
<< " PERF2BOLT-WARNING: all recorded samples for this binary lack "
1602
- " SPE brstack entries. Record profile with:"
1603
- " perf record arm_spe_0/branch_filter=1/" ;
1604
+ " SPE brstack entries. The minimum required version of "
1605
+ " Linux-perf is v6.14 or higher for brstack support. "
1606
+ " With an older Linux-perf you may get zero samples. "
1607
+ " Plese also make sure about you recorded profile with: "
1608
+ " perf record -e 'arm_spe_0/branch_filter=1/'." ;
1604
1609
} else {
1605
1610
printBranchStacksDiagnostics (NumTotalSamples - NumSamples);
1606
1611
}
0 commit comments