RFR: 8348401: [IR Framework] PrintTimes should not require verbose [v2]
Vladimir Kozlov
kvn at openjdk.org
Fri Jan 24 17:04:51 UTC 2025
On Fri, 24 Jan 2025 08:37:37 GMT, Theo Weidmann <tweidmann at openjdk.org> wrote:
>> The flag -DPrintTimes=true currently only prints the measured execution time if -DVerbose=true is also used. This patch removes the dependency on -DVerbose=true.
>>
>> The measurements are made by the test vm (the VM spawned by the IR framework), which tries to print it to stdout. Since the stdout of the test VM is hidden unless the Verbose or ReportStdout flag are used, the printed times are not visible without these flags.
>>
>> This patch addresses this by using the TestFrameworkSocket, which is used by the parent jtreg VM and the test VM to communicate. By sending the prints through the TestFrameworkSocket with the parameter stdout set to true, the parent VM will print the received messages to its stdout, making it visible to the user.
>>
>> Example command:
>>
>>
>> jtreg -jdk:build/fastdeb/jdk -verbose:all -vmoptions:"-DPrintTimes=true"
>>
>>
>> Example output:
>>
>>
>> Messages from Test VM
>> ---------------------
>> [PRINT_TIMES] testIntArrayRunner: 66530333 ns
>> [PRINT_TIMES] testShortArrayRunner: 108031125 ns
>> [PRINT_TIMES] testLongArrayRunner: 159549917 ns
>> [PRINT_TIMES] testByteArrayRunner: 201181042 ns
>
> Theo Weidmann has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:
>
> - Merge branch 'master' into 8348401-fix-print-times
> - Add tag
> - Update TestVM.java
> - Update TestVM.java
test/hotspot/jtreg/compiler/lib/ir_framework/test/TestVM.java line 890:
> 888: System.out.println(System.lineSeparator() + System.lineSeparator() + "Test execution times:");
> 889: for (Map.Entry<Long, String> entry : durations.entrySet()) {
> 890: TestFrameworkSocket.write(String.format("%-25s%15d ns%n", entry.getValue() + ":", entry.getKey()),
Please, add comment which explains usage of `TestFrameworkSocket` as you did in description.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23267#discussion_r1928990950
More information about the hotspot-compiler-dev
mailing list