RFR: 8348401: [IR Framework] PrintTimes should not require verbose [v3]
Christian Hagedorn
chagedorn at openjdk.org
Mon Jan 27 13:36:51 UTC 2025
On Mon, 27 Jan 2025 08:57:04 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 incrementally with one additional commit since the last revision:
>
> Add comment
Otherwise, looks good, thanks for fixing this!
test/hotspot/jtreg/compiler/lib/ir_framework/test/TestVM.java line 889:
> 887: if (VERBOSE || PRINT_TIMES) {
> 888: // Here we are in the test VM, which was spawned by the main jtreg VM. the stdout of the test VM is hidden
> 889: // unless the Verbose or ReportStdout flag are used. TestFrameworkSocket is used by the parent jtreg
Suggestion:
// unless the Verbose or ReportStdout flag is used. TestFrameworkSocket is used by the parent jtreg
test/hotspot/jtreg/compiler/lib/ir_framework/test/TestVM.java line 892:
> 890: // VM and the test VM to communicate. By sending the prints through the TestFrameworkSocket with the
> 891: // parameter stdout set to true, the parent VM will print the received messages to its stdout, making it
> 892: // visible to the user.
Maybe you can move this comment directly to `TestFrameworkSocket.write()` as documentation for the other code as well that uses the socket to dump messages.
-------------
Marked as reviewed by chagedorn (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/23267#pullrequestreview-2575447974
PR Review Comment: https://git.openjdk.org/jdk/pull/23267#discussion_r1930534940
PR Review Comment: https://git.openjdk.org/jdk/pull/23267#discussion_r1930536327
More information about the hotspot-compiler-dev
mailing list