问题
While using async-profiler I run the profiles for cpu and alloc separately but was hoping it would be possible to use them as part of the same duration? Given the output format types supported, this only seems to make sense if JFR is used.
回答1:
Yes, this feature is implemented in v2.0 branch of async-profiler. The branch is currently under development, use with care. Planned for the next major release.
To specify multiple events in the command line, use
profiler.sh -e cpu,alloc -f out.jfr ...
The same as an agent option:
-agentpath:/path/to/libasyncProfiler.sh=start,event=cpu,event=alloc,file=out.jfr,...
As you've correctly guessed, this works only with JFR output.
For the feedback, comment the corresponding GitHub issue.
来源:https://stackoverflow.com/questions/63652702/is-it-possible-to-use-async-profiler-for-alloc-and-itimer-at-the-same-time