fuchsia.tracing.controller

Added: NEXT

PROTOCOLS

Provisioner

Defined in fuchsia.tracing.controller/trace_controller.fidl

The provisioner interface used to initialize a trace Session, that can then be started and stopped.

The provisioner is required to start a trace Session and bind the control to the client. It can also perform tasks like getting the list of registered providers and known categories, which can be performed without a existing trace Session.

GetKnownCategories

Request

<EMPTY>

Response

NameType
payload Provisioner_GetKnownCategories_Result

GetProviders

Return the set of registered providers.

Request

<EMPTY>

Response

NameType
payload Provisioner_GetProviders_Result

InitializeTracing

Requests to initialize tracing with the specified config.

A bad request will terminate the connection.

Dropping the socket connection will abort and terminate the existing trace Session.

The trace controller emits trace data to output as a sequence of binary formatted trace records. Traces obtained from different providers are delimited by metadata records within the stream.

Request

NameType
controller server_end:Session
config TraceConfig
output handle<socket>

Session

Defined in fuchsia.tracing.controller/trace_controller.fidl

The session interface used by the trace tool to start/stop/terminate a trace Session.

The trace Session may lightly validate the structure of trace records as it copies them from trace buffers into the output. In particular, it may verify the size of each record header to ensure that the framing of trace records in the data stream is maintained.

The trace Session does not validate the contents of the trace records themselves. For example, it does not try to check argument lengths in events. This ensures that the trace format can be extended without needing to modify the trace Session.

The trace Session must be initialized from the provisioner. It can then be used to start/stop tracing as many times as needed. Dropping the Session will terminate tracing.

OnSessionStateChange

Event sent when the Session state changes.

Response

NameType
state SessionState

StartTracing

Requests to start tracing with the specified options.

If tracing has already started then the request is ignored, except to send back an error code.

The trace Session acknowledges the request when all registered providers have been started or after TraceConfig.start_timeout_milliseconds milliseconds. One useful reason for the has-started acknowledgement is that the trace program can start a program to trace knowing that all the providers are started.

Request

NameType
payload StartOptions

Response

NameType
payload Session_StartTracing_Result

StopTracing

Requests to stop tracing.

If tracing has already stopped then this does nothing. Returning a result lets callers know when it's ok to, for example, start tracing again.

Request

NameType
payload StopOptions

Response

NameType
payload Session_StopTracing_Result

WatchAlert

Returns the next alert when it arrives.

Alerts received by the Session are queued until a WatchAlert request is received. Alerts are sent to the caller in the order they were received.

WatchAlert requests are also queued until an alert is received and the requests are serviced in the order they were received.

Request

<EMPTY>

Response

NameType
payload Session_WatchAlert_Result

STRUCTS

Provisioner_GetKnownCategories_Response

Defined in fuchsia.tracing.controller/trace_controller.fidl

FieldTypeDescriptionDefault
categories vector<fuchsia.tracing/KnownCategory>:5000 No default

Provisioner_GetProviders_Response

Defined in fuchsia.tracing.controller/trace_controller.fidl

FieldTypeDescriptionDefault
providers vector<ProviderInfo>:100 No default

Session_StartTracing_Response

Defined in fuchsia.tracing.controller/trace_controller.fidl

<EMPTY>

Session_WatchAlert_Response

Defined in fuchsia.tracing.controller/trace_controller.fidl

FieldTypeDescriptionDefault
alert_name AlertName No default

ENUMS

SessionState flexible

Type: uint32

Defined in fuchsia.tracing.controller/trace_controller.fidl

The state of the tracing session. A "session" is everything between Initialize and Terminate.

NameValueDescription
1

The tracing system is ready for a new session. There can be only one session at a time.

2

A new tracing session has been initialized.

3

Tracing is in the midst of starting.

4

Tracing has started.

5

Tracing is in the midst of being stopped.

6

Tracing has fully stopped.

7

Tracing is in the midst of being terminated. Once the system has completely terminated the session it goes back to the READY state.

StartError flexible

Type: uint32

Defined in fuchsia.tracing.controller/trace_controller.fidl

Error codes from Start operations.

NameValueDescription
1

Tracing hasn't been initialized, not ready to start.

2

Tracing has already been started.

3

Tracing is currently being stopped.

4

Tracing is currently being terminated.

StopError flexible

Type: uint32

Defined in fuchsia.tracing.controller/trace_controller.fidl

Error codes from Stop operations.

NameValueDescription
1

Trace controller is unavailable. Nothing to stop.

2

Tracing has not started or is currently stoppped.

3

Tracing aborted due to error.

TABLES

FxtVersion

Defined in fuchsia.tracing.controller/trace_controller.fidl

Version of trace record format.

Default to the latest available version, which is currently 0.1.

More information about the format of trace records can be found here: https://fuchsia.dev/fuchsia-src/reference/tracing/trace-format

OrdinalFieldTypeDescription
major uint32

Defaults to 0.

minor uint32

Defaults to 1

ProviderInfo

Defined in fuchsia.tracing.controller/trace_controller.fidl

Result of GetProviders.

OrdinalFieldTypeDescription
id fuchsia.tracing/ProviderId

The provider's ID, assigned by trace-manager.

pid zx/Koid

The provider's pid.

name fuchsia.tracing/ProviderName

The name of the provider.

ProviderSpec

Defined in fuchsia.tracing.controller/trace_controller.fidl

OrdinalFieldTypeDescription
name fuchsia.tracing/ProviderName
buffer_size_megabytes_hint uint32
categories fuchsia.tracing/EnabledCategoryList

ProviderStats

Defined in fuchsia.tracing.controller/trace_controller.fidl

Statistics data per provider collected over the course of the tracing session

OrdinalFieldTypeDescription
name fuchsia.tracing/ProviderName
pid zx/Koid
buffering_mode fuchsia.tracing/BufferingMode
buffer_wrapped_count uint32
records_dropped uint64
percentage_durable_buffer_used float32
non_durable_bytes_written uint64

StartOptions

Defined in fuchsia.tracing.controller/trace_controller.fidl

Additional options to control trace data collection.

OrdinalFieldTypeDescription
buffer_disposition fuchsia.tracing/BufferDisposition

Whether and how to clear the buffer when starting data collection. This allows, for example, multiple Start/Stop trace runs to be collected in the same buffer.

If the preceding Stop() request had save_after_stopped=true then this value is overridden to CLEAR_ENTIRE_BUFFER to avoid duplicate data being saved.

additional_categories fuchsia.tracing/EnabledCategoryList

The trace categories to add to the initial set provided in TraceConfig. If the combined number of categories goes over the limit then the extra categories past the limit are discarded.

StopOptions

Defined in fuchsia.tracing.controller/trace_controller.fidl

Additional options to control stopping of a trace.

OrdinalFieldTypeDescription
write_results bool

If true then write all collected data after tracing has stopped. This is useful in situations where one wants to clear the buffer before starting the next trace, without having to first terminate the trace and start a new one.

StopResult

Defined in fuchsia.tracing.controller/trace_controller.fidl

Result of a terminate request.

OrdinalFieldTypeDescription
provider_stats vector<ProviderStats>:100

TraceConfig

Defined in fuchsia.tracing.controller/trace_controller.fidl

Provides options for the trace.

OrdinalFieldTypeDescription
categories fuchsia.tracing/EnabledCategoryList

The trace categories to record, or an empty array for all.

buffer_size_megabytes_hint uint32

Suggested size of trace buffer which each provider should receive.

start_timeout_milliseconds uint64

Acknowledge start request after at most start_timeout_milliseconds.

buffering_mode fuchsia.tracing/BufferingMode
provider_specs vector<ProviderSpec>:100

Overrides for particular providers.

version FxtVersion

Maximum trace format version supported byt the client. If not set, this defaults to the latest available trace format version.

UNIONS

Provisioner_GetKnownCategories_Result strict

Defined in fuchsia.tracing.controller/trace_controller.fidl

OrdinalVariantTypeDescription
response Provisioner_GetKnownCategories_Response
framework_err internal

Provisioner_GetProviders_Result strict

Defined in fuchsia.tracing.controller/trace_controller.fidl

OrdinalVariantTypeDescription
response Provisioner_GetProviders_Response
framework_err internal

Session_StartTracing_Result strict

Defined in fuchsia.tracing.controller/trace_controller.fidl

OrdinalVariantTypeDescription
response Session_StartTracing_Response
err StartError
framework_err internal

Session_StopTracing_Result strict

Defined in fuchsia.tracing.controller/trace_controller.fidl

OrdinalVariantTypeDescription
response StopResult
err StopError
framework_err internal

Session_WatchAlert_Result strict

Defined in fuchsia.tracing.controller/trace_controller.fidl

OrdinalVariantTypeDescription
response Session_WatchAlert_Response
framework_err internal

CONSTANTS

NameValueTypeDescription
MAX_ALERT_NAME_LENGTH 14 uint32

The maximum length of an alert name.

MAX_NUM_PROVIDERS 100 uint32

The maximum number of providers supported.

ALIASES

NameValueDescription
AlertName string[MAX_ALERT_NAME_LENGTH]

aliases