-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add option for codecov and allocation tracking to be restricted by path #44359
Add option for codecov and allocation tracking to be restricted by path #44359
Conversation
29c74fb
to
a5431b0
Compare
a5431b0
to
642a644
Compare
The new coverage tests are failing due to a slight difference in a few line counts (the expected report is on top)
I'm not sure what would cause a subtle difference like this. I've added a new reference for the output with a TODO, in case the reason isn't apparent. |
9834808
to
9af8f7e
Compare
Perhaps if approved, this could go in to 1.8 as strictly opt-in. i.e. If it works well in the wild, it could become default in 1.9? |
Co-authored-by: Jameson Nash <vtjnash@gmail.com>
Co-authored-by: Jameson Nash <vtjnash@gmail.com>
src/jloptions.c
Outdated
@@ -154,11 +155,18 @@ static const char opts[] = | |||
// instrumentation options | |||
" --code-coverage[={none*|user|all}]\n" | |||
" Count executions of source lines (omitting setting is equivalent to `user`)\n" | |||
" --code-coverage=@/abs/path\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think any other file input requires an absolute path, couldn't the path be absolutified instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! I was unaware how the paths were absolutified.
The nice thing now is that a simple --code-coverage=@
will track the current directory
Replaces #43711 (triage suggested this approach as cleaner, which I agree with)
Closes #41626
Closes #36142
Enabling code coverage and allocation tracking often blows up test suite duration.
The narrowest option currently is
user
which is all non-core code, including stdlibs, and given that code coverage tools usually only look for coverage in the checked out directory, the vast majority of effort is usually needless.This PR introduces a
--code-coverage=@/path/to/package
and the same for--track-allocation
option to declare tracking of anything falling in or under the given path. i.e. can be a specific file or a directory.Testing use of LoopVectorization, which seems particularly effected.
Quoting @chriselrod here
Taking a simple LoopVectorization example:
The effects are stronger for
--track-allocation
for code that heavily allocates.I'm disappointed I didn't get this done before the 1.8 freeze, as this issue prevents us running code coverage on some long-running production test suites.
cc. @efaulhaber @carstenbauer