RFR: Instrumentation plugin concept

Alexandre Iline shurailine at openjdk.java.net
Wed Mar 10 20:01:20 UTC 2021


On Tue, 23 Feb 2021 03:04:43 GMT, Leonid Kuskov <lkuskov at openjdk.org> wrote:

> There are comments inlined in code review.
> Also it would be good to have a working plugin (not just a unit test) that could be used for gathering certain info.

I will be addressing the comments, thank you for catching that.

I would also really appreciate if you can comment on a few questions I have mentioned in the description of this change:
 * what is the right way to pass the saver? Currently it is done through JCov properties.
 * how to unit test the exit hook? See com.sun.tdk.jcov.runtime.Collect.init(), where there is a hack right now.
 * how to test instrumentation from the same VM? See com.sun.tdk.jcov.lib.InstrProxy.instr(String[] , String...)

> src/classes/com/sun/tdk/jcov/instrument/InstrumentationParams.java line 111:
> 
>> 109:     }
>> 110:     public InstrumentationParams(boolean innerInvocations, boolean classesReload, boolean dynamicCollect, boolean instrumentNative, boolean instrumentFields, boolean detectInternal, ABSTRACTMODE instrumentAbstract, String[] includes, String[] excludes, String[] callerIncludes, String[] callerExcludes, String[] m_includes, String[] m_excludes, InstrumentationMode mode, String[] saveBegin, String[] saveEnd, InstrumentationPlugin plugin) {
>> 111: 
> 
> It would be good to follow Java Code Conventions: Avoid lines longer than 80 chars.

I would be happy to reformat my new added constructor and all the previously existing constructors. Will do.

However, the right thing to do would be to rework this class to use builder pattern. I have just created https://bugs.openjdk.java.net/browse/CODETOOLS-7902832 to that extent.

-------------

PR: https://git.openjdk.java.net/jcov/pull/9


More information about the jcov-dev mailing list