diff options
author | Amir Ayupov <aaupov@fb.com> | 2022-09-19 13:36:50 -0700 |
---|---|---|
committer | Amir Ayupov <aaupov@fb.com> | 2022-09-19 13:37:10 -0700 |
commit | 39336fc09cac61fa38a6bc2d30731fe0e38d38a2 (patch) | |
tree | d2c8213b0dadf2e83e85b115be14a32d7f2840f0 /bolt/test | |
parent | 6f3276d57e265be0996e2f67e2e872401da8f511 (diff) | |
download | llvm-39336fc09cac61fa38a6bc2d30731fe0e38d38a2.zip llvm-39336fc09cac61fa38a6bc2d30731fe0e38d38a2.tar.gz llvm-39336fc09cac61fa38a6bc2d30731fe0e38d38a2.tar.bz2 |
[BOLT] Control aggregation mode output profile file format
In perf2bolt and `-aggregate-only` BOLT mode, the output profile file is written
in fdata format by default. Provide a knob `-profile-format=[fdata,yaml]` to
control the format.
Note that `-w` option still dumps in YAML format.
Reviewed By: #bolt, maksfb
Differential Revision: https://reviews.llvm.org/D133995
Diffstat (limited to 'bolt/test')
-rw-r--r-- | bolt/test/X86/pre-aggregated-perf.test | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/bolt/test/X86/pre-aggregated-perf.test b/bolt/test/X86/pre-aggregated-perf.test index 4421c76..c737034 100644 --- a/bolt/test/X86/pre-aggregated-perf.test +++ b/bolt/test/X86/pre-aggregated-perf.test @@ -10,10 +10,28 @@ REQUIRES: system-linux RUN: yaml2obj %p/Inputs/blarge.yaml &> %t.exe -RUN: perf2bolt %t.exe -o %t -pa -p %p/Inputs/pre-aggregated.txt -w %t.new +RUN: perf2bolt %t.exe -o %t --pa -p %p/Inputs/pre-aggregated.txt -w %t.new RUN: cat %t | sort | FileCheck %s -check-prefix=PERF2BOLT RUN: cat %t.new | FileCheck %s -check-prefix=NEWFORMAT +# Test --profile-format option with perf2bolt +RUN: perf2bolt %t.exe -o %t.fdata --pa -p %p/Inputs/pre-aggregated.txt \ +RUN: --profile-format=fdata +RUN: cat %t.fdata | sort | FileCheck %s -check-prefix=PERF2BOLT + +RUN: perf2bolt %t.exe -o %t.yaml --pa -p %p/Inputs/pre-aggregated.txt \ +RUN: --profile-format=yaml +RUN: cat %t.yaml | FileCheck %s -check-prefix=NEWFORMAT + +# Test --profile-format option with llvm-bolt --aggregate-only +RUN: llvm-bolt %t.exe -o %t.bolt.fdata --pa -p %p/Inputs/pre-aggregated.txt \ +RUN: --aggregate-only --profile-format=fdata +RUN: cat %t.bolt.fdata | sort | FileCheck %s -check-prefix=PERF2BOLT + +RUN: llvm-bolt %t.exe -o %t.bolt.yaml --pa -p %p/Inputs/pre-aggregated.txt \ +RUN: --aggregate-only --profile-format=yaml +RUN: cat %t.bolt.yaml | FileCheck %s -check-prefix=NEWFORMAT + PERF2BOLT: 0 [unknown] 7f36d18d60c0 1 main 53c 0 2 PERF2BOLT: 1 main 451 1 SolveCubic 0 0 2 PERF2BOLT: 1 main 490 0 [unknown] 4005f0 0 1 |