perfetto icon indicating copy to clipboard operation
perfetto copied to clipboard

How to capture track_event and sampling into the same output file

Open sifangli-labs opened this issue 1 year ago • 1 comments

HI, I can capture both separately using the tools below on Linux: track_event/in code trace (plus CPU scheduling) : traced + traced_probes + (perfetto with output trace specified here) sampling (flamegraph): tracebox with output trace specified

As you can see I have two output pftrace files if I use the above tools, is there a way to show both in the same screen by capturing it once into one pftrace? What tools to use?

PS: I probably can concat the two files into one to display - but hope there is a better alternative provided.

sifangli-labs avatar Jul 15 '25 21:07 sifangli-labs

See https://github.com/google/perfetto/issues/1018. Addresses this exact problem.

You can also try collecting both trace files at the same time given you are collecting everything with Perfetto.

P.s. concatenating files has zero guarantees on working, there are a bunch of assumptions we make on how often certain packets appear in the trace and concatenating will break those assumptions.

LalitMaganti avatar Jul 15 '25 21:07 LalitMaganti