Skip to content

Commit 1cc4b60

Browse files
committed
[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
1 parent 25305a9 commit 1cc4b60

File tree

5 files changed

+92
-92
lines changed

5 files changed

+92
-92
lines changed

llvm/docs/CommandGuide/llvm-locstats.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ pretty printing it in a more human readable way.
1818
The line 0% shows the number and the percentage of DIEs with no location
1919
information, but the line 100% shows the information for DIEs where there is
2020
location information in all code section bytes (where the variable or parameter
21-
is in the scope). The line 50-59% shows the number and the percentage of DIEs
22-
where the location information is between 50 and 59 percentage of its scope
21+
is in the scope). The line [50%,60%) shows the number and the percentage of DIEs
22+
where the location information is between 50 and 60 percentage of its scope
2323
covered.
2424

2525
OPTIONS
@@ -55,16 +55,16 @@ OUTPUT EXAMPLE
5555
cov% samples percentage(~)
5656
-------------------------------------------------
5757
0% 1 16%
58-
1-9% 0 0%
59-
10-19% 0 0%
60-
20-29% 0 0%
61-
30-39% 0 0%
62-
40-49% 0 0%
63-
50-59% 1 16%
64-
60-69% 0 0%
65-
70-79% 0 0%
66-
80-89% 1 16%
67-
90-99% 0 0%
58+
[1%,10%) 0 0%
59+
[10%,20%) 0 0%
60+
[20%,30%) 0 0%
61+
[30%,40%) 0 0%
62+
[40%,50%) 0 0%
63+
[50%,60%) 1 16%
64+
[60%,70%) 0 0%
65+
[70%,80%) 0 0%
66+
[80%,90%) 1 16%
67+
[90%,100%) 0 0%
6868
100% 3 50%
6969
=================================================
7070
-the number of debug variables processed: 6

llvm/test/tools/llvm-dwarfdump/X86/locstats.ll

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -10,78 +10,78 @@
1010
; CHECK: "vars entry value scope bytes covered":0
1111
; CHECK: "total variables procesed by location statistics":6
1212
; CHECK: "variables with 0% of its scope covered":1
13-
; CHECK: "variables with 1-9% of its scope covered":0
14-
; CHECK: "variables with 10-19% of its scope covered":0
15-
; CHECK: "variables with 20-29% of its scope covered":0
16-
; CHECK: "variables with 30-39% of its scope covered":0
17-
; CHECK: "variables with 40-49% of its scope covered":0
18-
; CHECK: "variables with 50-59% of its scope covered":1
19-
; CHECK: "variables with 60-69% of its scope covered":0
20-
; CHECK: "variables with 70-79% of its scope covered":0
21-
; CHECK: "variables with 80-89% of its scope covered":1
22-
; CHECK: "variables with 90-99% of its scope covered":0
13+
; CHECK: "variables with [1%,10%) of its scope covered":0
14+
; CHECK: "variables with [10%,20%) of its scope covered":0
15+
; CHECK: "variables with [20%,30%) of its scope covered":0
16+
; CHECK: "variables with [30%,40%) of its scope covered":0
17+
; CHECK: "variables with [40%,50%) of its scope covered":0
18+
; CHECK: "variables with [50%,60%) of its scope covered":1
19+
; CHECK: "variables with [60%,70%) of its scope covered":0
20+
; CHECK: "variables with [70%,80%) of its scope covered":0
21+
; CHECK: "variables with [80%,90%) of its scope covered":1
22+
; CHECK: "variables with [90%,100%) of its scope covered":0
2323
; CHECK: "variables with 100% of its scope covered":3
2424
; CHECK: "variables (excluding the debug entry values) with 0% of its scope covered":1
25-
; CHECK: "variables (excluding the debug entry values) with 1-9% of its scope covered":0
26-
; CHECK: "variables (excluding the debug entry values) with 10-19% of its scope covered":0
27-
; CHECK: "variables (excluding the debug entry values) with 20-29% of its scope covered":0
28-
; CHECK: "variables (excluding the debug entry values) with 30-39% of its scope covered":0
29-
; CHECK: "variables (excluding the debug entry values) with 40-49% of its scope covered":0
30-
; CHECK: "variables (excluding the debug entry values) with 50-59% of its scope covered":2
31-
; CHECK: "variables (excluding the debug entry values) with 60-69% of its scope covered":0
32-
; CHECK: "variables (excluding the debug entry values) with 70-79% of its scope covered":0
33-
; CHECK: "variables (excluding the debug entry values) with 80-89% of its scope covered":1
34-
; CHECK: "variables (excluding the debug entry values) with 90-99% of its scope covered":0
25+
; CHECK: "variables (excluding the debug entry values) with [1%,10%) of its scope covered":0
26+
; CHECK: "variables (excluding the debug entry values) with [10%,20%) of its scope covered":0
27+
; CHECK: "variables (excluding the debug entry values) with [20%,30%) of its scope covered":0
28+
; CHECK: "variables (excluding the debug entry values) with [30%,40%) of its scope covered":0
29+
; CHECK: "variables (excluding the debug entry values) with [40%,50%) of its scope covered":0
30+
; CHECK: "variables (excluding the debug entry values) with [50%,60%) of its scope covered":2
31+
; CHECK: "variables (excluding the debug entry values) with [60%,70%) of its scope covered":0
32+
; CHECK: "variables (excluding the debug entry values) with [70%,80%) of its scope covered":0
33+
; CHECK: "variables (excluding the debug entry values) with [80%,90%) of its scope covered":1
34+
; CHECK: "variables (excluding the debug entry values) with [90%,100%) of its scope covered":0
3535
; CHECK: "variables (excluding the debug entry values) with 100% of its scope covered":2
3636
; CHECK: "total params procesed by location statistics":2
3737
; CHECK: "params with 0% of its scope covered":0
38-
; CHECK: "params with 1-9% of its scope covered":0
39-
; CHECK: "params with 10-19% of its scope covered":0
40-
; CHECK: "params with 20-29% of its scope covered":0
41-
; CHECK: "params with 30-39% of its scope covered":0
42-
; CHECK: "params with 40-49% of its scope covered":0
43-
; CHECK: "params with 50-59% of its scope covered":0
44-
; CHECK: "params with 60-69% of its scope covered":0
45-
; CHECK: "params with 70-79% of its scope covered":0
46-
; CHECK: "params with 80-89% of its scope covered":0
47-
; CHECK: "params with 90-99% of its scope covered":0
38+
; CHECK: "params with [1%,10%) of its scope covered":0
39+
; CHECK: "params with [10%,20%) of its scope covered":0
40+
; CHECK: "params with [20%,30%) of its scope covered":0
41+
; CHECK: "params with [30%,40%) of its scope covered":0
42+
; CHECK: "params with [40%,50%) of its scope covered":0
43+
; CHECK: "params with [50%,60%) of its scope covered":0
44+
; CHECK: "params with [60%,70%) of its scope covered":0
45+
; CHECK: "params with [70%,80%) of its scope covered":0
46+
; CHECK: "params with [80%,90%) of its scope covered":0
47+
; CHECK: "params with [90%,100%) of its scope covered":0
4848
; CHECK: "params with 100% of its scope covered":2
4949
; CHECK: "params (excluding the debug entry values) with 0% of its scope covered":0
50-
; CHECK: "params (excluding the debug entry values) with 1-9% of its scope covered":0
51-
; CHECK: "params (excluding the debug entry values) with 10-19% of its scope covered":0
52-
; CHECK: "params (excluding the debug entry values) with 20-29% of its scope covered":0
53-
; CHECK: "params (excluding the debug entry values) with 30-39% of its scope covered":0
54-
; CHECK: "params (excluding the debug entry values) with 40-49% of its scope covered":0
55-
; CHECK: "params (excluding the debug entry values) with 50-59% of its scope covered":1
56-
; CHECK: "params (excluding the debug entry values) with 60-69% of its scope covered":0
57-
; CHECK: "params (excluding the debug entry values) with 70-79% of its scope covered":0
58-
; CHECK: "params (excluding the debug entry values) with 80-89% of its scope covered":0
59-
; CHECK: "params (excluding the debug entry values) with 90-99% of its scope covered":0
50+
; CHECK: "params (excluding the debug entry values) with [1%,10%) of its scope covered":0
51+
; CHECK: "params (excluding the debug entry values) with [10%,20%) of its scope covered":0
52+
; CHECK: "params (excluding the debug entry values) with [20%,30%) of its scope covered":0
53+
; CHECK: "params (excluding the debug entry values) with [30%,40%) of its scope covered":0
54+
; CHECK: "params (excluding the debug entry values) with [40%,50%) of its scope covered":0
55+
; CHECK: "params (excluding the debug entry values) with [50%,60%) of its scope covered":1
56+
; CHECK: "params (excluding the debug entry values) with [60%,70%) of its scope covered":0
57+
; CHECK: "params (excluding the debug entry values) with [70%,80%) of its scope covered":0
58+
; CHECK: "params (excluding the debug entry values) with [80%,90%) of its scope covered":0
59+
; CHECK: "params (excluding the debug entry values) with [90%,100%) of its scope covered":0
6060
; CHECK: "params (excluding the debug entry values) with 100% of its scope covered":1
6161
; CHECK: "total vars procesed by location statistics":4
6262
; CHECK: "vars with 0% of its scope covered":1
63-
; CHECK: "vars with 1-9% of its scope covered":0
64-
; CHECK: "vars with 10-19% of its scope covered":0
65-
; CHECK: "vars with 20-29% of its scope covered":0
66-
; CHECK: "vars with 30-39% of its scope covered":0
67-
; CHECK: "vars with 40-49% of its scope covered":0
68-
; CHECK: "vars with 50-59% of its scope covered":1
69-
; CHECK: "vars with 60-69% of its scope covered":0
70-
; CHECK: "vars with 70-79% of its scope covered":0
71-
; CHECK: "vars with 80-89% of its scope covered":1
72-
; CHECK: "vars with 90-99% of its scope covered":0
63+
; CHECK: "vars with [1%,10%) of its scope covered":0
64+
; CHECK: "vars with [10%,20%) of its scope covered":0
65+
; CHECK: "vars with [20%,30%) of its scope covered":0
66+
; CHECK: "vars with [30%,40%) of its scope covered":0
67+
; CHECK: "vars with [40%,50%) of its scope covered":0
68+
; CHECK: "vars with [50%,60%) of its scope covered":1
69+
; CHECK: "vars with [60%,70%) of its scope covered":0
70+
; CHECK: "vars with [70%,80%) of its scope covered":0
71+
; CHECK: "vars with [80%,90%) of its scope covered":1
72+
; CHECK: "vars with [90%,100%) of its scope covered":0
7373
; CHECK: "vars with 100% of its scope covered":1
7474
; CHECK: "vars (excluding the debug entry values) with 0% of its scope covered":1
75-
; CHECK: "vars (excluding the debug entry values) with 1-9% of its scope covered":0
76-
; CHECK: "vars (excluding the debug entry values) with 10-19% of its scope covered":0
77-
; CHECK: "vars (excluding the debug entry values) with 20-29% of its scope covered":0
78-
; CHECK: "vars (excluding the debug entry values) with 30-39% of its scope covered":0
79-
; CHECK: "vars (excluding the debug entry values) with 40-49% of its scope covered":0
80-
; CHECK: "vars (excluding the debug entry values) with 50-59% of its scope covered":1
81-
; CHECK: "vars (excluding the debug entry values) with 60-69% of its scope covered":0
82-
; CHECK: "vars (excluding the debug entry values) with 70-79% of its scope covered":0
83-
; CHECK: "vars (excluding the debug entry values) with 80-89% of its scope covered":1
84-
; CHECK: "vars (excluding the debug entry values) with 90-99% of its scope covered":0
75+
; CHECK: "vars (excluding the debug entry values) with [1%,10%) of its scope covered":0
76+
; CHECK: "vars (excluding the debug entry values) with [10%,20%) of its scope covered":0
77+
; CHECK: "vars (excluding the debug entry values) with [20%,30%) of its scope covered":0
78+
; CHECK: "vars (excluding the debug entry values) with [30%,40%) of its scope covered":0
79+
; CHECK: "vars (excluding the debug entry values) with [40%,50%) of its scope covered":0
80+
; CHECK: "vars (excluding the debug entry values) with [50%,60%) of its scope covered":1
81+
; CHECK: "vars (excluding the debug entry values) with [60%,70%) of its scope covered":0
82+
; CHECK: "vars (excluding the debug entry values) with [70%,80%) of its scope covered":0
83+
; CHECK: "vars (excluding the debug entry values) with [80%,90%) of its scope covered":1
84+
; CHECK: "vars (excluding the debug entry values) with [90%,100%) of its scope covered":0
8585
; CHECK: "vars (excluding the debug entry values) with 100% of its scope covered":1
8686
;
8787
; The source code of the test case:

llvm/test/tools/llvm-locstats/locstats.ll

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
;
66
; Test the llvm-locstats output.
77
; LOCSTATS: 0% 0 0%
8-
; LOCSTATS: 1-9% 0 0%
9-
; LOCSTATS: 10-19% 0 0%
10-
; LOCSTATS: 20-29% 1 11%
11-
; LOCSTATS: 30-39% 0 0%
12-
; LOCSTATS: 40-49% 1 11%
13-
; LOCSTATS: 50-59% 1 11%
14-
; LOCSTATS: 60-69% 0 0%
15-
; LOCSTATS: 70-79% 0 0%
16-
; LOCSTATS: 80-89% 3 33%
17-
; LOCSTATS: 90-99% 1 11%
8+
; LOCSTATS: [1%,10%) 0 0%
9+
; LOCSTATS: [10%,20%) 0 0%
10+
; LOCSTATS: [20%,30%) 1 11%
11+
; LOCSTATS: [30%,40%) 0 0%
12+
; LOCSTATS: [40%,50%) 1 11%
13+
; LOCSTATS: [50%,60%) 1 11%
14+
; LOCSTATS: [60%,70%) 0 0%
15+
; LOCSTATS: [70%,80%) 0 0%
16+
; LOCSTATS: [80%,90%) 3 33%
17+
; LOCSTATS: [90%,100%) 1 11%
1818
; LOCSTATS: 100% 2 22%
1919
;
2020
; The source code of the test case:

llvm/tools/llvm-dwarfdump/Statistics.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -430,16 +430,16 @@ static void printLocationStats(raw_ostream &OS,
430430
<< LocationStats[0];
431431
LLVM_DEBUG(llvm::dbgs() << Key << " with 0% of its scope covered: "
432432
<< LocationStats[0] << '\n');
433-
OS << ",\"" << Key << " with 1-9% of its scope covered\":"
433+
OS << ",\"" << Key << " with [1%,10%) of its scope covered\":"
434434
<< LocationStats[1];
435-
LLVM_DEBUG(llvm::dbgs() << Key << " with 1-9% of its scope covered: "
435+
LLVM_DEBUG(llvm::dbgs() << Key << " with [1%,10%) of its scope covered: "
436436
<< LocationStats[1] << '\n');
437437
for (unsigned i = 2; i < NumOfCoverageCategories - 1; ++i) {
438-
OS << ",\"" << Key << " with " << (i - 1) * 10 << "-" << i * 10 - 1
439-
<< "% of its scope covered\":" << LocationStats[i];
438+
OS << ",\"" << Key << " with [" << (i - 1) * 10 << "%," << i * 10
439+
<< "%) of its scope covered\":" << LocationStats[i];
440440
LLVM_DEBUG(llvm::dbgs()
441-
<< Key << " with " << (i - 1) * 10 << "-" << i * 10 - 1
442-
<< "% of its scope covered: " << LocationStats[i]);
441+
<< Key << " with [" << (i - 1) * 10 << "%," << i * 10
442+
<< "%) of its scope covered: " << LocationStats[i]);
443443
}
444444
OS << ",\"" << Key << " with 100% of its scope covered\":"
445445
<< LocationStats[NumOfCoverageCategories - 1];

llvm/utils/llvm-locstats/llvm-locstats.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515

1616
def coverage_buckets():
1717
yield '0%'
18-
yield '1-9%'
18+
yield '[1%,10%)'
1919
for start in range(10, 91, 10):
20-
yield '{0}-{1}%'.format(start, start + 9)
20+
yield '[{0}%,{1}%)'.format(start, start + 10)
2121
yield '100%'
2222

2323
def locstats_output(
@@ -44,10 +44,10 @@ def locstats_output(
4444
print (' =================================================')
4545
print (' Debug Location Statistics ')
4646
print (' =================================================')
47-
print (' cov% samples percentage(~) ')
47+
print (' cov% samples percentage(~) ')
4848
print (' -------------------------------------------------')
4949
for cov_bucket in coverage_buckets():
50-
print (' {0:6} {1:8d} {2:3d}%'. \
50+
print (' {0:10} {1:8d} {2:3d}%'. \
5151
format(cov_bucket, variables_coverage_map[cov_bucket], \
5252
variables_coverage_per_map[cov_bucket]))
5353
print (' =================================================')

0 commit comments

Comments
 (0)