1 # This script checks that perf2bolt is reading pre-aggregated perf information
2 # correctly for a simple example. The perf.data of this example was generated
3 # with the following command:
5 # $ perf record -j any,u -e branch -o perf.data -- ./blarge
7 # blarge is the binary for "basicmath large inputs" taken from Mibench.
9 # Currently failing in MacOS / generating different hash for usqrt
10 REQUIRES: system-linux
12 RUN: yaml2obj %p/Inputs/blarge.yaml &> %t.exe
13 RUN: perf2bolt %t.exe -o %t --pa -p %p/Inputs/pre-aggregated.txt -w %t.new \
14 RUN: --profile-use-dfs
15 RUN: cat %t | sort | FileCheck %s -check-prefix=PERF2BOLT
16 RUN: cat %t.new | FileCheck %s -check-prefix=NEWFORMAT
18 # Test --profile-format option with perf2bolt
19 RUN: perf2bolt %t.exe -o %t.fdata --pa -p %p/Inputs/pre-aggregated.txt \
20 RUN: --profile-format=fdata
21 RUN: cat %t.fdata | sort | FileCheck %s -check-prefix=PERF2BOLT
23 RUN: perf2bolt %t.exe -o %t.yaml --pa -p %p/Inputs/pre-aggregated.txt \
24 RUN: --profile-format=yaml --profile-use-dfs
25 RUN: cat %t.yaml | FileCheck %s -check-prefix=NEWFORMAT
27 # Test --profile-format option with llvm-bolt --aggregate-only
28 RUN: llvm-bolt %t.exe -o %t.bolt.fdata --pa -p %p/Inputs/pre-aggregated.txt \
29 RUN: --aggregate-only --profile-format=fdata
30 RUN: cat %t.bolt.fdata | sort | FileCheck %s -check-prefix=PERF2BOLT
32 RUN: llvm-bolt %t.exe -o %t.bolt.yaml --pa -p %p/Inputs/pre-aggregated.txt \
33 RUN: --aggregate-only --profile-format=yaml --profile-use-dfs
34 RUN: cat %t.bolt.yaml | FileCheck %s -check-prefix=NEWFORMAT
36 PERF2BOLT: 0 [unknown] 7f36d18d60c0 1 main 53c 0 2
37 PERF2BOLT: 1 main 451 1 SolveCubic 0 0 2
38 PERF2BOLT: 1 main 490 0 [unknown] 4005f0 0 1
39 PERF2BOLT: 1 main 537 0 [unknown] 400610 0 1
40 PERF2BOLT: 1 usqrt 30 1 usqrt 32 0 22
41 PERF2BOLT: 1 usqrt 30 1 usqrt 39 4 33
42 PERF2BOLT: 1 usqrt 35 1 usqrt 39 0 22
43 PERF2BOLT: 1 usqrt 3d 1 usqrt 10 0 58
44 PERF2BOLT: 1 usqrt 3d 1 usqrt 3f 0 22
45 PERF2BOLT: 1 usqrt a 1 usqrt 10 0 22
47 NEWFORMAT: - name: 'frame_dummy/1'
49 NEWFORMAT: hash: 0x28C72085C0BD8D37
52 NEWFORMAT: - name: usqrt
59 NEWFORMAT: succ: [ { bid: 1, cnt: 22 } ]
62 NEWFORMAT: succ: [ { bid: 3, cnt: 33, mis: 4 }, { bid: 2, cnt: 22 } ]
65 NEWFORMAT: succ: [ { bid: 3, cnt: 22 } ]
68 NEWFORMAT: succ: [ { bid: 1, cnt: 58 }, { bid: 4, cnt: 22 } ]