We have users complaining that JMH -prof async does not work on MacOS X.
I figured that is because JMH does System.loadLibrary("asyncProfiler"), which cannot find the library even with DYLD_LIBRARY_PATH or -Djava.library.path set. This seems to be because JDK actually looks for libasyncProfiler.dylib, but the Mac OS bundle -- at least 1.8.2 -- calls it libasyncProfiler.so!
I think profiler.sh is unaffected by this, because it points to explicit name: -agentpath:../build/libasyncProfiler.so. This gives us the JMH workaround: -prof async:libPath=../build/libasyncProfiler.so, but it would be more convenient for everything to work without extra options.
Thank you for the report.
Indeed, async-profiler library has the same name on Linux and macOS, whereas the OS naming convention is different.
I think renaming it now in 1.x is not a good idea, since users may rely on the existing name (well, I know actual cases when they do). But this is definitely something I will consider for version 2.0.
Maybe not change it for 1.x, but ship the symlink .dylib -> .so?
Sounds like a solution. Will do.
The fix went into release 1.8.3
Most helpful comment
Maybe not change it for 1.x, but ship the symlink
.dylib->.so?