File tree Expand file tree Collapse file tree 5 files changed +13
-5
lines changed Expand file tree Collapse file tree 5 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -400,8 +400,7 @@ class PrintProfileStats : public BinaryFunctionPass {
400400// / dyno stats categories.
401401class PrintProgramStats : public BinaryFunctionPass {
402402public:
403- explicit PrintProgramStats (const cl::opt<bool > &PrintPass)
404- : BinaryFunctionPass(PrintPass) {}
403+ explicit PrintProgramStats () : BinaryFunctionPass(false ) {}
405404
406405 const char *getName () const override { return " print-stats" ; }
407406 bool shouldPrint (const BinaryFunction &) const override { return false ; }
Original file line number Diff line number Diff line change 1414#include " bolt/Profile/DataAggregator.h"
1515#include " bolt/Core/BinaryContext.h"
1616#include " bolt/Core/BinaryFunction.h"
17+ #include " bolt/Passes/BinaryPasses.h"
1718#include " bolt/Profile/BoltAddressTranslation.h"
1819#include " bolt/Profile/Heatmap.h"
1920#include " bolt/Profile/YAMLProfileWriter.h"
@@ -611,6 +612,7 @@ Error DataAggregator::readProfile(BinaryContext &BC) {
611612 if (std::error_code EC = writeBATYAML (BC, opts::SaveProfile))
612613 report_error (" cannot create output data file" , EC);
613614 }
615+ BC.logBOLTErrorsAndQuitOnFatal (PrintProgramStats ().runOnFunctions (BC));
614616 }
615617
616618 return Error::success ();
Original file line number Diff line number Diff line change @@ -356,7 +356,7 @@ Error BinaryFunctionPassManager::runAllPasses(BinaryContext &BC) {
356356 // order they're registered.
357357
358358 // Run this pass first to use stats for the original functions.
359- Manager.registerPass (std::make_unique<PrintProgramStats>(NeverPrint ));
359+ Manager.registerPass (std::make_unique<PrintProgramStats>());
360360
361361 if (opts::PrintProfileStats)
362362 Manager.registerPass (std::make_unique<PrintProfileStats>(NeverPrint));
Original file line number Diff line number Diff line change @@ -292,7 +292,7 @@ class RewriteInstanceDiff {
292292 }
293293 }
294294 }
295- PrintProgramStats PPS (opts::NeverPrint) ;
295+ PrintProgramStats PPS;
296296 outs () << " * BOLT-DIFF: Starting print program stats pass for binary 1\n " ;
297297 RI1.BC ->logBOLTErrorsAndQuitOnFatal (PPS.runOnFunctions (*RI1.BC ));
298298 outs () << " * BOLT-DIFF: Starting print program stats pass for binary 2\n " ;
Original file line number Diff line number Diff line change @@ -11,7 +11,14 @@ REQUIRES: system-linux
1111
1212RUN: yaml2obj %p/Inputs/blarge.yaml &> %t.exe
1313RUN: perf2bolt %t.exe -o %t --pa -p %p/Inputs/pre-aggregated.txt -w %t.new \
14- RUN: --profile-use-dfs
14+ RUN: --profile-use-dfs | FileCheck %s
15+
16+ RUN: llvm-bolt %t.exe -data %t -o %t.null | FileCheck %s
17+ RUN: llvm-bolt %t.exe -data %t.new -o %t.null | FileCheck %s
18+ RUN: llvm-bolt %t.exe -p %p/Inputs/pre-aggregated.txt --pa -o %t.null | FileCheck %s
19+
20+ CHECK: BOLT-INFO: 4 out of 7 functions in the binary (57.1%) have non-empty execution profile
21+
1522RUN: cat %t | sort | FileCheck %s -check-prefix=PERF2BOLT
1623RUN: cat %t.new | FileCheck %s -check-prefix=NEWFORMAT
1724
You can’t perform that action at this time.
0 commit comments