class Tracing

Defined at line 189 of file ../../third_party/perfetto/include/perfetto/tracing/tracing.h

The entry-point for using perfetto.

Public Methods

void Initialize (const TracingInitArgs & args)

Initializes Perfetto with the given backends in the calling process and/or

with a user-provided backend. It's possible to call this function more than

once to initialize different backends. If a backend was already initialized

the call will have no effect on it. All the members of `args` will be

ignored in subsequent calls, except those require to initialize new

backends (`backends`, `enable_system_consumer`, `shmem_size_hint_kb`,

`shmem_page_size_hint_kb` and `shmem_batch_commits_duration_ms`).

Defined at line 198 of file ../../third_party/perfetto/include/perfetto/tracing/tracing.h

bool IsInitialized ()

Checks if tracing has been initialized by calling |Initialize|.

std::unique_ptr<TracingSession> NewTrace (BackendType backend)

Start a new tracing session using the given tracing backend. Use

|kUnspecifiedBackend| to select an available backend automatically.

Defined at line 538 of file ../../third_party/perfetto/include/perfetto/tracing/tracing.h

void Shutdown ()

Shut down Perfetto, releasing any allocated OS resources (threads, files,

sockets, etc.). Note that Perfetto cannot be reinitialized again in the

same process[1]. Instead, this function is meant for shutting down all

Perfetto-related code so that it can be safely unloaded, e.g., with

dlclose().

It is only safe to call this function when all threads recording trace

events have been terminated or otherwise guaranteed to not make any further

calls into Perfetto.

[1] Unless static data is also cleared through other means.

void ResetForTesting ()

Uninitialize Perfetto. Only exposed for testing scenarios where it can be

guaranteed that no tracing sessions or other operations are happening when

this call is made.

std::unique_ptr<StartupTracingSession> SetupStartupTracing (const TraceConfig & config, SetupStartupTracingOpts )
std::unique_ptr<StartupTracingSession> SetupStartupTracingBlocking (const TraceConfig & config, SetupStartupTracingOpts )

Blocking version of above method, so callers can ensure that tracing is

active before proceeding with app startup. Calls into

DataSource::Trace() or trace macros right after this method are written

into the startup session.

void ActivateTriggers (const std::vector<std::string> & triggers, uint32_t ttl_ms)

Informs the tracing services to activate any of these triggers if any

tracing session was waiting for them.

Sends the trigger signal to all the initialized backends that are currently

connected and that connect in the next `ttl_ms` milliseconds (but

returns immediately anyway).

Records