@@ -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" ,
@@ -1008,7 +1009,8 @@ ErrorOr<LBREntry> DataAggregator::parseLBREntry() {
1008
1009
if (std::error_code EC = MispredStrRes.getError ())
1009
1010
return EC;
1010
1011
StringRef MispredStr = MispredStrRes.get ();
1011
- // SPE brstack mispredicted flags might be two characters long: 'PN' or 'MN'.
1012
+ // SPE brstack mispredicted flags might be up to two characters long:
1013
+ // 'PN' or 'MN'. Where 'N' optionally appears.
1012
1014
bool ValidStrSize = opts::ArmSPE
1013
1015
? MispredStr.size () >= 1 && MispredStr.size () <= 2
1014
1016
: MispredStr.size () == 1 ;
@@ -1537,7 +1539,7 @@ void DataAggregator::printBranchStacksDiagnostics(
1537
1539
std::error_code DataAggregator::parseBranchEvents () {
1538
1540
std::string BranchEventTypeStr =
1539
1541
!opts::ArmSPE ? " branch events" : " SPE branch events in LBR-format" ;
1540
- outs () << " PERF2BOLT: " << BranchEventTypeStr << " ...\n " ;
1542
+ outs () << " PERF2BOLT: parse " << BranchEventTypeStr << " ...\n " ;
1541
1543
NamedRegionTimer T (" parseBranch" , " Parsing " + BranchEventTypeStr,
1542
1544
TimerGroupName, TimerGroupDesc, opts::TimeAggregator);
1543
1545
@@ -1594,8 +1596,11 @@ std::error_code DataAggregator::parseBranchEvents() {
1594
1596
else
1595
1597
errs ()
1596
1598
<< " PERF2BOLT-WARNING: all recorded samples for this binary lack "
1597
- " SPE brstack entries. Record profile with:"
1598
- " perf record arm_spe_0/branch_filter=1/" ;
1599
+ " SPE brstack entries. The minimum required version of "
1600
+ " Linux-perf is v6.14 or higher for brstack support. "
1601
+ " With an older Linux-perf you may get zero samples. "
1602
+ " Plese also make sure about you recorded profile with: "
1603
+ " perf record -e 'arm_spe_0/branch_filter=1/'." ;
1599
1604
} else {
1600
1605
printBranchStacksDiagnostics (NumTotalSamples - NumSamples);
1601
1606
}
0 commit comments