@@ -49,9 +49,7 @@ static cl::opt<bool>
4949 cl::desc (" aggregate basic samples (without LBR info)" ),
5050 cl::cat(AggregatorCategory));
5151
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." ),
5553 cl::cat(AggregatorCategory));
5654
5755static cl::opt<std::string>
@@ -187,7 +185,10 @@ void DataAggregator::start() {
187185 findPerfExecutable ();
188186
189187 if (opts::ArmSPE) {
190- // pid from_ip to_ip predicted/missed not-taken?
188+ // pid from_ip to_ip flags
189+ // where flags could be:
190+ // P/M: whether branch was Predicted or Mispredicted.
191+ // N: optionally appears when the branch was Not-Taken (ie fall-through)
191192 // 12345 0x123/0x456/PN/-/-/8/RET/-
192193 launchPerfProcess (" SPE brstack events" , MainEventsPPI,
193194 " script -F pid,brstack --itrace=bl" ,
@@ -1004,7 +1005,8 @@ ErrorOr<DataAggregator::LBREntry> DataAggregator::parseLBREntry() {
10041005 if (std::error_code EC = MispredStrRes.getError ())
10051006 return EC;
10061007 StringRef MispredStr = MispredStrRes.get ();
1007- // SPE brstack mispredicted flags might be two characters long: 'PN' or 'MN'.
1008+ // SPE brstack mispredicted flags might be up to two characters long:
1009+ // 'PN' or 'MN'. Where 'N' optionally appears.
10081010 bool ValidStrSize = opts::ArmSPE
10091011 ? MispredStr.size () >= 1 && MispredStr.size () <= 2
10101012 : MispredStr.size () == 1 ;
@@ -1521,7 +1523,7 @@ void DataAggregator::printBranchStacksDiagnostics(
15211523std::error_code DataAggregator::parseBranchEvents () {
15221524 std::string BranchEventTypeStr =
15231525 !opts::ArmSPE ? " branch events" : " SPE branch events in LBR-format" ;
1524- outs () << " PERF2BOLT: " << BranchEventTypeStr << " ...\n " ;
1526+ outs () << " PERF2BOLT: parse " << BranchEventTypeStr << " ...\n " ;
15251527 NamedRegionTimer T (" parseBranch" , " Parsing " + BranchEventTypeStr,
15261528 TimerGroupName, TimerGroupDesc, opts::TimeAggregator);
15271529
@@ -1582,8 +1584,11 @@ std::error_code DataAggregator::parseBranchEvents() {
15821584 else
15831585 errs ()
15841586 << " PERF2BOLT-WARNING: all recorded samples for this binary lack "
1585- " SPE brstack entries. Record profile with:"
1586- " perf record arm_spe_0/branch_filter=1/" ;
1587+ " SPE brstack entries. The minimum required version of "
1588+ " Linux-perf is v6.14 or higher for brstack support. "
1589+ " With an older Linux-perf you may get zero samples. "
1590+ " Plese also make sure about you recorded profile with: "
1591+ " perf record -e 'arm_spe_0/branch_filter=1/'." ;
15871592 } else {
15881593 printBranchStacksDiagnostics (NumTotalSamples - NumSamples);
15891594 }
0 commit comments