diff --git a/bolt/lib/Profile/DataAggregator.cpp b/bolt/lib/Profile/DataAggregator.cpp --- a/bolt/lib/Profile/DataAggregator.cpp +++ b/bolt/lib/Profile/DataAggregator.cpp @@ -1295,8 +1295,8 @@ opts::HeatmapMaxAddress); uint64_t NumTotalSamples = 0; - while (hasData()) { - if (opts::BasicAggregation) { + if (opts::BasicAggregation) { + while (hasData()) { ErrorOr SampleRes = parseBasicSample(); if (std::error_code EC = SampleRes.getError()) { if (EC == errc::no_such_process) @@ -1306,7 +1306,10 @@ PerfBasicSample &Sample = SampleRes.get(); HM.registerAddress(Sample.PC); NumTotalSamples++; - } else { + } + outs() << "HEATMAP: read " << NumTotalSamples << " basic samples\n"; + } else { + while (hasData()) { ErrorOr SampleRes = parseBranchSample(); if (std::error_code EC = SampleRes.getError()) { if (EC == errc::no_such_process) @@ -1334,6 +1337,8 @@ } NumTotalSamples += Sample.LBR.size(); } + outs() << "HEATMAP: read " << NumTotalSamples << " LBR samples\n"; + outs() << "HEATMAP: " << FallthroughLBRs.size() << " unique traces\n"; } if (!NumTotalSamples) { @@ -1348,9 +1353,6 @@ exit(1); } - outs() << "HEATMAP: read " << NumTotalSamples << " LBR samples\n"; - outs() << "HEATMAP: " << FallthroughLBRs.size() << " unique traces\n"; - outs() << "HEATMAP: building heat map...\n"; for (const auto &LBR : FallthroughLBRs) {