RFR: 7903696: JMH: Add xctrace-based perfasm profiler for macOS [v3]
Aleksey Shipilev
shade at openjdk.org
Tue Apr 23 09:03:48 UTC 2024
On Mon, 22 Apr 2024 19:45:06 GMT, Filipp Zhinkin <fzhinkin at openjdk.org> wrote:
>> jmh-core/src/main/java/org/openjdk/jmh/profile/XCTraceAsmProfiler.java line 157:
>>
>>> 155: return super.afterTrial(br, pid, stdOut, stdErr);
>>> 156: } finally {
>>> 157: XCTraceSupport.removeDirectory(temporaryDirectory);
>>
>> Do you really need `finally` here? Can we just record the result from super and then do `removeDirectory`?
>
> The intention was to remove the directory no matter what.
>
> `TempFile`s (like `hsLog`) should be removed by an on-exit hook, thanks to `deleteOnExit` called from `TempFileManager::create`. For directories, there's no such mechanism, so I decided to rely on `try-finally` instead.
I was just asking if you want to avoid `finally` control flow here and just call it after `super.afterTrial` call. But that's optional, we can clean it up later.
-------------
PR Review Comment: https://git.openjdk.org/jmh/pull/130#discussion_r1575905415
More information about the jmh-dev
mailing list