File tree 5 files changed +13
-5
lines changed
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 {
400
400
// / dyno stats categories.
401
401
class PrintProgramStats : public BinaryFunctionPass {
402
402
public:
403
- explicit PrintProgramStats (const cl::opt<bool > &PrintPass)
404
- : BinaryFunctionPass(PrintPass) {}
403
+ explicit PrintProgramStats () : BinaryFunctionPass(false ) {}
405
404
406
405
const char *getName () const override { return " print-stats" ; }
407
406
bool shouldPrint (const BinaryFunction &) const override { return false ; }
Original file line number Diff line number Diff line change 14
14
#include " bolt/Profile/DataAggregator.h"
15
15
#include " bolt/Core/BinaryContext.h"
16
16
#include " bolt/Core/BinaryFunction.h"
17
+ #include " bolt/Passes/BinaryPasses.h"
17
18
#include " bolt/Profile/BoltAddressTranslation.h"
18
19
#include " bolt/Profile/Heatmap.h"
19
20
#include " bolt/Profile/YAMLProfileWriter.h"
@@ -611,6 +612,7 @@ Error DataAggregator::readProfile(BinaryContext &BC) {
611
612
if (std::error_code EC = writeBATYAML (BC, opts::SaveProfile))
612
613
report_error (" cannot create output data file" , EC);
613
614
}
615
+ BC.logBOLTErrorsAndQuitOnFatal (PrintProgramStats ().runOnFunctions (BC));
614
616
}
615
617
616
618
return Error::success ();
Original file line number Diff line number Diff line change @@ -356,7 +356,7 @@ Error BinaryFunctionPassManager::runAllPasses(BinaryContext &BC) {
356
356
// order they're registered.
357
357
358
358
// 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>());
360
360
361
361
if (opts::PrintProfileStats)
362
362
Manager.registerPass (std::make_unique<PrintProfileStats>(NeverPrint));
Original file line number Diff line number Diff line change @@ -292,7 +292,7 @@ class RewriteInstanceDiff {
292
292
}
293
293
}
294
294
}
295
- PrintProgramStats PPS (opts::NeverPrint) ;
295
+ PrintProgramStats PPS;
296
296
outs () << " * BOLT-DIFF: Starting print program stats pass for binary 1\n " ;
297
297
RI1.BC ->logBOLTErrorsAndQuitOnFatal (PPS.runOnFunctions (*RI1.BC ));
298
298
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
11
11
12
12
RUN: yaml2obj %p/Inputs/blarge.yaml &> %t.exe
13
13
RUN: 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
+
15
22
RUN: cat %t | sort | FileCheck %s -check-prefix=PERF2BOLT
16
23
RUN: cat %t.new | FileCheck %s -check-prefix=NEWFORMAT
17
24
You can’t perform that action at this time.
0 commit comments