| 1 |
# RUN: llvm-profdata merge -sparse=true %s -o %t.profdata |
| 2 |
|
| 3 |
# RUN: llvm-profdata merge -sparse=false %s -o %t.profdata.dense |
| 4 |
|
| 5 |
# RUN: llvm-profdata show %t.profdata --function function_count_only --counts | FileCheck %s -check-prefix=FUNC_COUNT_ONLY |
| 6 |
function_count_only |
| 7 |
0 |
| 8 |
1 |
| 9 |
97531 |
| 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.dense --function "name with spaces" --counts | FileCheck %s -check-prefix=SPACES |
| 16 |
# RUN: llvm-profdata show %t.profdata --function "name with spaces" --counts | FileCheck %s --check-prefix=SPARSE_SPACES |
| 17 |
name with spaces |
| 18 |
1024 |
| 19 |
2 |
| 20 |
0 |
| 21 |
0 |
| 22 |
# SPACES: Hash: 0x{{0+}}400 |
| 23 |
# SPACES-NEXT: Counters: 2 |
| 24 |
# SPACES-NEXT: Function count: 0 |
| 25 |
# SPACES-NEXT: Block counts: [0] |
| 26 |
# SPARSE_SPACES-NOT: Function count: 0 |
| 27 |
|
| 28 |
# RUN: llvm-profdata show %t.profdata --function large_numbers --counts | FileCheck %s -check-prefix=LARGENUM |
| 29 |
large_numbers |
| 30 |
4611686018427387903 |
| 31 |
6 |
| 32 |
2305843009213693952 |
| 33 |
1152921504606846976 |
| 34 |
576460752303423488 |
| 35 |
288230376151711744 |
| 36 |
144115188075855872 |
| 37 |
72057594037927936 |
| 38 |
# LARGENUM: Hash: 0x3fffffffffffffff |
| 39 |
# LARGENUM-NEXT: Counters: 6 |
| 40 |
# LARGENUM-NEXT: Function count: 2305843009213693952 |
| 41 |
# LARGENUM-NEXT: Block counts: [1152921504606846976, 576460752303423488, 288230376151711744, 144115188075855872, 72057594037927936] |
| 42 |
|
| 43 |
# RUN: llvm-profdata show %t.profdata.dense --function hex_hash | FileCheck %s -check-prefix=HEX-HASH |
| 44 |
hex_hash |
| 45 |
0x1234 |
| 46 |
1 |
| 47 |
0 |
| 48 |
# HEX-HASH: Hash: 0x0000000000001234 |
| 49 |
# HEX-HASH-NEXT: Counters: 1 |
| 50 |
|
| 51 |
# RUN: llvm-profdata show %t.profdata --function NOSUCHFUNC | FileCheck %s -check-prefix=NOSUCHFUNC |
| 52 |
# NOSUCHFUNC-NOT: Counters: |
| 53 |
# NOSUCHFUNC: Functions shown: 0 |
| 54 |
|
| 55 |
# RUN: llvm-profdata show %t.profdata --function _ | FileCheck %s -check-prefix=SOMEFUNCS |
| 56 |
# RUN: llvm-profdata show %t.profdata.dense --function _ | FileCheck %s -check-prefix=SOMEFUNCS_DENSE |
| 57 |
# SOMEFUNCS: Counters: |
| 58 |
# SOMEFUNCS-DAG: large_numbers: |
| 59 |
# SOMEFUNCS-DAG: function_count_only: |
| 60 |
# SOMEFUNCS: Functions shown: 2 |
| 61 |
# SOMEFUNCS_DENSE: Functions shown: 3 |
| 62 |
|
| 63 |
# RUN: llvm-profdata show %t.profdata.dense | FileCheck %s -check-prefix=SUMMARY |
| 64 |
# SUMMARY-NOT: Counters: |
| 65 |
# SUMMARY-NOT: Functions shown: |
| 66 |
# SUMMARY: Total functions: 4 |
| 67 |
# SUMMARY: Maximum function count: 2305843009213693952 |
| 68 |
# SUMMARY: Maximum internal block count: 1152921504606846976 |
| 69 |
|
| 70 |
# RUN: llvm-profdata show --detailed-summary %t.profdata.dense | FileCheck %s -check-prefix=DETAILED-SUMMARY |
| 71 |
# DETAILED-SUMMARY: Total number of blocks: 10 |
| 72 |
# DETAILED-SUMMARY: Total count: 4539628424389557499 |
| 73 |
# DETAILED-SUMMARY: Detailed summary: |
| 74 |
# DETAILED-SUMMARY: 3 blocks (30.00%) with count >= 576460752303423488 account for 80% of the total counts. |
| 75 |
# DETAILED-SUMMARY: 4 blocks (40.00%) with count >= 288230376151711744 account for 90% of the total counts. |
| 76 |
# DETAILED-SUMMARY: 4 blocks (40.00%) with count >= 288230376151711744 account for 95% of the total counts. |
| 77 |
# DETAILED-SUMMARY: 6 blocks (60.00%) with count >= 72057594037927936 account for 99% of the total counts. |
| 78 |
# DETAILED-SUMMARY: 6 blocks (60.00%) with count >= 72057594037927936 account for 99.9% of the total counts. |
| 79 |
# DETAILED-SUMMARY: 6 blocks (60.00%) with count >= 72057594037927936 account for 99.99% of the total counts. |
| 80 |
# DETAILED-SUMMARY: 6 blocks (60.00%) with count >= 72057594037927936 account for 99.999% of the total counts. |
| 81 |
|
| 82 |
# RUN: llvm-profdata show --detailed-summary --detailed-summary-cutoffs=600000 %t.profdata | FileCheck %s -check-prefix=DETAILED-SUMMARY-2 |
| 83 |
# DETAILED-SUMMARY-2: 2 blocks (28.57%) with count >= 1152921504606846976 account for 60% of the total counts. |
| 84 |
# |
| 85 |
# RUN: llvm-profdata show --detailed-summary --detailed-summary-cutoffs=600000,900000,999999 %t.profdata | FileCheck %s -check-prefix=DETAILED-SUMMARY-3 |
| 86 |
# DETAILED-SUMMARY-3: 2 blocks (28.57%) with count >= 1152921504606846976 account for 60% of the total counts. |
| 87 |
# DETAILED-SUMMARY-3: 4 blocks (57.14%) with count >= 288230376151711744 account for 90% of the total counts. |
| 88 |
# DETAILED-SUMMARY-3: 6 blocks (85.71%) with count >= 72057594037927936 account for 99.9999% of the total counts. |