RFR: 6946: There should be an option to build the agent in the build script [v8]

Marcus Hirt hirt at openjdk.java.net
Fri Jan 8 16:23:55 UTC 2021


On Fri, 8 Jan 2021 13:59:08 GMT, Miroslav Wengner <mwengner at openjdk.org> wrote:

>> build.sh line 88:
>> 
>>> 86:         printf " \t%s\t%s\n" "--clean" "to run maven clean"
>>> 87:         printf " \t%s\t%s\n" "--run" "to run JMC once it was packaged"
>>> 88:         printf " \t%s\t%s\n" "--runAgentExample" "to run Agent Example once it was packaged"
>> 
>> Any chance you could also add --runAgentConverterExample? :)
>> 
>> Basically:
>> --add-opens java.base/jdk.internal.misc=ALL-UNNAMED -XX:+FlightRecorder -javaagent:${resource_loc:/org.openjdk.jmc.agent/target/org.openjdk.jmc.agent-1.0.0-SNAPSHOT.jar}=${resource_loc:/org.openjdk.jmc.agent/src/test/resources/org/openjdk/jmc/agent/converters/test/jfrprobes_template.xml}
>
> I've add an option --runAgentCustomExample '<class>' => --runAgentCustomExample 'org.openjdk.jmc.agent.test.InstrumentMe' , what do you think ? @thegreystone

For me, the buildscript is all about making it easier to do common things. The --runAgentConvertExample option makes it easy to run one of the two examples one might want to run to test things from JMC. If I need to do something custom, I might as well just put the built agent jar on the command line and do whatever I want to do. Since the classpath won't be set to anything else, there won't be that many main classes to pick from other than the standard example and the converter example. 

I would suggest just having --runAgentExample and --runAgentConverterExample.

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

PR: https://git.openjdk.java.net/jmc/pull/183


More information about the jmc-dev mailing list