mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 04:02:41 +01:00
[llvm-dwarfdump][Statistics] Change the coverage buckets representation. NFC
Summary: This changes the representation of 'coverage buckets' in llvm-dwarfdump and llvm-locstats to one that makes more clear what the buckets contain. See some related details in D71070. Reviewers: djtodoro, aprantl, cmtice, jhenderson Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D71366
This commit is contained in:
parent
e5e610c551
commit
f42c025b44
@ -18,8 +18,8 @@ pretty printing it in a more human readable way.
|
||||
The line 0% shows the number and the percentage of DIEs with no location
|
||||
information, but the line 100% shows the information for DIEs where there is
|
||||
location information in all code section bytes (where the variable or parameter
|
||||
is in the scope). The line 50-59% shows the number and the percentage of DIEs
|
||||
where the location information is between 50 and 59 percentage of its scope
|
||||
is in the scope). The line [50%,60%) shows the number and the percentage of DIEs
|
||||
where the location information is between 50 and 60 percentage of its scope
|
||||
covered.
|
||||
|
||||
OPTIONS
|
||||
@ -55,16 +55,16 @@ OUTPUT EXAMPLE
|
||||
cov% samples percentage(~)
|
||||
-------------------------------------------------
|
||||
0% 1 16%
|
||||
1-9% 0 0%
|
||||
10-19% 0 0%
|
||||
20-29% 0 0%
|
||||
30-39% 0 0%
|
||||
40-49% 0 0%
|
||||
50-59% 1 16%
|
||||
60-69% 0 0%
|
||||
70-79% 0 0%
|
||||
80-89% 1 16%
|
||||
90-99% 0 0%
|
||||
[1%,10%) 0 0%
|
||||
[10%,20%) 0 0%
|
||||
[20%,30%) 0 0%
|
||||
[30%,40%) 0 0%
|
||||
[40%,50%) 0 0%
|
||||
[50%,60%) 1 16%
|
||||
[60%,70%) 0 0%
|
||||
[70%,80%) 0 0%
|
||||
[80%,90%) 1 16%
|
||||
[90%,100%) 0 0%
|
||||
100% 3 50%
|
||||
=================================================
|
||||
-the number of debug variables processed: 6
|
||||
|
@ -10,78 +10,78 @@
|
||||
; CHECK: "vars entry value scope bytes covered":0
|
||||
; CHECK: "total variables procesed by location statistics":6
|
||||
; CHECK: "variables with 0% of its scope covered":1
|
||||
; CHECK: "variables with 1-9% of its scope covered":0
|
||||
; CHECK: "variables with 10-19% of its scope covered":0
|
||||
; CHECK: "variables with 20-29% of its scope covered":0
|
||||
; CHECK: "variables with 30-39% of its scope covered":0
|
||||
; CHECK: "variables with 40-49% of its scope covered":0
|
||||
; CHECK: "variables with 50-59% of its scope covered":1
|
||||
; CHECK: "variables with 60-69% of its scope covered":0
|
||||
; CHECK: "variables with 70-79% of its scope covered":0
|
||||
; CHECK: "variables with 80-89% of its scope covered":1
|
||||
; CHECK: "variables with 90-99% of its scope covered":0
|
||||
; CHECK: "variables with [1%,10%) of its scope covered":0
|
||||
; CHECK: "variables with [10%,20%) of its scope covered":0
|
||||
; CHECK: "variables with [20%,30%) of its scope covered":0
|
||||
; CHECK: "variables with [30%,40%) of its scope covered":0
|
||||
; CHECK: "variables with [40%,50%) of its scope covered":0
|
||||
; CHECK: "variables with [50%,60%) of its scope covered":1
|
||||
; CHECK: "variables with [60%,70%) of its scope covered":0
|
||||
; CHECK: "variables with [70%,80%) of its scope covered":0
|
||||
; CHECK: "variables with [80%,90%) of its scope covered":1
|
||||
; CHECK: "variables with [90%,100%) of its scope covered":0
|
||||
; CHECK: "variables with 100% of its scope covered":3
|
||||
; CHECK: "variables (excluding the debug entry values) with 0% of its scope covered":1
|
||||
; CHECK: "variables (excluding the debug entry values) with 1-9% of its scope covered":0
|
||||
; CHECK: "variables (excluding the debug entry values) with 10-19% of its scope covered":0
|
||||
; CHECK: "variables (excluding the debug entry values) with 20-29% of its scope covered":0
|
||||
; CHECK: "variables (excluding the debug entry values) with 30-39% of its scope covered":0
|
||||
; CHECK: "variables (excluding the debug entry values) with 40-49% of its scope covered":0
|
||||
; CHECK: "variables (excluding the debug entry values) with 50-59% of its scope covered":2
|
||||
; CHECK: "variables (excluding the debug entry values) with 60-69% of its scope covered":0
|
||||
; CHECK: "variables (excluding the debug entry values) with 70-79% of its scope covered":0
|
||||
; CHECK: "variables (excluding the debug entry values) with 80-89% of its scope covered":1
|
||||
; CHECK: "variables (excluding the debug entry values) with 90-99% of its scope covered":0
|
||||
; CHECK: "variables (excluding the debug entry values) with [1%,10%) of its scope covered":0
|
||||
; CHECK: "variables (excluding the debug entry values) with [10%,20%) of its scope covered":0
|
||||
; CHECK: "variables (excluding the debug entry values) with [20%,30%) of its scope covered":0
|
||||
; CHECK: "variables (excluding the debug entry values) with [30%,40%) of its scope covered":0
|
||||
; CHECK: "variables (excluding the debug entry values) with [40%,50%) of its scope covered":0
|
||||
; CHECK: "variables (excluding the debug entry values) with [50%,60%) of its scope covered":2
|
||||
; CHECK: "variables (excluding the debug entry values) with [60%,70%) of its scope covered":0
|
||||
; CHECK: "variables (excluding the debug entry values) with [70%,80%) of its scope covered":0
|
||||
; CHECK: "variables (excluding the debug entry values) with [80%,90%) of its scope covered":1
|
||||
; CHECK: "variables (excluding the debug entry values) with [90%,100%) of its scope covered":0
|
||||
; CHECK: "variables (excluding the debug entry values) with 100% of its scope covered":2
|
||||
; CHECK: "total params procesed by location statistics":2
|
||||
; CHECK: "params with 0% of its scope covered":0
|
||||
; CHECK: "params with 1-9% of its scope covered":0
|
||||
; CHECK: "params with 10-19% of its scope covered":0
|
||||
; CHECK: "params with 20-29% of its scope covered":0
|
||||
; CHECK: "params with 30-39% of its scope covered":0
|
||||
; CHECK: "params with 40-49% of its scope covered":0
|
||||
; CHECK: "params with 50-59% of its scope covered":0
|
||||
; CHECK: "params with 60-69% of its scope covered":0
|
||||
; CHECK: "params with 70-79% of its scope covered":0
|
||||
; CHECK: "params with 80-89% of its scope covered":0
|
||||
; CHECK: "params with 90-99% of its scope covered":0
|
||||
; CHECK: "params with [1%,10%) of its scope covered":0
|
||||
; CHECK: "params with [10%,20%) of its scope covered":0
|
||||
; CHECK: "params with [20%,30%) of its scope covered":0
|
||||
; CHECK: "params with [30%,40%) of its scope covered":0
|
||||
; CHECK: "params with [40%,50%) of its scope covered":0
|
||||
; CHECK: "params with [50%,60%) of its scope covered":0
|
||||
; CHECK: "params with [60%,70%) of its scope covered":0
|
||||
; CHECK: "params with [70%,80%) of its scope covered":0
|
||||
; CHECK: "params with [80%,90%) of its scope covered":0
|
||||
; CHECK: "params with [90%,100%) of its scope covered":0
|
||||
; CHECK: "params with 100% of its scope covered":2
|
||||
; CHECK: "params (excluding the debug entry values) with 0% of its scope covered":0
|
||||
; CHECK: "params (excluding the debug entry values) with 1-9% of its scope covered":0
|
||||
; CHECK: "params (excluding the debug entry values) with 10-19% of its scope covered":0
|
||||
; CHECK: "params (excluding the debug entry values) with 20-29% of its scope covered":0
|
||||
; CHECK: "params (excluding the debug entry values) with 30-39% of its scope covered":0
|
||||
; CHECK: "params (excluding the debug entry values) with 40-49% of its scope covered":0
|
||||
; CHECK: "params (excluding the debug entry values) with 50-59% of its scope covered":1
|
||||
; CHECK: "params (excluding the debug entry values) with 60-69% of its scope covered":0
|
||||
; CHECK: "params (excluding the debug entry values) with 70-79% of its scope covered":0
|
||||
; CHECK: "params (excluding the debug entry values) with 80-89% of its scope covered":0
|
||||
; CHECK: "params (excluding the debug entry values) with 90-99% of its scope covered":0
|
||||
; CHECK: "params (excluding the debug entry values) with [1%,10%) of its scope covered":0
|
||||
; CHECK: "params (excluding the debug entry values) with [10%,20%) of its scope covered":0
|
||||
; CHECK: "params (excluding the debug entry values) with [20%,30%) of its scope covered":0
|
||||
; CHECK: "params (excluding the debug entry values) with [30%,40%) of its scope covered":0
|
||||
; CHECK: "params (excluding the debug entry values) with [40%,50%) of its scope covered":0
|
||||
; CHECK: "params (excluding the debug entry values) with [50%,60%) of its scope covered":1
|
||||
; CHECK: "params (excluding the debug entry values) with [60%,70%) of its scope covered":0
|
||||
; CHECK: "params (excluding the debug entry values) with [70%,80%) of its scope covered":0
|
||||
; CHECK: "params (excluding the debug entry values) with [80%,90%) of its scope covered":0
|
||||
; CHECK: "params (excluding the debug entry values) with [90%,100%) of its scope covered":0
|
||||
; CHECK: "params (excluding the debug entry values) with 100% of its scope covered":1
|
||||
; CHECK: "total vars procesed by location statistics":4
|
||||
; CHECK: "vars with 0% of its scope covered":1
|
||||
; CHECK: "vars with 1-9% of its scope covered":0
|
||||
; CHECK: "vars with 10-19% of its scope covered":0
|
||||
; CHECK: "vars with 20-29% of its scope covered":0
|
||||
; CHECK: "vars with 30-39% of its scope covered":0
|
||||
; CHECK: "vars with 40-49% of its scope covered":0
|
||||
; CHECK: "vars with 50-59% of its scope covered":1
|
||||
; CHECK: "vars with 60-69% of its scope covered":0
|
||||
; CHECK: "vars with 70-79% of its scope covered":0
|
||||
; CHECK: "vars with 80-89% of its scope covered":1
|
||||
; CHECK: "vars with 90-99% of its scope covered":0
|
||||
; CHECK: "vars with [1%,10%) of its scope covered":0
|
||||
; CHECK: "vars with [10%,20%) of its scope covered":0
|
||||
; CHECK: "vars with [20%,30%) of its scope covered":0
|
||||
; CHECK: "vars with [30%,40%) of its scope covered":0
|
||||
; CHECK: "vars with [40%,50%) of its scope covered":0
|
||||
; CHECK: "vars with [50%,60%) of its scope covered":1
|
||||
; CHECK: "vars with [60%,70%) of its scope covered":0
|
||||
; CHECK: "vars with [70%,80%) of its scope covered":0
|
||||
; CHECK: "vars with [80%,90%) of its scope covered":1
|
||||
; CHECK: "vars with [90%,100%) of its scope covered":0
|
||||
; CHECK: "vars with 100% of its scope covered":1
|
||||
; CHECK: "vars (excluding the debug entry values) with 0% of its scope covered":1
|
||||
; CHECK: "vars (excluding the debug entry values) with 1-9% of its scope covered":0
|
||||
; CHECK: "vars (excluding the debug entry values) with 10-19% of its scope covered":0
|
||||
; CHECK: "vars (excluding the debug entry values) with 20-29% of its scope covered":0
|
||||
; CHECK: "vars (excluding the debug entry values) with 30-39% of its scope covered":0
|
||||
; CHECK: "vars (excluding the debug entry values) with 40-49% of its scope covered":0
|
||||
; CHECK: "vars (excluding the debug entry values) with 50-59% of its scope covered":1
|
||||
; CHECK: "vars (excluding the debug entry values) with 60-69% of its scope covered":0
|
||||
; CHECK: "vars (excluding the debug entry values) with 70-79% of its scope covered":0
|
||||
; CHECK: "vars (excluding the debug entry values) with 80-89% of its scope covered":1
|
||||
; CHECK: "vars (excluding the debug entry values) with 90-99% of its scope covered":0
|
||||
; CHECK: "vars (excluding the debug entry values) with [1%,10%) of its scope covered":0
|
||||
; CHECK: "vars (excluding the debug entry values) with [10%,20%) of its scope covered":0
|
||||
; CHECK: "vars (excluding the debug entry values) with [20%,30%) of its scope covered":0
|
||||
; CHECK: "vars (excluding the debug entry values) with [30%,40%) of its scope covered":0
|
||||
; CHECK: "vars (excluding the debug entry values) with [40%,50%) of its scope covered":0
|
||||
; CHECK: "vars (excluding the debug entry values) with [50%,60%) of its scope covered":1
|
||||
; CHECK: "vars (excluding the debug entry values) with [60%,70%) of its scope covered":0
|
||||
; CHECK: "vars (excluding the debug entry values) with [70%,80%) of its scope covered":0
|
||||
; CHECK: "vars (excluding the debug entry values) with [80%,90%) of its scope covered":1
|
||||
; CHECK: "vars (excluding the debug entry values) with [90%,100%) of its scope covered":0
|
||||
; CHECK: "vars (excluding the debug entry values) with 100% of its scope covered":1
|
||||
;
|
||||
; The source code of the test case:
|
||||
|
@ -5,16 +5,16 @@
|
||||
;
|
||||
; Test the llvm-locstats output.
|
||||
; LOCSTATS: 0% 0 0%
|
||||
; LOCSTATS: 1-9% 0 0%
|
||||
; LOCSTATS: 10-19% 0 0%
|
||||
; LOCSTATS: 20-29% 1 11%
|
||||
; LOCSTATS: 30-39% 0 0%
|
||||
; LOCSTATS: 40-49% 1 11%
|
||||
; LOCSTATS: 50-59% 1 11%
|
||||
; LOCSTATS: 60-69% 0 0%
|
||||
; LOCSTATS: 70-79% 0 0%
|
||||
; LOCSTATS: 80-89% 3 33%
|
||||
; LOCSTATS: 90-99% 1 11%
|
||||
; LOCSTATS: [1%,10%) 0 0%
|
||||
; LOCSTATS: [10%,20%) 0 0%
|
||||
; LOCSTATS: [20%,30%) 1 11%
|
||||
; LOCSTATS: [30%,40%) 0 0%
|
||||
; LOCSTATS: [40%,50%) 1 11%
|
||||
; LOCSTATS: [50%,60%) 1 11%
|
||||
; LOCSTATS: [60%,70%) 0 0%
|
||||
; LOCSTATS: [70%,80%) 0 0%
|
||||
; LOCSTATS: [80%,90%) 3 33%
|
||||
; LOCSTATS: [90%,100%) 1 11%
|
||||
; LOCSTATS: 100% 2 22%
|
||||
;
|
||||
; The source code of the test case:
|
||||
|
@ -430,16 +430,16 @@ static void printLocationStats(raw_ostream &OS,
|
||||
<< LocationStats[0];
|
||||
LLVM_DEBUG(llvm::dbgs() << Key << " with 0% of its scope covered: "
|
||||
<< LocationStats[0] << '\n');
|
||||
OS << ",\"" << Key << " with 1-9% of its scope covered\":"
|
||||
OS << ",\"" << Key << " with [1%,10%) of its scope covered\":"
|
||||
<< LocationStats[1];
|
||||
LLVM_DEBUG(llvm::dbgs() << Key << " with 1-9% of its scope covered: "
|
||||
LLVM_DEBUG(llvm::dbgs() << Key << " with [1%,10%) of its scope covered: "
|
||||
<< LocationStats[1] << '\n');
|
||||
for (unsigned i = 2; i < NumOfCoverageCategories - 1; ++i) {
|
||||
OS << ",\"" << Key << " with " << (i - 1) * 10 << "-" << i * 10 - 1
|
||||
<< "% of its scope covered\":" << LocationStats[i];
|
||||
OS << ",\"" << Key << " with [" << (i - 1) * 10 << "%," << i * 10
|
||||
<< "%) of its scope covered\":" << LocationStats[i];
|
||||
LLVM_DEBUG(llvm::dbgs()
|
||||
<< Key << " with " << (i - 1) * 10 << "-" << i * 10 - 1
|
||||
<< "% of its scope covered: " << LocationStats[i]);
|
||||
<< Key << " with [" << (i - 1) * 10 << "%," << i * 10
|
||||
<< "%) of its scope covered: " << LocationStats[i]);
|
||||
}
|
||||
OS << ",\"" << Key << " with 100% of its scope covered\":"
|
||||
<< LocationStats[NumOfCoverageCategories - 1];
|
||||
|
@ -15,9 +15,9 @@ from subprocess import Popen, PIPE
|
||||
|
||||
def coverage_buckets():
|
||||
yield '0%'
|
||||
yield '1-9%'
|
||||
yield '[1%,10%)'
|
||||
for start in range(10, 91, 10):
|
||||
yield '{0}-{1}%'.format(start, start + 9)
|
||||
yield '[{0}%,{1}%)'.format(start, start + 10)
|
||||
yield '100%'
|
||||
|
||||
def locstats_output(
|
||||
@ -44,10 +44,10 @@ def locstats_output(
|
||||
print (' =================================================')
|
||||
print (' Debug Location Statistics ')
|
||||
print (' =================================================')
|
||||
print (' cov% samples percentage(~) ')
|
||||
print (' cov% samples percentage(~) ')
|
||||
print (' -------------------------------------------------')
|
||||
for cov_bucket in coverage_buckets():
|
||||
print (' {0:6} {1:8d} {2:3d}%'. \
|
||||
print (' {0:10} {1:8d} {2:3d}%'. \
|
||||
format(cov_bucket, variables_coverage_map[cov_bucket], \
|
||||
variables_coverage_per_map[cov_bucket]))
|
||||
print (' =================================================')
|
||||
|
Loading…
Reference in New Issue
Block a user