arthas profiler 生成火焰图
profiler
命令支持生成应用热点的火焰图。本质上是通过使用async-profiler不断的采样,然后把收集到的采样结果生成火焰图。详细的例子可以参考上文列出来的两个链接。
profiler` 命令基本运行结构是 `profiler action [actionArg]
如下所示是profiler命令的帮助说明
[arthas@44607]$ profiler --help
###### 使用基本规则
USAGE:
profiler [--allkernel] [--alluser] [-e <value>] [-f <value>] [--format <value>] [-h] [-i <value>
] [--threads] action [actionArg]
SUMMARY:
Async Profiler. https://github.com/jvm-profiling-tools/async-profiler
##### 具体样例展示
EXAMPLES:
##启动
profiler start
##停止
profiler stop
profiler list # list all supported events
profiler actions # list all supported actions
profiler start --event alloc
##设置svg输出方式
profiler stop --format svg # output file format, support svg,html,jfr
##输出到html
profiler stop --file /tmp/result.html
profiler stop --threads
profiler status
profiler resume # Start or resume profiling without resetting collected data.
profiler getSamples # Get the number of samples collected during the profiling session
profiler dumpFlat # Dump flat profile, i.e. the histogram of the hottest methods
profiler dumpCollapsed # Dump profile in 'collapsed stacktraces' format
profiler dumpTraces # Dump collected stack traces
profiler execute 'start' # Execute an agent-compatible profiling command
profiler execute 'stop,file=/tmp/result.svg' # Execute an agent-compatible profiling command
WIKI:
https://alibaba.github.io/arthas/profiler
OPTIONS:
--allkernel include only kernel-mode events
--alluser include only user-mode events
-e, --event <value> which event to trace (cpu, alloc, lock, cache-misses etc.), defau
lt value is cpu
-f, --file <value> dump output to <filename>
--format <value> dump output file format(svg, html, jfr), default valut is svg
-h, --help this help
-i, --interval <value> sampling interval in ns (default: 10'000'000, i.e. 10 ms)
--threads profile different threads separately
<action> Action to execute
<actionArg> Attribute name pattern.