是否可以同时对 alloc 和 itimer 使用 async-profiler

Is it possible to use async-profiler for alloc and itimer at the same time

在使用 async-profiler 时,我 运行 cpu 的配置文件和 alloc 分开但希望可以在同一持续时间内使用它们?鉴于支持的输出格式类型,这似乎只有在使用 JFR 时才有意义。

是的,此功能已在 async-profiler 的 v2.0 分支中实现。该分支目前正在开发中,请谨慎使用。计划下一个主要版本。

要在命令行中指定多个事件,请使用

profiler.sh -e cpu,alloc -f out.jfr ...

与代理选项相同:

-agentpath:/path/to/libasyncProfiler.sh=start,event=cpu,event=alloc,file=out.jfr,...

如您所料,这仅适用于 JFR 输出。

如需反馈,请评论相应的GitHub issue