pprof-rs
pprof-rs copied to clipboard
feat: implement Report::from_pprof() for protobuf roundtrip conversion
Add backwards conversion from protobuf Profile to Report, enabling roundtrip conversion between the two formats. This allows users to reconstruct Report objects from previously exported protobuf data, which is helpful for making flamegraphs.
Changes:
- Add Report::from_pprof() method to convert protobuf Profile back to Report
- Fix pprof() method to create one location per frame instead of per symbol
- Group inlined functions correctly within locations per pprof spec
- Add roundtrip conversion test
The changes make the protobuf output more standards-compliant by grouping inlined function symbols within the same location, which aligns with how Google's pprof tool expects the data to be structured.
Welcome @Benjscho! It looks like this is your first PR to tikv/pprof-rs 🎉
@YangKeao would you be able to review?