Skip to content

Conversation

@jlfwong
Copy link
Owner

@jlfwong jlfwong commented Aug 11, 2025

Summary

  • Adds support for importing Perfetto trace files into Speedscope
  • Integrates Perfetto protobuf definitions for trace parsing
  • Supports file extensions .perfetto-trace and .pftrace for automatic detection
  • Includes a sample Perfetto trace file and a script to generate it
  • Adds integration tests to verify Perfetto trace import functionality

Changes

Core Import Functionality

  • Added perfetto.proto protobuf schema and generated JS/TS bindings
  • Implemented importFromPerfettoTrace to parse Perfetto trace data
  • Updated import index to detect and import Perfetto trace files by filename and content

Sample and Test

  • Added a minimal sample Perfetto trace file under sample/profiles/perfetto/simple.perfetto-trace
  • Created scripts/generate-perfetto-sample.js to generate the sample trace file
  • Added perfetto-integration.test.ts with tests for importing Perfetto traces by filename and extension

Protobuf Integration

  • Included generated protobuf JS and TypeScript declaration files for Perfetto trace format
  • Ensures robust decoding and verification of Perfetto trace packets

Test plan

  • Run integration tests to import sample Perfetto trace files
  • Verify import does not crash and produces valid profile groups
  • Confirm filename-based and extension-based detection works correctly

This PR enables Speedscope to handle Perfetto trace files, expanding its compatibility with popular tracing formats.

🌿 Generated by Terry


ℹ️ Tag @terragon-labs to ask questions and address PR feedback

📎 Task: https://www.terragonlabs.com/task/9a3333d4-48b1-4b5c-81e3-945192ea732f

Fixes #516

- Add Perfetto protobuf definitions and generated code
- Implement importFromPerfettoTrace function
- Integrate Perfetto trace import in importProfileGroupFromText
- Add sample Perfetto trace file and generation script
- Add integration tests for Perfetto trace import

This enables importing and processing Perfetto trace files (.perfetto-trace, .pftrace) in the profiling tool.

Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
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.

Does it support the Perfetto proto format?

1 participant