1
2
3# RUN: llvm-profdata merge %s -o %t.profdata
4
5# RUN: llvm-profdata show %t.profdata --function function_count_only --counts | FileCheck %s -check-prefix=FUNC_COUNT_ONLY
6function_count_only
70
81
997531
10# FUNC_COUNT_ONLY:      Hash: 0x{{0+$}}
11# FUNC_COUNT_ONLY-NEXT: Counters: 1
12# FUNC_COUNT_ONLY-NEXT: Function count: 97531
13# FUNC_COUNT_ONLY-NEXT: Block counts: []
14
15# RUN: llvm-profdata show %t.profdata --function "name with spaces" --counts | FileCheck %s -check-prefix=SPACES
16name with spaces
171024
182
190
200
21# SPACES:      Hash: 0x{{0+}}400
22# SPACES-NEXT: Counters: 2
23# SPACES-NEXT: Function count: 0
24# SPACES-NEXT: Block counts: [0]
25
26# RUN: llvm-profdata show %t.profdata --function large_numbers --counts | FileCheck %s -check-prefix=LARGENUM
27large_numbers
284611686018427387903
296
302305843009213693952
311152921504606846976
32576460752303423488
33288230376151711744
34144115188075855872
3572057594037927936
36# LARGENUM:      Hash: 0x3fffffffffffffff
37# LARGENUM-NEXT: Counters: 6
38# LARGENUM-NEXT: Function count: 2305843009213693952
39# LARGENUM-NEXT: Block counts: [1152921504606846976, 576460752303423488, 288230376151711744, 144115188075855872, 72057594037927936]
40
41# RUN: llvm-profdata show %t.profdata --function hex_hash | FileCheck %s -check-prefix=HEX-HASH
42hex_hash
430x1234
441
450
46# HEX-HASH: Hash: 0x0000000000001234
47# HEX-HASH-NEXT: Counters: 1
48
49# RUN: llvm-profdata show %t.profdata --function NOSUCHFUNC | FileCheck %s -check-prefix=NOSUCHFUNC
50# NOSUCHFUNC-NOT: Counters:
51# NOSUCHFUNC: Functions shown: 0
52
53# RUN: llvm-profdata show %t.profdata --function _ | FileCheck %s -check-prefix=SOMEFUNCS
54# SOMEFUNCS: Counters:
55# SOMEFUNCS: function_count_only:
56# SOMEFUNCS: large_numbers:
57# SOMEFUNCS: Functions shown: 3
58
59# RUN: llvm-profdata show %t.profdata | FileCheck %s -check-prefix=SUMMARY
60# SUMMARY-NOT: Counters:
61# SUMMARY-NOT: Functions shown:
62# SUMMARY: Total functions: 4
63# SUMMARY: Maximum function count: 2305843009213693952
64# SUMMARY: Maximum internal block count: 1152921504606846976
65
66# RUN: llvm-profdata show --detailed-summary %t.profdata | FileCheck %s -check-prefix=DETAILED-SUMMARY
67# DETAILED-SUMMARY: Detailed summary:
68# DETAILED-SUMMARY: Total number of blocks: 6
69# DETAILED-SUMMARY: Total count: 2233785415175766016
70# DETAILED-SUMMARY: 3 blocks with count >= 288230376151711744 account for 80 percentage of the total counts
71# DETAILED-SUMMARY: 3 blocks with count >= 288230376151711744 account for 90 percentage of the total counts
72# DETAILED-SUMMARY: 4 blocks with count >= 144115188075855872 account for 95 percentage of the total counts.
73# DETAILED-SUMMARY: 5 blocks with count >= 72057594037927936 account for 99 percentage of the total counts.
74# DETAILED-SUMMARY: 5 blocks with count >= 72057594037927936 account for 99.9 percentage of the total counts.
75# DETAILED-SUMMARY: 5 blocks with count >= 72057594037927936 account for 99.99 percentage of the total counts.
76# DETAILED-SUMMARY: 5 blocks with count >= 72057594037927936 account for 99.999 percentage of the total counts.
77
78# RUN: llvm-profdata show --detailed-summary --detailed-summary-cutoffs=600000 %t.profdata | FileCheck %s -check-prefix=DETAILED-SUMMARY-2
79# DETAILED-SUMMARY-2: 2 blocks with count >= 576460752303423488 account for 60 percentage of the total counts.
80#
81# RUN: llvm-profdata show --detailed-summary --detailed-summary-cutoffs=600000,900000,999999 %t.profdata | FileCheck %s -check-prefix=DETAILED-SUMMARY-3
82# DETAILED-SUMMARY-3: 2 blocks with count >= 576460752303423488 account for 60 percentage of the total counts.
83# DETAILED-SUMMARY-3: 3 blocks with count >= 288230376151711744 account for 90 percentage of the total counts
84# DETAILED-SUMMARY-3: 5 blocks with count >= 72057594037927936 account for 99.9999 percentage of the total counts.
85