I wish there was a simpler and quicker introduction into the tool's capabilities than an hour long video and a text article saying it's a swiss army knife that does a lot of things. I need 1 or a few glimpses into it, there's no need to cover every capability thoroughly, show just enough to have some general understanding of how it works and how to use it and how to solve some common problems with it.
If you're more looking for a short intro, I'd maybe suggest our docs website, specifically the page https://perfetto.dev/docs/getting-started/start-using-perfet...
For example:
* if you work in the Linux kernel, try https://perfetto.dev/docs/getting-started/start-using-perfet...
* If you're generally curious about performance or tracing try https://perfetto.dev/docs/getting-started/start-using-perfet...
There's also our quick starts which take you through "I just want to see the tool in action". Find the system tracing one at https://perfetto.dev/docs/getting-started/system-tracing
For a simple example using your own data, save this as a file and open it via "Open trace file":
[
{"name": "Example 1", "ph": "X", "ts": 1, "dur": 1, "pid": 0, "tid": 0},
{"name": "Example 2", "ph": "X", "ts": 3, "dur": 2, "pid": 0, "tid": 0},
{"name": "Example 3", "ph": "X", "ts": 2, "dur": 1, "pid": 0, "tid": 1},
{"name": "Example 4", "ph": "X", "ts": 4, "dur": 2, "pid": 0, "tid": 1}
]It opens a special "aggregate flame graph" view of the profile since pprof does not preserve time information. But it works! We use it for visualizing aggregates across thousands of profiles in production!
Viztracer is a super library to capture perfetto compatible output from Python.
It helped me find perf issues in literally minutes.
https://raw.githubusercontent.com/time4tea/gopro-dashboard-o...
knlb•6h ago
My personal favorite tool I've built this year is to dynamically generate a trace from a sql query, and allow quickly combining queries. Something like `SELECT timestamp, track, name, ` etc. where column names get transformed to packets automatically.
That way I can overlay multiple py-spy traces and instrumentation into a dynamically implemented generated perfetto trace, loaded into a perfetto iframe using the ping/pong mechanism at https://perfetto.dev/docs/visualization/deep-linking-to-perf....
lalitmaganti•6h ago
We're look at integrating some sort of similarish things into Perfetto itself where, for a synthetically generated trace, you can say "run this SQL query and add a debug track for it on trace load". See the discussion on https://github.com/google/perfetto/issues/1342 :)