LiveKit C++ Client SDK v1.1.0
Real-time audio/video/data SDK for C++
Loading...
Searching...
No Matches
Tracing

The SDK includes built-in support for Chromium tracing, allowing you to capture detailed performance traces for debugging and optimization.

Basic usage

#include <livekit/livekit.h>
// Start tracing to a file
livekit::startTracing("trace.json");
// ... run your application ...
// Stop tracing and flush to file
LIVEKIT_API void stopTracing()
Stop tracing and flush remaining events to file.
LIVEKIT_API bool startTracing(const std::string &trace_file_path, const std::vector< std::string > &categories={})
Start tracing and write events to a file.

Filtering by category

You can optionally filter which categories to trace:

// Trace only specific categories (supports wildcards)
livekit::startTracing("trace.json", {"livekit.*", "webrtc.*"});

Viewing traces

Open the generated trace file in one of these viewers:

  • Chrome: navigate to chrome://tracing and click "Load" to open the trace file.
  • Perfetto: open ui.perfetto.dev and drag-drop your trace file.