-
Notifications
You must be signed in to change notification settings - Fork 469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cargo: build with frame pointers #10226
Conversation
7227 tests run: 6875 passed, 0 failed, 352 skipped (full report)Flaky tests (5)Postgres 17
Postgres 16
Code coverage* (full report)
* collected from Rust tests only The comment gets automatically updated with the latest test results
e180c0b at 2025-01-04T15:21:22.545Z :recycle: |
c89b06c
to
de36026
Compare
I ran some benchmarks for
|
Interestingly, the This was using a benchmark of pprof-rs This probably isn't worth it then. There was some hope that it might resolve #10225, as seen in grafana/pyroscope-rs#124, but if it requires the |
Given the frequency with which we're seeing seg faults in staging, even with heap profiling disabled, maybe this is worth a shot -- at the very least, to see if it resolves the seg faults. |
Lines 47 to 58 in 95f1920
Do we also need to add it to the dockerfile or the flags will be combined? |
Good catch, the environment variable will override them. I'll submit a followup. |
Problem
Frame pointers are typically disabled by default (depending on CPU architecture), to improve performance. This frees up a CPU register, and avoids a couple of instructions per function call. However, it makes stack unwinding much more inefficient, since it has to use DWARF debug information instead, and gives worse results with e.g.
perf
and eBPF profiles. Thebacktrace
implementation oflibunwind
is also suspected to cause seg faults.The performance benefit of frame pointer omission doesn't appear to matter that much on modern 64-bit CPU architectures (which have plenty of registers and optimized instruction execution), and benchmarks did not show measurable overhead.
The Rust standard library and jemalloc already enable frame pointers by default.
For more information, see https://www.brendangregg.com/blog/2024-03-17/the-return-of-the-frame-pointers.html.
Resolves #10224.
Touches #10225.
Summary of changes
Enable frame pointers in all builds, and use frame pointers for pprof-rs stack sampling.