From 69a309fde29aa6911522a987e7f4db11e07aeefb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=9B=BD=E7=91=9E?= <18235787078@163.com> Date: Sat, 21 Sep 2024 20:07:59 +0800 Subject: [PATCH] =?UTF-8?q?classify=E9=80=89=E9=A1=B9=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- site/docs/doc/profiler.md | 14 ++++++++++++++ site/docs/en/doc/profiler.md | 13 +++++++++++++ 2 files changed, 27 insertions(+) diff --git a/site/docs/doc/profiler.md b/site/docs/doc/profiler.md index 0e0f2d22982..5007978f699 100644 --- a/site/docs/doc/profiler.md +++ b/site/docs/doc/profiler.md @@ -350,3 +350,17 @@ profiler start --loop 1h -f /var/log/profile-%t.jfr ## `--timeout` 选项 这个选项指定 profiling 自动在多久后停止。该选项和 `--loop` 选项的格式一致,可以是时间点,也可以是一个时间间隔。这两个选项都是用于 `start` action 而不是 `collect` action 的。可参考 [async-profiler Github Discussions](https://github.com/async-profiler/async-profiler/discussions/789) 了解更多信息。 + + +## `--classify` 选项 +这个选项用于自动将执行样本分类到不同的类别中。 +这些类别包括垃圾回收、JIT 编译、类加载等。 +这个功能可以帮助你在分析火焰图时更容易地回答以下问题: +* 总共花了多少时间在类加载上? +* Java 代码在解释器和 C1/C2 编译方法中运行的时间百分比是多少? +* Lambda 对启动时间的影响是什么? + +(推荐使用 --cstack dwarf 选项以提高准确性,可参考[async profiler pr#719](https://github.com/async-profiler/async-profiler/issues/719)) +```bash +profiler start -e cpu -f /tmp/profile.jfr --cstack dwarf +``` diff --git a/site/docs/en/doc/profiler.md b/site/docs/en/doc/profiler.md index fa7318a276e..abaf8c3dccb 100644 --- a/site/docs/en/doc/profiler.md +++ b/site/docs/en/doc/profiler.md @@ -352,3 +352,16 @@ profiler start --loop 1h -f /var/log/profile-%t.jfr This option specifies the time when profiling will automatically stop. The format is the same as in loop: it is either a wall clock time (12:34:56) or a relative time interval (2h). Both `--loop` and `--timeout` are used for `start` action but not for `collect` action, for further information refer to [async-profiler Github Discussions](https://github.com/async-profiler/async-profiler/discussions/789). + +## --classify Option +This option is used to automatically classify execution samples into different categories. +These categories include garbage collection, JIT compilation, class loading, etc. +Specifically, this feature can help you more easily answer the following questions when analyzing flame graphs: +* How much time was spent on class loading? +* What percentage of Java code runs in the interpreter and C1/C2 compiled methods? +* What is the impact of Lambda on startup time? + +(It is recommended to use the --cstack dwarf option to improve accuracy,, for further information refer to [async profiler pr#719](https://github.com/async-profiler/async-profiler/issues/719).) +```bash +profiler start -e cpu -f /tmp/profile.jfr --cstack dwarf +```