RFR 8221857: Collect code coverage for a subset of code

Alexandre (Shura) Iline alexandre.iline at oracle.com
Wed Apr 10 21:25:54 UTC 2019


Erik,

JCOV_FILTERS variable is also used while building an instrumented image - with "jcov-image” make target. To completely prevent make form complaining, it looks like the variable would need to be added it to MAKE_CONTROL_VARIABLES in make/InitSupport.gmk. Which we could do, but, judging by the look of it, only “very important” variables are listed as controlled.

At the same time, I predict that most of the use cases would be covered with just using the configuration option. In less common cases when direct usage of JCOV_FILTERS is used, user can survive with make complaining about it not been controlled.

So I suggest to push the change as is. Let me know if you are OK with that. We can reconsider later, if there would be a need for it.

Thank you.

Shura

> On Apr 9, 2019, at 6:31 AM, Erik Joelsson <erik.joelsson at oracle.com> wrote:
> 
> Hello Shura,
> 
> If JCOV_FILTERS is ever expected to be set on the make command line (typically when running make run-test-prebuilt), then it would be good if we could add a way to set it through TEST_OPTS=JCOV_FILTERS=... . Using the officially supported input variables like this avoids the warning about unsupported variables you otherwise get from our makefiles.
> 
> To do that, you simply add JCOV_FILTERS to the ParseKeywordVariable call for TEST_OPTS further up in RunTests.gmk. Then you will receive the variable as TEST_OPTS_JCOV_FILTERS.
> 
> Otherwise this looks good.
> 
> /Erik
> 
> On 2019-04-08 14:12, Alexandre (Shura) Iline wrote:
>> Hi,
>> 
>> Could you please take a look on this enhancement which makes it easy to get code coverage for a part of JDK code.
>> 
>> This change introduces “JCOV_FILTERS” make variable and also "--with-jcov-filters” configuration option.
>> 
>> With that one is free to use any of JCov filtering options to limit the resulting report to only the desired code.
>> 
>> This is an excerpt from JCov usage output:
>>       Filtering conditions.
>>         -include(i) 'string value' (Option could be specified several times.)
>>         -exclude(e) 'string value' (Option could be specified several times.)
>>         -include_list 'string value'
>>         -exclude_list 'string value'
>>         -include_module_list 'string value'
>>         -exclude_module_list 'string value'
>>     Filtering conditions.
>>         -include_module(im) 'string value' (Option could be specified several times.)
>>         -exclude_module(em) 'string value' (Option could be specified several times.)
>>         -fm 'string value' (Option could be specified several times.)
>>         -fm_list 'string value'
>> 
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8221857
>> Webrev: http://cr.openjdk.java.net/~shurailine/JDK-8221857/webrev.00/
>> 
>> Thank you.
>> 
>> Shura
>> 




More information about the build-dev mailing list