Currently, variables with debug info coverage between 0% and 1% are put into
zero-bucket. D70548 changed the way statistics calculate a variable's coverage:
we began to use enclosing scope rather than a possible variable life range.
Thus more variables might be moved to zero-bucket despite they have some debug
info coverage.
The patch is to distinguish between a variable that has location info but
it's significantly less than its enclosing scope and a variable that doesn't
have it at all.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 42383 Build 42852: arc lint + arc unit
Event Timeline
LGTM as well, thanks!
Please update the llvm/docs/CommandGuide/llvm-locstats.rst with the newest output.
@djtodoro , yeah, it doesn't look good.
I also considered an option to rename the first bucket to smth like "No location info" or "Not covered" or something similar then the second can be safely named '0-9%'.
Or simply to use '0-9%' together with '0%' which might be a bit unclear, but as docs say 'The line 0% shows the number and the percentage of DIEs with no location information', it should not be confusing.
does this bucket include 9%? I guess the next bucket starts at 10%, so 0-9 includes 9.99%? so technically this one is (0, 10)% and the next one is [10, 91)% etc... (or I guess you could put the % inside the braces/parens)? but that might be insufficiently obvious to read?
I am also thinking about combination of the [/] and (/). That will clarify things here.
@dblaikie , @djtodoro sorry for paying so much attention to details here, but does this one work with you?
cov% samples percentage(~) ------------------------------------------------- 0% 1 16% ( 0, 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%
And just mention here how the previously suggested option looks like:
cov% samples percentage(~) ------------------------------------------------- No location info 1 16% 0-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% 100% 3 50%
@krisb Thanks for this again. First option seems better to me.
(Just please make sure, when we decide the final look, the docs gets updated accordingly.)
either looks OK to me - between those two, yeah, the ()[)/etc (the first) version is probably better. But I'll leave it to other folks more invested in statistics to make the final call.
@djtodoro , @dblaikie thanks for your opinions! I created a separate review for this change https://reviews.llvm.org/D71366. Please, take a look if you have a chance.
I'm seeing test failures on trunk after this commit:
FAIL: LLVM :: tools/llvm-locstats/locstats.ll (33082 of 34788) ******************** TEST 'LLVM :: tools/llvm-locstats/locstats.ll' FAILED ******************** Script: -- : 'RUN: at line 3'; /Users/spatel/GitHub/llvm-project/release/bin/llc /Users/spatel/GitHub/llvm-project/llvm/test/tools/llvm-locstats/locstats.ll -o /Users/spatel/GitHub/llvm-project/release/test/tools/llvm-locstats/Output/locstats.ll.tmp0.o -filetype=obj : 'RUN: at line 4'; '/usr/bin/python' /Users/spatel/GitHub/llvm-project/release/./bin/llvm-locstats /Users/spatel/GitHub/llvm-project/release/test/tools/llvm-locstats/Output/locstats.ll.tmp0.o | /Users/spatel/GitHub/llvm-project/release/bin/FileCheck /Users/spatel/GitHub/llvm-project/llvm/test/tools/llvm-locstats/locstats.ll --check-prefix=LOCSTATS -- Exit Code: 2 Command Output (stderr): -- Traceback (most recent call last): File "/Users/spatel/GitHub/llvm-project/release/./bin/llvm-locstats", line 212, in <module> Main() File "/Users/spatel/GitHub/llvm-project/release/./bin/llvm-locstats", line 190, in Main variables_coverage_map[cov_bucket] = json_parsed[cov_category] KeyError: 'variables with [1%,10%) of its scope covered' FileCheck error: '-' is empty. FileCheck command line: /Users/spatel/GitHub/llvm-project/release/bin/FileCheck /Users/spatel/GitHub/llvm-project/llvm/test/tools/llvm-locstats/locstats.ll --check-prefix=LOCSTATS
@spatel thanks for reporting this!
Could you, please, check that llvm-locstat wasn't cached in the build/install directory? llvm-locstat should look for a variables with (0%,10%) of its scope covered as was changed by the patch, so I guess it didn't get updated for some reason.
That might've been it. I just rebuilt everything, and no more fails. Sorry for the noise.