sbt / sbt-jmh

"Trust no one, bench everything." - sbt plugin for JMH (Java Microbenchmark Harness)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use async-profiler with multiple options

lenguyenthanh opened this issue · comments

I'm trying to run jmh with async-profiler, but It seems async-profiler cannot recognize the seconds options, for example:

This doesn't recognize libPath option:
bench / Jmh / run -rf json .*PerftBench* -prof async:output=flamegraph;libPath=path/async-profiler/build/libasyncProfiler.so

but this works for libPath but not output:

bench / Jmh / run -rf json .*PerftBench* -prof async:libPath=path/async-profiler/build/libasyncProfiler.so;output=flamegraph

Can you try with a , instead of a ; as a separator maybe?

I don't remember how but, IIRC, I used to use multiple options and it was working

thanks! I tried, but changing from ; to , doesn't help. async:help states that I should use ;:

sbt:scalachess> bench / Jmh / run -rf json .PerftBench -prof async:help
[info] running (fork) org.openjdk.jmh.Main -rf json .PerftBench -prof async:help
[error] Profilers failed to initialize, exiting.
[error] Usage: -prof :opt1=value1,value2;opt2=value3

I wonder if the issue is not with the libPath option. AFAIR, It never worked for me.
I don't remember the installation process but I can see that I installed the .so and .dylib in (I'm on Mac):

/System/Volumes/Data/Users/jules/Library/Java/Extensions/libasyncProfiler.so
/System/Volumes/Data/Users/jules/Library/Java/Extensions/libasyncProfiler.dylib

thank @guizmaii, your solution works like a charm.

Hi, I just wanted upvote this problem - libPath needs to be the first option or it is ignored and the profiler doesn't load. Options following the libPath option (after a ';') are ignored.

If you put the -prof options between double quotes it works: bench/Jmh/run <other options> -prof "async:libPath=<path>;output=flamegraph"