Skip to content

Implement /pprof/symbol#186

Merged
TheJokr merged 1 commit intocloudflare:mainfrom
achernya:pprof-symbols
Apr 2, 2026
Merged

Implement /pprof/symbol#186
TheJokr merged 1 commit intocloudflare:mainfrom
achernya:pprof-symbols

Conversation

@achernya
Copy link
Copy Markdown
Contributor

@achernya achernya commented Apr 2, 2026

foundations includes a feature for memory profiling, which is very useful. Unfortunately, that feature does not natively work with the jeprof CLI tool because of the lack of a /pprof/symbol endpoint. Since many Rust binaries are built with PIE, trying to post-hoc symbolize with jeprof/pprof is quite challenging -- especially if running on a remote system that does not have debug symbols available.

This commit implements /pprof/symbol, following the golang implementation
(https://cs.opensource.google/go/go/+/refs/tags/go1.26.1:src/net/http/pprof/pprof.go;l=197) as a guide. The actual symbolization is performed with the backtrace crate, which was previously an indirect dependency and now becomes a direct dependency.

foundations includes a feature for memory profiling, which is very
useful. Unfortunately, that feature does not natively work with the
`jeprof` CLI tool because of the lack of a /pprof/symbol
endpoint. Since many Rust binaries are built with PIE, trying to
post-hoc symbolize with jeprof/pprof is quite challenging --
especially if running on a remote system that does not have debug
symbols available.

This commit implements /pprof/symbol, following the golang
implementation
(https://cs.opensource.google/go/go/+/refs/tags/go1.26.1:src/net/http/pprof/pprof.go;l=197)
as a guide. The actual symbolization is performed with the `backtrace`
crate, which was previously an indirect dependency and now becomes a
direct dependency.
@TheJokr TheJokr merged commit 7126a17 into cloudflare:main Apr 2, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants