Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use async-profiler with multiple options #227

Open
lenguyenthanh opened this issue Jul 8, 2023 · 6 comments
Open

How to use async-profiler with multiple options #227

lenguyenthanh opened this issue Jul 8, 2023 · 6 comments

Comments

@lenguyenthanh
Copy link

lenguyenthanh commented Jul 8, 2023

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

@guizmaii
Copy link
Contributor

guizmaii commented Jul 8, 2023

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

@lenguyenthanh
Copy link
Author

lenguyenthanh commented Jul 8, 2023

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

@guizmaii
Copy link
Contributor

guizmaii commented Jul 8, 2023

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

@lenguyenthanh
Copy link
Author

lenguyenthanh commented Jul 8, 2023

thank @guizmaii, your solution works like a charm.

@pdziedzic-sumo
Copy link

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.

@aherlihy
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants