mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-25 05:52:53 +02:00
be7342fab7
This adds a detailed profile summary in llvm-profdata. The summary is in the form of one or more triples of the form (P, N, M) which is interpreted as if we look at the Top-N counts in the profile, their sum accounts for P percentage of the sum of all counts in the program and the minimum count in the Top-N is M. Differential Revision: http://reviews.llvm.org/D16005 llvm-svn: 257680
85 lines
3.6 KiB
Plaintext
85 lines
3.6 KiB
Plaintext
|
|
|
|
# RUN: llvm-profdata merge %s -o %t.profdata
|
|
|
|
# RUN: llvm-profdata show %t.profdata --function function_count_only --counts | FileCheck %s -check-prefix=FUNC_COUNT_ONLY
|
|
function_count_only
|
|
0
|
|
1
|
|
97531
|
|
# FUNC_COUNT_ONLY: Hash: 0x{{0+$}}
|
|
# FUNC_COUNT_ONLY-NEXT: Counters: 1
|
|
# FUNC_COUNT_ONLY-NEXT: Function count: 97531
|
|
# FUNC_COUNT_ONLY-NEXT: Block counts: []
|
|
|
|
# RUN: llvm-profdata show %t.profdata --function "name with spaces" --counts | FileCheck %s -check-prefix=SPACES
|
|
name with spaces
|
|
1024
|
|
2
|
|
0
|
|
0
|
|
# SPACES: Hash: 0x{{0+}}400
|
|
# SPACES-NEXT: Counters: 2
|
|
# SPACES-NEXT: Function count: 0
|
|
# SPACES-NEXT: Block counts: [0]
|
|
|
|
# RUN: llvm-profdata show %t.profdata --function large_numbers --counts | FileCheck %s -check-prefix=LARGENUM
|
|
large_numbers
|
|
4611686018427387903
|
|
6
|
|
2305843009213693952
|
|
1152921504606846976
|
|
576460752303423488
|
|
288230376151711744
|
|
144115188075855872
|
|
72057594037927936
|
|
# LARGENUM: Hash: 0x3fffffffffffffff
|
|
# LARGENUM-NEXT: Counters: 6
|
|
# LARGENUM-NEXT: Function count: 2305843009213693952
|
|
# LARGENUM-NEXT: Block counts: [1152921504606846976, 576460752303423488, 288230376151711744, 144115188075855872, 72057594037927936]
|
|
|
|
# RUN: llvm-profdata show %t.profdata --function hex_hash | FileCheck %s -check-prefix=HEX-HASH
|
|
hex_hash
|
|
0x1234
|
|
1
|
|
0
|
|
# HEX-HASH: Hash: 0x0000000000001234
|
|
# HEX-HASH-NEXT: Counters: 1
|
|
|
|
# RUN: llvm-profdata show %t.profdata --function NOSUCHFUNC | FileCheck %s -check-prefix=NOSUCHFUNC
|
|
# NOSUCHFUNC-NOT: Counters:
|
|
# NOSUCHFUNC: Functions shown: 0
|
|
|
|
# RUN: llvm-profdata show %t.profdata --function _ | FileCheck %s -check-prefix=SOMEFUNCS
|
|
# SOMEFUNCS: Counters:
|
|
# SOMEFUNCS: function_count_only:
|
|
# SOMEFUNCS: large_numbers:
|
|
# SOMEFUNCS: Functions shown: 3
|
|
|
|
# RUN: llvm-profdata show %t.profdata | FileCheck %s -check-prefix=SUMMARY
|
|
# SUMMARY-NOT: Counters:
|
|
# SUMMARY-NOT: Functions shown:
|
|
# SUMMARY: Total functions: 4
|
|
# SUMMARY: Maximum function count: 2305843009213693952
|
|
# SUMMARY: Maximum internal block count: 1152921504606846976
|
|
|
|
# RUN: llvm-profdata show --detailed-summary %t.profdata | FileCheck %s -check-prefix=DETAILED-SUMMARY
|
|
# DETAILED-SUMMARY: Detailed summary:
|
|
# DETAILED-SUMMARY: Total number of blocks: 6
|
|
# DETAILED-SUMMARY: Total count: 2233785415175766016
|
|
# DETAILED-SUMMARY: 3 blocks with count >= 288230376151711744 account for 80 percentage of the total counts
|
|
# DETAILED-SUMMARY: 3 blocks with count >= 288230376151711744 account for 90 percentage of the total counts
|
|
# DETAILED-SUMMARY: 4 blocks with count >= 144115188075855872 account for 95 percentage of the total counts.
|
|
# DETAILED-SUMMARY: 5 blocks with count >= 72057594037927936 account for 99 percentage of the total counts.
|
|
# DETAILED-SUMMARY: 5 blocks with count >= 72057594037927936 account for 99.9 percentage of the total counts.
|
|
# DETAILED-SUMMARY: 5 blocks with count >= 72057594037927936 account for 99.99 percentage of the total counts.
|
|
# DETAILED-SUMMARY: 5 blocks with count >= 72057594037927936 account for 99.999 percentage of the total counts.
|
|
|
|
# RUN: llvm-profdata show --detailed-summary --detailed-summary-cutoffs=600000 %t.profdata | FileCheck %s -check-prefix=DETAILED-SUMMARY-2
|
|
# DETAILED-SUMMARY-2: 2 blocks with count >= 576460752303423488 account for 60 percentage of the total counts.
|
|
#
|
|
# RUN: llvm-profdata show --detailed-summary --detailed-summary-cutoffs=600000,900000,999999 %t.profdata | FileCheck %s -check-prefix=DETAILED-SUMMARY-3
|
|
# DETAILED-SUMMARY-3: 2 blocks with count >= 576460752303423488 account for 60 percentage of the total counts.
|
|
# DETAILED-SUMMARY-3: 3 blocks with count >= 288230376151711744 account for 90 percentage of the total counts
|
|
# DETAILED-SUMMARY-3: 5 blocks with count >= 72057594037927936 account for 99.9999 percentage of the total counts.
|