diff --git a/llvm/tools/llvm-profgen/PerfReader.h b/llvm/tools/llvm-profgen/PerfReader.h --- a/llvm/tools/llvm-profgen/PerfReader.h +++ b/llvm/tools/llvm-profgen/PerfReader.h @@ -580,6 +580,7 @@ uint64_t NumTotalSample = 0; uint64_t NumLeafExternalFrame = 0; uint64_t NumLeadingOutgoingLBR = 0; + uint64_t NumEmptyLBRSample = 0; }; // Read perf script to parse the events and samples. diff --git a/llvm/tools/llvm-profgen/PerfReader.cpp b/llvm/tools/llvm-profgen/PerfReader.cpp --- a/llvm/tools/llvm-profgen/PerfReader.cpp +++ b/llvm/tools/llvm-profgen/PerfReader.cpp @@ -748,7 +748,7 @@ } } else { // LBR sample is encoded in single line after stack sample - exitWithError("'Hybrid perf sample is corrupted, No LBR sample line"); + NumEmptyLBRSample++; } } @@ -1204,6 +1204,8 @@ // Parse perf traces and do aggregation. parseAndAggregateTrace(); + emitWarningSummary(NumEmptyLBRSample, NumTotalSample, + "of hybrid samples have call stack sample but no LBR sample"); emitWarningSummary(NumLeafExternalFrame, NumTotalSample, "of samples have leaf external frame in call stack."); emitWarningSummary(NumLeadingOutgoingLBR, NumTotalSample,