diff --git a/site/src/site/sphinx/en/profiler.md b/site/src/site/sphinx/en/profiler.md index cae7d3d1a..cb76f965d 100644 --- a/site/src/site/sphinx/en/profiler.md +++ b/site/src/site/sphinx/en/profiler.md @@ -181,3 +181,49 @@ $ profiler version Async-profiler 1.6 built on Sep 9 2019 Copyright 2019 Andrei Pangin ``` + +### Configure framebuf option + +> If you encounter `[frame_buffer_overflow]` in the generated svg image, you need to increase the framebuf (the default value is 1'000'000), which can be configured explicitly, such as: + +```bash +profiler start --framebuf 5000000 +``` + +### Configure include/exclude to filter data + +If the application is complex and generates a lot of content, and you want to focus on only part of the data, you can filter by include/exclude. such as + +```bash +profiler start --include'java/*' --include'demo/*' --exclude'*Unsafe.park*' +``` + +> Both include/exclude support setting multiple values, but need to be configured at the end of the command line. + + +### Specify execution time + +For example, if you want the profiler to automatically end after 300 seconds, you can specify it with the `-d`/`--duration` parameter: + +```bash +profiler start --duration 300 +``` + +### Generate jfr format result + +> Note that jfr only supports configuration at `start`. If it is specified at `stop`, it will not take effect. + +``` +profiler start --file /tmp/test.jfr +``` + +The `file` parameter supports some variables: + +* Timestamp: `--file /tmp/test-%t.jfr` +* Process ID: `--file /tmp/test-%p.jfr` + + +The generated results can be viewed with tools that support the jfr format. such as: + +* JDK Mission Control: https://github.com/openjdk/jmc +* JProfiler: https://github.com/alibaba/arthas/issues/1416 diff --git a/site/src/site/sphinx/profiler.md b/site/src/site/sphinx/profiler.md index 799191a91..737f540c3 100644 --- a/site/src/site/sphinx/profiler.md +++ b/site/src/site/sphinx/profiler.md @@ -183,3 +183,49 @@ $ profiler version Async-profiler 1.6 built on Sep 9 2019 Copyright 2019 Andrei Pangin ``` + +### 配置 framebuf 参数 + +> 如果遇到生成的svg图片有 `[frame_buffer_overflow]`,则需要增大 framebuf(默认值是 1'000'000),可以显式配置,比如: + +```bash +profiler start --framebuf 5000000 +``` + +### 配置 include/exclude 来过滤数据 + +如果应用比较复杂,生成的内容很多,想只关注部分数据,可以通过 include/exclude 来过滤。比如 + +```bash +profiler start --include 'java/*' --include 'demo/*' --exclude '*Unsafe.park*' +``` + +> include/exclude 都支持设置多个值 ,但是需要配置在命令行的最后。 + + +### 指定执行时间 + +比如,希望profiler执行 300 秒自动结束,可以用 `-d`/`--duration` 参数指定: + +```bash +profiler start --duration 300 +``` + +### 生成 jfr格式结果 + +> 注意,jfr只支持在 `start`时配置。如果是在`stop`时指定,则不会生效。 + +``` +profiler start --file /tmp/test.jfr +``` + +`file`参数支持一些变量: + +* 时间戳: `--file /tmp/test-%t.jfr` +* 进程ID: `--file /tmp/test-%p.jfr` + + +生成的结果可以用支持jfr格式的工具来查看。比如: + +* JDK Mission Control : https://github.com/openjdk/jmc +* JProfiler : https://github.com/alibaba/arthas/issues/1416 \ No newline at end of file