From 29ac523cf78871ba61117d8d61cf1885fba9ce13 Mon Sep 17 00:00:00 2001 From: Jiping Yin Date: Fri, 19 Sep 2025 09:29:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9Java=20=E7=9A=84=20-XX:+PreserveFrameP?= =?UTF-8?q?ointer=20=E9=80=89=E9=A1=B9=E4=BD=9C=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../05-features/04-continuous-profiling/01-auto-profiling.md | 1 + .../05-features/04-continuous-profiling/01-auto-profiling.md | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/zh/05-features/04-continuous-profiling/01-auto-profiling.md b/docs/zh/05-features/04-continuous-profiling/01-auto-profiling.md index c420eadb..a5af270a 100644 --- a/docs/zh/05-features/04-continuous-profiling/01-auto-profiling.md +++ b/docs/zh/05-features/04-continuous-profiling/01-auto-profiling.md @@ -65,6 +65,7 @@ permalink: /features/continuous-profiling/auto-profiling - 编译 Rust:`RUSTFLAGS="-C force-frame-pointers=yes"` - 编译 Golang:默认开启,无需额外编译参数 - 运行 Java:`-XX:+PreserveFramePointer` + - 开启此参数会禁用某些编译器优化,不过根据 [Netflix](https://netflixtechblog.com/java-in-flames-e763b3d32166) 和 [Brendan Gregg](https://www.brendangregg.com/FlameGraphs/cpuflamegraphs.html) 的实测结果,该配置通常只会引入 <1% 的性能损耗。因此,Netflix 早在 2015 年开始已经在生产环境大规模使用,以支撑其 Java 程序的每日性能分析。 - 启用 Agent 的 DWARF 栈回溯能力请参考[文档](../../configuration/agent/#inputs.ebpf.profile.unwinding) - 对于编译型语言的应用进程,编译时需要注意保留符号表 diff --git a/translate/translated/05-features/04-continuous-profiling/01-auto-profiling.md b/translate/translated/05-features/04-continuous-profiling/01-auto-profiling.md index 349d0c6e..c9806db8 100644 --- a/translate/translated/05-features/04-continuous-profiling/01-auto-profiling.md +++ b/translate/translated/05-features/04-continuous-profiling/01-auto-profiling.md @@ -66,7 +66,8 @@ Two prerequisites must be met to obtain profiling data: - Compile C/C++: `gcc -fno-omit-frame-pointer` - Compile Rust: `RUSTFLAGS="-C force-frame-pointers=yes"` - Compile Golang: Enabled by default, no extra compile parameters needed - - Run Java: `-XX:+PreserveFramePointer` + - Run Java: `-XX:+PreserveFramePointer` + - Enabling this parameter disables certain compiler optimizations. However, based on real-world measurements from [Netflix](https://netflixtechblog.com/java-in-flames-e763b3d32166) and [Brendan Gregg](https://www.brendangregg.com/FlameGraphs/cpuflamegraphs.html), this configuration typically introduces less than 1% performance overhead. As a result, Netflix has been widely using it in production since 2015 to support daily performance analysis of its Java applications. - For enabling the Agent's DWARF stack unwinding capability, please refer to the [documentation](../../configuration/agent/#inputs.ebpf.profile.unwinding) - For compiled languages, ensure the symbol table is preserved during compilation @@ -89,4 +90,4 @@ The Off-CPU profiling feature **only** collects the following call stacks: - Check whether the file contains a symbol table ``` readelf -WS $path | grep symtab - ``` \ No newline at end of file + ```