Issues with dtraceasm, and a workaround

Aleksey Shipilev shade at redhat.com
Tue Feb 23 11:02:13 UTC 2021


On 2/23/21 5:27 AM, Henri Tremblay wrote:
> Yes. This looks fine:
> 
> Collection<String> messages =Utils.tryWith("sudo","kill","-TERM",Long.toString(dtraceProcess.pid()));
> if (!messages.isEmpty()) {
>      throw new IllegalStateException(messages.toString());
> }
> 
> However, Paul is right, the pid() method doesn't exist so you will need something like this:

Yes. In fact, there is already a similar code in the Utils that does similar thing. The additional 
wrinkle is that the code is supposed to compile and run on JDK 7 and JDK 8, which requires a bit 
more fiddling.

I have updated the PR with the latest version, please try it?
   https://github.com/openjdk/jmh/pull/22

-- 
Thanks,
-Aleksey



More information about the jmh-dev mailing list