magic-trace icon indicating copy to clipboard operation
magic-trace copied to clipboard

Support bigger traces at lower resolution

Open lpw25 opened this issue 3 years ago • 4 comments

My understanding is that one of the main blockers preventing taking traces for longer time periods is that perfetto can't handle the size of traces that it produces. I would happily settle for longer traces which only showed function calls that took more than a certain amount of time -- to give a high-level view of where the time was spent. Combined with some option to filter a trace down to a given time range this should allow for exploring large traces reasonably ergonomically.

lpw25 avatar Mar 18 '22 14:03 lpw25

If we decrease the timing resolution in software, we can also request lower timing resolution from the hardware, for lower overhead.

Refs:

  • https://github.com/janestreet/magic-trace/blob/e9d5d2683da18ed317a28b3f9531a249c1a57443/src/perf_tool_backend.ml#L52-L61

  • http://halobates.de/blog/p/432

Xyene avatar Mar 25 '22 02:03 Xyene

That seems worth supporting too. Although for my use case I'd like to take a single trace, view it in its entirety at a low resolution, and then view subsections of the trace at high resolution once I had identified which parts where interesting.

lpw25 avatar Mar 25 '22 13:03 lpw25

Fuchsia supports inserting binary blobs to the trace file: https://fuchsia.dev/fuchsia-src/reference/tracing/trace-format#blob-record

We could include the perf.data and associated files there (as a tarball?), I think, to allow later processing.

Xyene avatar Mar 29 '22 13:03 Xyene

I want the blob (as @Xyene knows) for general debuggability so I think that's a great feature in and of itself. The idea of then being able to recursively reprocess the output to something filtered for Perfetto friendliness sounds fantastic (if hilarious.)

ahh avatar Mar 30 '22 21:03 ahh