@@ -1342,7 +1342,7 @@ std::error_code DataAggregator::printLBRHeatMap() {
13421342 if (!NumTotalSamples) {
13431343 if (opts::BasicAggregation) {
13441344 errs () << " HEATMAP-ERROR: no basic event samples detected in profile. "
1345- " Cannot build heatmap.\n " ;
1345+ " Cannot build heatmap." ;
13461346 } else {
13471347 errs () << " HEATMAP-ERROR: no LBR traces detected in profile. "
13481348 " Cannot build heatmap. Use -nl for building heatmap from "
@@ -1355,8 +1355,11 @@ std::error_code DataAggregator::printLBRHeatMap() {
13551355
13561356 for (const auto &[PC, Hits] : BasicSamples)
13571357 HM.registerAddress (PC, Hits);
1358- for (const auto &[Trace, Info] : FallthroughLBRs)
1358+ for (const auto &LBR : FallthroughLBRs) {
1359+ const Trace &Trace = LBR.first ;
1360+ const FTInfo &Info = LBR.second ;
13591361 HM.registerAddressRange (Trace.From , Trace.To , Info.InternCount );
1362+ }
13601363
13611364 if (HM.getNumInvalidRanges ())
13621365 outs () << " HEATMAP: invalid traces: " << HM.getNumInvalidRanges () << ' \n ' ;
@@ -1639,7 +1642,7 @@ std::error_code DataAggregator::parseBasicEvents() {
16391642 ++BasicSamples[Sample->PC ];
16401643 EventNames.insert (Sample->EventName );
16411644 }
1642- outs () << " PERF2BOLT: read " << NumTotalSamples << " samples\n " ;
1645+ outs () << " PERF2BOLT: read " << NumTotalSamples << " basic samples\n " ;
16431646
16441647 return std::error_code ();
16451648}
@@ -1649,11 +1652,17 @@ void DataAggregator::processBasicEvents() {
16491652 NamedRegionTimer T (" processBasic" , " Processing basic events" , TimerGroupName,
16501653 TimerGroupDesc, opts::TimeAggregator);
16511654 uint64_t OutOfRangeSamples = 0 ;
1652- for (const auto [PC, HitCount] : BasicSamples)
1653- if (BinaryFunction *Func = getBinaryFunctionContainingAddress (PC))
1654- doSample (*Func, PC, HitCount);
1655- else
1655+ for (auto &Sample : BasicSamples) {
1656+ const uint64_t PC = Sample.first ;
1657+ const uint64_t HitCount = Sample.second ;
1658+ BinaryFunction *Func = getBinaryFunctionContainingAddress (PC);
1659+ if (!Func) {
16561660 OutOfRangeSamples += HitCount;
1661+ continue ;
1662+ }
1663+
1664+ doSample (*Func, PC, HitCount);
1665+ }
16571666
16581667 printBasicSamplesDiagnostics (OutOfRangeSamples);
16591668}
0 commit comments