RFR: 8272854: split runtime/CommandLine/PrintTouchedMethods.java test

Igor Ignatyev iignatyev at openjdk.java.net
Wed Oct 20 19:46:05 UTC 2021


On Tue, 24 Aug 2021 07:18:04 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Hi all,
>> 
>> could you please review this patch that extracts part of `runtime/CommandLine/PrintTouchedMethods.java` test to `runtime/CommandLine/PrintTouchedMethodsJcmd.java`?
>> 
>> from JBS:
>>> part of `runtime/CommandLine/PrintTouchedMethods.java` test can be done in a driver mode and ignore external flags, while another part should be executed in an othervm mode. to make execution mode efficient, the test can be split into two.
>> 
>> testing: ``runtime/CommandLine/` on `{linux,windows,macos}-x64`
>> 
>> -- Igor
>
> test/hotspot/jtreg/runtime/CommandLine/PrintTouchedMethodsJcmd.java line 42:
> 
>> 40:       var pid = Long.toString(ProcessHandle.current().pid());
>> 41:       var pb = new ProcessBuilder();
>> 42:       pb.command(new String[] {JDKToolFinder.getJDKTool("jcmd"), pid, "VM.print_touched_methods"});
> 
> Can't you just include the desired VM flags as part of the String[] here and keep everything in one file and using driver mode?

VM flags which we pass here are for `jcmd` (that connects to the main process), but it's the main process that needs to be run w/ ` -XX:+UnlockDiagnosticVMOptions -XX:+LogTouchedMethods`.

we can keep all testing in one test file by introducing yet another process (which does nothing and just waits for the signal from the main process to exit) and pass its pid to `jcmd`. IMHO, this will just add unneeded complexity to the test.

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

PR: https://git.openjdk.java.net/jdk/pull/5231


More information about the hotspot-runtime-dev mailing list