Skip to content

Commit

Permalink
classify选项相关文档
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhaoGuorui666 committed Sep 21, 2024
1 parent 46b2fe2 commit 69a309f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
14 changes: 14 additions & 0 deletions site/docs/doc/profiler.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
13 changes: 13 additions & 0 deletions site/docs/en/doc/profiler.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

0 comments on commit 69a309f

Please sign in to comment.