perfetto icon indicating copy to clipboard operation
perfetto copied to clipboard

How to record in code trace and sampling trace in parallel

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

Hi, I can capture both separately (not at the same time - that is my question) using the tools below on Linux: track_event/in code trace: traced + traced_probes + (perfetto with output trace specified here) sampling (flamegraph): tracebox with output trace specified

When I tried to use both at the same time I find tracebox also fires up traced + traced_probes of its own. My questions are: Would 2 instances of traced and trced_probes cause problems? If so, is there a way to avoid tracebox launching the above processes and still captures the sampling trace at the same time perfetto captures the in-code trace.

Thanks.

See also: https://github.com/google/perfetto/issues/1018#issuecomment-3145760810

sifangli-labs avatar Sep 11 '25 17:09 sifangli-labs

🤖 Hi @sifangli-labs, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

github-actions[bot] avatar Sep 11 '25 17:09 github-actions[bot]

I think you are complicating things significantly. Just use:

tracebox --system-sockets -c <config> --txt -o <out file>

Don't run traced, traced_probes etc. Depending on the config, you can choose to collect stack sampling or not, ftrace or not, track event or not etc.

LalitMaganti avatar Sep 11 '25 17:09 LalitMaganti