-
Notifications
You must be signed in to change notification settings - Fork 1.3k
pkg/cover: source coverage reports are overly optimistic #5929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Example interface coverage info is in #5925, e.g. for these netlink commands:
|
What we have requires name. It is not a source coverage and is not a line coverage. It is a coverage of the lines where we have instrumentation points. We have the line:pos of the basic block. Thinking about the line with 3 blocks and hitcount 5, 0, 0... I can't easily show the end of the block. But it is probably another topic. The game changer here will be the clang source code coverage with mc/dc like this. |
"5/0/0" would work for me, that would mean 33% coverage. I don't care about HTML representation at this point. |
I see that lots of kernel interfaces have suspiciously high coverage based on source coverage reports. Lots of them have 100% coverage while we usually don't cover all error paths.
Looking at a concrete function

nl80211_set_mcast_rate
.In the current source coverage report, it has 100% coverage:
There are 10 instrumented lines in total, none of them are related to error paths.
The old coverage reports show more realistic picture:

This says the coverage is ~55% (5 out of 9 blocks).
We cannot properly merge and preserve coverage points that point to the same source line across different kernel builds. But we can make sense of them within a single build, and perhaps somehow merge better than we are now.
For example, consider:
When we currently merge we conclude that resulting coverage is 100%, while that can't possibly be true.
Real coverage is at most 66^%, but likely is 33% as well.
cc @tarasmadan
The text was updated successfully, but these errors were encountered: