perfetto icon indicating copy to clipboard operation
perfetto copied to clipboard

How to regenerate the SDK files

Open lbknxy opened this issue 10 months ago • 3 comments

Hi,

I add some proto files and logic codes locally, how to regenrate perfetto sdk files: sdk/perfetto.h and perfetto.cc. I'd like to add a custom proto format and parsing logic, use Perfetto to parse and display it, and regenerate the Perfetto SDK files. Do you have any documentation on this?

lbknxy avatar Jan 08 '26 12:01 lbknxy

To regenerate sdk/perfetto.h and sdk/perfetto.cc after adding custom proto files run tools/gen_amalgamated --output sdk/perfetto

This script amalgamates all SDK sources and proto-generated code into the single-file SDK.

Note: The SDK regeneration only handles emitting custom events. Parsing and displaying them in the UI might require additional Trace Processor and UI changes.

aMayzner avatar Jan 09 '26 17:01 aMayzner

Parsing and displaying them in the UI might require additional Trace Processor and UI changes.

If this ends up being necessary, we should really figure out a mechanism based on reserved proto field ranges + https://github.com/google/perfetto/discussions/3227 to make it possible to parse these protos without us knowing about them without needing to make downstream changes.

LalitMaganti avatar Jan 09 '26 23:01 LalitMaganti

works, very thanks.

lbknxy avatar Jan 15 '26 06:01 lbknxy