The SDK includes built-in support for Chromium tracing, allowing you to capture detailed performance traces for debugging and optimization.
#include <livekit/livekit.h>
// Start tracing to a file
livekit::startTracing("trace.json");
// ... run your application ...
// Stop tracing and flush to file
livekit::stopTracing();You can optionally filter which categories to trace:
// Trace only specific categories (supports wildcards)
livekit::startTracing("trace.json", {"livekit.*", "webrtc.*"});Open the generated trace file in one of these viewers:
- Chrome: navigate to
chrome://tracingand click "Load" to open the trace file. - Perfetto: open ui.perfetto.dev and drag-drop your trace file.