perfetto icon indicating copy to clipboard operation
perfetto copied to clipboard

Improve sharing experience of UI macros

Open pyricau opened this issue 2 months ago • 6 comments

I'd love to be able to write my own custom Perfetto plugins to add custom tracks / various things when I load perfetto traces from our app. I know you can add perfetto plugins if you host your own instance but that's a little bit of a hassle. Also it'd be great if I could share generic plugins with others outside my company, that they could load if useful to them.

pyricau avatar Sep 25 '25 14:09 pyricau

Please see https://perfetto.dev/docs/visualization/ui-automation. We recently introduced this as a way to "script" the UI in a lightweight way: we expect this to cover most of the cases which people were using plugins for.

To share these, this requires copy/pasting a JSON snippet into the UI which is not ideal but works OK for now. We're looking into how we can improve this experience in the future: we have a bunch of ideas we are exploring for improved sharing of these things.

@stevegolton @primiano FYI.

LalitMaganti avatar Sep 25 '25 14:09 LalitMaganti

If you have feedback on the above, please let us know.

We've had a very good response to this feature from teams inside of Google but we always lack visibility in how people outside of Google feel about new things like this. Especially as we're looking to improve sharing, ideas and usecases from external folks using Perfetto would be very helpful.

LalitMaganti avatar Sep 26 '25 15:09 LalitMaganti

This is cool! The only thing is, I don't want to just do that for myself, I want to have a way for other engineers at my company to benefit from the same set of tools / share stuff without everyone having to copy paste a bunch of json

pyricau avatar Oct 03 '25 12:10 pyricau

Sure: the thing we're struggling with right now is how to balance "I want this to work as easily as possible without complexity" and "I want proper ACLs so I'm not just sharing these things publicly".

We were thinking maybe something based on top of GitHub repos + using GitHub auth tokens but this is just an idea at the moment. Thoughts and opinions welcome.

LalitMaganti avatar Oct 03 '25 20:10 LalitMaganti

I'm working on adopting perfetto at work (its been super cool so far!). We've got some shared nix/bash scripts that pull a trace and serve it to ui.perfetto.dev over localhost. I'd love to expose a few key Macros to the rest of the folks on my team who are running these scripts.

It seems like if I wanted to share startup commands then I'd be golden and share them over the URL's parameters, but for Macros i'm out of luck. In my case the Macros would likely be version controlled in our mono-repo.

Thanks for your work on this.

jackschu avatar Oct 13 '25 21:10 jackschu

Still heavily WIP but you can have a look at https://github.com/google/perfetto/discussions/3227 and https://github.com/google/perfetto/discussions/3238.

Would that work for your usecase? You need some way of deploying from your monorepo to S3, GCS or GitHub but if you could do that, then it would be "one-click" for your end users to point at that and have access to all your macros.

Edit: oh or you could have your own HTTPS server but then you're signing up to deal with authentication/authorization yourself. Might be an option though.

LalitMaganti avatar Oct 13 '25 21:10 LalitMaganti