File: pre-aggregated-perf.test

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (68 lines) | stat: -rw-r--r-- 2,844 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# This script checks that perf2bolt is reading pre-aggregated perf information
# correctly for a simple example. The perf.data of this example was generated
# with the following command:
#
#  $ perf record -j any,u -e branch -o perf.data -- ./blarge
#
#  blarge is the binary for "basicmath large inputs" taken from Mibench.

# Currently failing in MacOS / generating different hash for usqrt
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:   --profile-use-dfs
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 --profile-use-dfs
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 --profile-use-dfs
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
PERF2BOLT: 1 main 537 0 [unknown] 400610 0 1
PERF2BOLT: 1 usqrt 30 1 usqrt 32 0 22
PERF2BOLT: 1 usqrt 30 1 usqrt 39 4 33
PERF2BOLT: 1 usqrt 35 1 usqrt 39 0 22
PERF2BOLT: 1 usqrt 3d 1 usqrt 10 0 58
PERF2BOLT: 1 usqrt 3d 1 usqrt 3f 0 22
PERF2BOLT: 1 usqrt a 1 usqrt 10 0 22

NEWFORMAT:  - name:            'frame_dummy/1'
NEWFORMAT:    fid:             3
NEWFORMAT:    hash:            0x24496F7F9594E89F
NEWFORMAT:    exec:            1

NEWFORMAT:  - name:            usqrt
NEWFORMAT:    fid:             7
NEWFORMAT:    exec:            0
NEWFORMAT:    nblocks:         5
NEWFORMAT:    blocks:
NEWFORMAT:      - bid:             0
NEWFORMAT:        insns:           4
NEWFORMAT:        succ:            [ { bid: 1, cnt: 22 } ]
NEWFORMAT:      - bid:             1
NEWFORMAT:        insns:           9
NEWFORMAT:        succ:            [ { bid: 3, cnt: 33, mis: 4 }, { bid: 2, cnt: 22 } ]
NEWFORMAT:      - bid:             2
NEWFORMAT:        insns:           2
NEWFORMAT:        succ:            [ { bid: 3, cnt: 22 } ]
NEWFORMAT:      - bid:             3
NEWFORMAT:        insns:           2
NEWFORMAT:        succ:            [ { bid: 1, cnt: 58 }, { bid: 4, cnt: 22 } ]