@@ -640,8 +640,6 @@ bool DataAggregator::doBasicSample(BinaryFunction &OrigFunc, uint64_t Address,
640640
641641 BinaryFunction *ParentFunc = getBATParentFunction (OrigFunc);
642642 BinaryFunction &Func = ParentFunc ? *ParentFunc : OrigFunc;
643- if (ParentFunc || (BAT && !BAT->isBATFunction (Func.getAddress ())))
644- NumColdSamples += Count;
645643 // Attach executed bytes to parent function in case of cold fragment.
646644 Func.SampleCountInBytes += Count * BlockSize;
647645
@@ -745,15 +743,10 @@ bool DataAggregator::doBranch(uint64_t From, uint64_t To, uint64_t Count,
745743 if (BAT)
746744 Addr = BAT->translate (Func->getAddress (), Addr, IsFrom);
747745
748- BinaryFunction *ParentFunc = getBATParentFunction (*Func);
749- if (IsFrom &&
750- (ParentFunc || (BAT && !BAT->isBATFunction (Func->getAddress ()))))
751- NumColdSamples += Count;
746+ if (BinaryFunction *ParentFunc = getBATParentFunction (*Func))
747+ Func = ParentFunc;
752748
753- if (!ParentFunc)
754- return std::pair{Func, IsRet};
755-
756- return std::pair{ParentFunc, IsRet};
749+ return std::pair{Func, IsRet};
757750 };
758751
759752 auto [FromFunc, IsReturn] = handleAddress (From, /* IsFrom*/ true );
@@ -1450,20 +1443,6 @@ void DataAggregator::parseLBRSample(const PerfBranchSample &Sample,
14501443 }
14511444}
14521445
1453- void DataAggregator::printColdSamplesDiagnostic () const {
1454- if (NumColdSamples > 0 ) {
1455- const float ColdSamples = NumColdSamples * 100 .0f / NumTotalSamples;
1456- outs () << " PERF2BOLT: " << NumColdSamples
1457- << format (" (%.1f%%)" , ColdSamples)
1458- << " samples recorded in cold regions of split functions.\n " ;
1459- if (ColdSamples > 5 .0f )
1460- outs ()
1461- << " WARNING: The BOLT-processed binary where samples were collected "
1462- " likely used bad data or your service observed a large shift in "
1463- " profile. You may want to audit this\n " ;
1464- }
1465- }
1466-
14671446void DataAggregator::printLongRangeTracesDiagnostic () const {
14681447 outs () << " PERF2BOLT: out of range traces involving unknown regions: "
14691448 << NumLongRangeTraces;
@@ -1504,7 +1483,6 @@ void DataAggregator::printBranchSamplesDiagnostics() const {
15041483 " collection. The generated data may be ineffective for improving "
15051484 " performance\n\n " ;
15061485 printLongRangeTracesDiagnostic ();
1507- printColdSamplesDiagnostic ();
15081486}
15091487
15101488void DataAggregator::printBasicSamplesDiagnostics (
@@ -1516,7 +1494,6 @@ void DataAggregator::printBasicSamplesDiagnostics(
15161494 " binary is probably not the same binary used during profiling "
15171495 " collection. The generated data may be ineffective for improving "
15181496 " performance\n\n " ;
1519- printColdSamplesDiagnostic ();
15201497}
15211498
15221499void DataAggregator::printBranchStacksDiagnostics (
0 commit comments