/trace-stuff

Primary LanguageJavaScript

various trace file utilities I've amassed over the years

This repo is messy.

🚧 No promises that these aren't broken. Hacking encouraged!

Some of what's here:

  • bytes-in-trace-by-cat.mjs - Emit data about what trace event names and categories take up byte size in the JSON
  • format-trace.mjs - Save a "properly formatted" version of the trace to a new file.
  • winnow-trace.mjs - Remove trace events to crop it to a timerange, exclude some category, etc. Save it to a new file.
  • generic-trace-to-devtools-trace.mjs - Take a trace captured from chrome://tracing or perfetto (but converted to json)… And convert it to a trace that DevTools can load as first-class. (not falling back to isGenericTrace handling)
  • extract-cpu-profile-from-trace.mjs - Extract .cpuprofile from a trace. It'll create 1 or more .cpuprofiles next to the trace
  • process-traces.mjs - iterate over all traces found in a folder, run them through a trace processor to see what breaks.
  • trace-file-utils.mjs - loading, saving utilities.. matching whats in NPP & LH.

Notes

Trace synthesis

We have a BUNCH of code that synthesizes traces out of generic data so it can be viewed in about:tracing or DevTools.

Some of those implementations:

how to make a sweet combo trace that's viewable in devtools.md (2018, probably outdated)

revision numbers for CDT frontend appspot

See github.com/paulirish/trace.cafe/blob/9aee52…/src/app.js#L9-L19

Types