Profiling with dtraceasm fails

Aleksey Shipilev shade at redhat.com
Fri Sep 25 11:31:14 UTC 2020


Hi,

On 9/20/20 12:14 PM, Gunnar Morling wrote:
> Processing profiler results: DTraceAsmProfiler Exception in thread "main"
> java.lang.IllegalStateException: []
> at
> org.openjdk.jmh.profile.DTraceAsmProfiler.afterTrial(DTraceAsmProfiler.java:92)
> at org.openjdk.jmh.runner.Runner.runSeparate(Runner.java:688)
> at org.openjdk.jmh.runner.Runner.runBenchmarks(Runner.java:571)
> at org.openjdk.jmh.runner.Runner.internalRun(Runner.java:323)
> at org.openjdk.jmh.runner.Runner.run(Runner.java:209)
> at org.openjdk.jmh.Main.main(Main.java:71)
> 
> Unfortunately, there's no more info in the logs (also with -v EXTRA). Any
> suggestions on getting to the grounds of this? I'm quite new to this, so
> might well be I'm doing some stupid mistake.

The profiler code (and dtrace support) in Mac OS is flaky.

It might be simpler to debug straight at your machine. To do that, you can checkout the JMH source 
code, build it, and run any sample benchmark with -prof dtraceasm:

  $ https://github.com/openjdk/jmh
  $ cd jmh
  $ mvn clean install -DskipTests -pl jmh-samples -am
  $ java -jar jmh-samples/target/benchmarks.jar Hello -w 1s -r 1s -wi 5 -i 5 -f 1 -prof dtraceasm

And then... you hack in the diagnostic messages. Looking at the call trace, I would start from 
following what happens in DTraceAsmProfiler.afterTrial. Utils.destroy must have resulted in 
something that exited with non-zero exit code, but nothing diagnostic was printed. It would be 
interesting to follow-up what exactly happened.

-- 
Thanks,
-Aleksey



More information about the jmh-dev mailing list