RFR: CODETOOLS-7903560: JMH: async profiler reports only the last fork result

Aleksey Shipilev shade at openjdk.org
Sat Feb 3 09:56:11 UTC 2024


On Thu, 21 Sep 2023 14:43:29 GMT, Jonas Konrad <duke at openjdk.org> wrote:

> Without this change, async-profiler would write the same result in each fork, overwriting the previous result.
> 
> This patch introduces a new "FileResult" class that collects the output paths of each benchmark. In `afterTrial`, the output files are moved to a new path that includes the pid (fork number would be an alternative but it's not as easily available).
> 
> At the moment, results of different runs are not coalesced. But with these changes, it would be easy to coalesce at least the results of the "collapsed" output mode. I plan to do this in another PR.

Sorry for long delay. This looks fine with a few nits. 

I think we still want to emit the pid-less file. It would help the scenario when we re-run the benchmark over and over again, and just hit "Refresh" on the same async-profile result. If the file name would be different each time due to PID, it would break this workflow. The last file in the sequence we can have both copy with the PID filename, and leave the original behind.

jmh-core-it/src/test/java/org/openjdk/jmh/it/profilers/AsyncProfilerForkTest.java line 2:

> 1: /*
> 2:  * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.

There and later, the dates are not correct (I think our current template is not current), please adjust these by hand.

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

PR Review: https://git.openjdk.org/jmh/pull/121#pullrequestreview-1860965264
PR Review Comment: https://git.openjdk.org/jmh/pull/121#discussion_r1477030665


More information about the jmh-dev mailing list