Skip to content

Conversation

@torshepherd
Copy link

@torshepherd torshepherd commented Nov 26, 2025

Hi, this PR adds basic draft support for pprof's profile.proto format. I wanted to put this up early before diving too deep into the details to gauge if there is appetite for upstreaming this.

Example profile for a dummy program:

SVG:

image

Pprof:

image

Pprof comes with a number of other niceties. For instance, you can view the source code:

image

If there is interest in upstreaming this, I have a number of other improvements I would do:

  1. Render subprocess hierarchies like the other formats can
  2. Collect procmaps and save memory mappings for native unwound code. This would be a massive leg up on the current status quo, as it would allow pprof to disassemble and show stack samples at the instruction level in the UI.
  3. Add some batching/caching while building that should save more space in the output profile.

But already in my limited testing I'm seeing that gzipped profile.proto files are quite a bit smaller than the svg files:

Format File Size Samples
pprof-gzip /tmp/complex_native.pprof.gz 267KB 727
SVG /tmp/complex_native.svg 981KB 669

I would also be happy to move these additional dependencies and features behind a feature flag!

Disclaimer: This PR was made with light LLM usage, mostly just asking which libraries I should use. The pprof.rs file is quite rough so if this is an acceptable direction, I would clean it up a decent amount before asking for real code review time

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.

1 participant