class TraceHandler

Defined at line 23 of file ../../zircon/system/ulib/trace-provider/include/lib/trace-provider/handler.h

Implements |trace_handler_t|.

Make sure the trace has fully stopped before destroying the handler object.

Public Methods

void TraceHandler ()

Defined at line 17 of file ../../zircon/system/ulib/trace-provider/handler.cc

void ~TraceHandler ()

Defined at line 19 of file ../../zircon/system/ulib/trace-provider/handler.cc

bool IsCategoryEnabled (const char * category)

Called by the trace engine to ask whether the specified category is enabled.

This method may be called frequently so it must be efficiently implemented.

Clients may cache the results while a trace is running; dynamic changes

to the enabled categories may go unnoticed until the next trace.

|category| is the name of the category.

Called by instrumentation on any thread. Must be thread-safe.

Defined at line 37 of file ../../zircon/system/ulib/trace-provider/include/lib/trace-provider/handler.h

void TraceStarted ()

Called by the trace engine to indicate it has completed startup.

Defined at line 40 of file ../../zircon/system/ulib/trace-provider/include/lib/trace-provider/handler.h

void TraceStopped (zx_status_t disposition)

Called by the trace engine when tracing has stopped.

The trace collection status is |ZX_OK| if trace collection was successful.

An error indicates that the trace data may be inaccurate or incomplete.

|disposition| is |ZX_OK| if tracing stopped normally, otherwise indicates

that tracing was aborted due to an error. If records were dropped (due

to the trace buffer being full) then |disposition| is |ZX_ERR_NO_MEMORY|.

Called on an asynchronous dispatch thread.

Defined at line 52 of file ../../zircon/system/ulib/trace-provider/include/lib/trace-provider/handler.h

void TraceTerminated ()

Called by the trace engine when tracing has terminated.

Defined at line 55 of file ../../zircon/system/ulib/trace-provider/include/lib/trace-provider/handler.h

void NotifyBufferFull (uint32_t wrapped_count, uint64_t durable_buffer_offset)

Called by the trace engine in streaming mode to indicate a buffer is full.

This is only used in streaming mode where double-buffering is used.

|wrapped_count| is the number of times writing to the buffer has

switched from one buffer to the other.

|durable_buffer_offset| is the offset into the durable buffer when the

buffer filled. It is provided so that TraceManager can save the data

thus far written to the durable buffer.

Defined at line 64 of file ../../zircon/system/ulib/trace-provider/include/lib/trace-provider/handler.h

void SendAlert (const char * alert_name)

Called by the trace engine to send an alert.

Defined at line 67 of file ../../zircon/system/ulib/trace-provider/include/lib/trace-provider/handler.h