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.