diff --git a/llvm/docs/CommandGuide/llvm-locstats.rst b/llvm/docs/CommandGuide/llvm-locstats.rst --- a/llvm/docs/CommandGuide/llvm-locstats.rst +++ b/llvm/docs/CommandGuide/llvm-locstats.rst @@ -18,8 +18,8 @@ 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 @@ 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 diff --git a/llvm/test/tools/llvm-dwarfdump/X86/locstats.ll b/llvm/test/tools/llvm-dwarfdump/X86/locstats.ll --- a/llvm/test/tools/llvm-dwarfdump/X86/locstats.ll +++ b/llvm/test/tools/llvm-dwarfdump/X86/locstats.ll @@ -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: diff --git a/llvm/test/tools/llvm-locstats/locstats.ll b/llvm/test/tools/llvm-locstats/locstats.ll --- a/llvm/test/tools/llvm-locstats/locstats.ll +++ b/llvm/test/tools/llvm-locstats/locstats.ll @@ -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% 1 11% -; LOCSTATS: 70-79% 0 0% -; LOCSTATS: 80-89% 2 22% -; 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%) 1 11% +; LOCSTATS: [70%,80%) 0 0% +; LOCSTATS: [80%,90%) 2 22% +; LOCSTATS: [90%,100%) 1 11% ; LOCSTATS: 100% 2 22% ; ; The source code of the test case: diff --git a/llvm/tools/llvm-dwarfdump/Statistics.cpp b/llvm/tools/llvm-dwarfdump/Statistics.cpp --- a/llvm/tools/llvm-dwarfdump/Statistics.cpp +++ b/llvm/tools/llvm-dwarfdump/Statistics.cpp @@ -430,16 +430,16 @@ << 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 (0%,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]; diff --git a/llvm/utils/llvm-locstats/llvm-locstats.py b/llvm/utils/llvm-locstats/llvm-locstats.py --- a/llvm/utils/llvm-locstats/llvm-locstats.py +++ b/llvm/utils/llvm-locstats/llvm-locstats.py @@ -15,9 +15,9 @@ 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( @@ -40,10 +40,10 @@ 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 (' =================================================')