<br />

Added: 26

## **PROTOCOLS**

## Provisioner

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=162)*

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.

<br />

### GetKnownCategories

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#Provisioner_GetKnownCategories_Result` |

### GetProviders

Return the set of registered providers.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#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

| Name | Type |
|---|---|
| `controller` | `server_end:https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#Session` |
| `config` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#TraceConfig` |
| `output` | `handle<socket>` |

## Session

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=255)*

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.

<br />

### FlushBuffers

Requests to flush of all tracing buffers into the provided socket.

Normally streaming mode only sends data once it has enough data to
require a buffer swap and data flush. This produces fewer, but larger
and bursty data transfers.

Some clients may want more regular smaller data transfers. These clients
may instead manually invoke FlushBuffers whenever they are ready for
data.
Added: 31

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#Session_FlushBuffers_Result` |

### OnSessionStateChange

Event sent when the Session state changes.

#### Response

| Name | Type |
|---|---|
| `state` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#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

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#StartOptions` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#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

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#StopOptions` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#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

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#Session_WatchAlert_Result` |

## SessionManager

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=192)*
Added: 29

<br />

### AbortTraceSession

Aborts an ongoing trace session without saving results.
Added: 31

#### Request

| Name | Type |
|---|---|
| `task_id` | `uint64` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#SessionManager_AbortTraceSession_Result` |

### EndTraceSession

Ends the trace session.
If task_id is non-zero, then only the trace task with the given id is checked.
Note: Currently there is only 1 trace task active at a time, so the task_id is of
little value at this time.

#### Request

| Name | Type |
|---|---|
| `task_id` | `uint64` |
| `output` | `handle<socket>` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#SessionManager_EndTraceSession_Result` |

### GetKnownCategories

Gets the known categories.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#SessionManager_GetKnownCategories_Result` |

### GetProviders

Return the set of registered providers.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#SessionManager_GetProviders_Result` |

### StartTraceSession

Starts a Trace session.

#### Request

| Name | Type |
|---|---|
| `config` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#TraceConfig` |
| `options` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#TraceOptions` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#SessionManager_StartTraceSession_Result` |

### StartTraceSessionOnBoot

Configure a Trace session to start when the component starts.

#### Request

| Name | Type |
|---|---|
| `config` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#TraceConfig` |
| `options` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#TraceOptions` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#SessionManager_StartTraceSessionOnBoot_Result` |

### Status

Returns the status of the current trace session.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#SessionManager_Status_Result` |

## **STRUCTS**

### Provisioner_GetKnownCategories_Response

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=185)*

| Field | Type | Description | Default |
|---|---|---|---|
| `categories` | `vector<https://fuchsia.dev/reference/fuchsia.tracing//https://fuchsia.dev/reference/fuchsia.tracing#KnownCategory>:5000` |   | No default |

### Provisioner_GetProviders_Response

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=180)*

| Field | Type | Description | Default |
|---|---|---|---|
| `providers` | `vector<https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#ProviderInfo>:100` |   | No default |

### SessionManager_AbortTraceSession_Response

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=234)*

\<EMPTY\>

### SessionManager_EndTraceSession_Response

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=225)*

| Field | Type | Description | Default |
|---|---|---|---|
| `options` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#TraceOptions` |   | No default |
| `result` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#StopResult` |   | No default |

### SessionManager_GetKnownCategories_Response

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=200)*

| Field | Type | Description | Default |
|---|---|---|---|
| `categories` | `vector<https://fuchsia.dev/reference/fuchsia.tracing//https://fuchsia.dev/reference/fuchsia.tracing#KnownCategory>:5000` |   | No default |

### SessionManager_GetProviders_Response

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=195)*

| Field | Type | Description | Default |
|---|---|---|---|
| `providers` | `vector<https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#ProviderInfo>:100` |   | No default |

### SessionManager_StartTraceSessionOnBoot_Response

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=216)*

\<EMPTY\>

### SessionManager_StartTraceSession_Response

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=208)*

| Field | Type | Description | Default |
|---|---|---|---|
| `task_id` | `uint64` |   | No default |

### Session_FlushBuffers_Response

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=303)*

\<EMPTY\>

### Session_StartTracing_Response

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=267)*

\<EMPTY\>

### Session_WatchAlert_Response

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=284)*

| Field | Type | Description | Default |
|---|---|---|---|
| `alert_name` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#AlertName` |   | No default |

## **ENUMS**

### Action [flexible](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint32`

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=56)*

An action to be preformed on this trace. Used as part of a Trigger.
Added: 29

<br />

| Name | Value | Description |
|---|---|---|
| ### TERMINATE | `1` | Terminates the active trace. |

### CompressionType [flexible](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint32`

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=101)*

The compression algorithm to use for the trace data.
Added: HEAD

<br />

| Name | Value | Description |
|---|---|---|
| ### NONE | `0` | No compression. |
| ### ZSTD | `1` | Zstd compression. |

### FlushError [flexible](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint32`

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=394)*

Error codes from Flush operations.
Added: 31

<br />

| Name | Value | Description |
|---|---|---|
| ### NOT_INITIALIZED | `1` | Trace controller is unavailable. Nothing to flush. |
| ### NOT_STARTED | `2` | Tracing has not started or is currently stoppped. |
| ### ABORTED | `3` | Tracing aborted due to error. |

### RecordingError [flexible](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint32`

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=22)*

This covers errors from using the `Tracing` protocol (specifically
trace recording errors).
Added: 29

<br />

| Name | Value | Description |
|---|---|---|
| ### TARGET_PROXY_OPEN | `0` | Error encountered when opening the proxy to the target. |
| ### RECORDING_START | `1` | This is a general error when starting a trace. |
| ### RECORDING_ALREADY_STARTED | `2` | An error encountered if a trace recording has already been started for a given Fuchsia target. |
| ### RECORDING_STOP | `3` | An error encountered when attempting to stop a trace. This causes an immediate termination of the client channel, so the user should not attempt to run `StopRecording` again. |
| ### DUPLICATE_TRACE_FILE | `4` | Error for when a trace file is already being written to by the tracing service. |
| ### NO_SUCH_TRACE_FILE | `5` | When attempting to stop a trace, there were no active traces found for the given lookup name. |
| ### NO_SUCH_TARGET | `6` | No targets were found matching the query. |
| ### DISCONNECTED_TARGET | `7` | The query matched a target that is not connected to the Daemon's FIDL channels. |

### SessionState [flexible](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint32`

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=134)*

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

<br />

| Name | Value | Description |
|---|---|---|
| ### READY | `1` | The tracing system is ready for a new session. There can be only one session at a time. |
| ### INITIALIZED | `2` | A new tracing session has been initialized. |
| ### STARTING | `3` | Tracing is in the midst of starting. |
| ### STARTED | `4` | Tracing has started. |
| ### STOPPING | `5` | Tracing is in the midst of being stopped. |
| ### STOPPED | `6` | Tracing has fully stopped. |
| ### TERMINATING | `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](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint32`

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=371)*

Error codes from Start operations.

<br />

| Name | Value | Description |
|---|---|---|
| ### NOT_INITIALIZED | `1` | Tracing hasn't been initialized, not ready to start. |
| ### ALREADY_STARTED | `2` | Tracing has already been started. |
| ### STOPPING | `3` | Tracing is currently being stopped. |
| ### TERMINATING | `4` | Tracing is currently being terminated. |

### StopError [flexible](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint32`

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=383)*

Error codes from Stop operations.

<br />

| Name | Value | Description |
|---|---|---|
| ### NOT_INITIALIZED | `1` | Trace controller is unavailable. Nothing to stop. |
| ### NOT_STARTED | `2` | Tracing has not started or is currently stoppped. |
| ### ABORTED | `3` | Tracing aborted due to error. |

## **TABLES**

### FxtVersion

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=447)*

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

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `major` | `uint32` | Defaults to 0. |
| ### 2 | `minor` | `uint32` | Defaults to 1 |

### ProviderInfo

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=430)*

Result of `GetProviders`.

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `id` | `https://fuchsia.dev/reference/fuchsia.tracing//https://fuchsia.dev/reference/fuchsia.tracing#ProviderId` | The provider's ID, assigned by trace-manager. |
| ### 2 | `pid` | `https://fuchsia.dev/reference/zx//https://fuchsia.dev/reference/zx#Koid` | The provider's pid. |
| ### 3 | `name` | `https://fuchsia.dev/reference/fuchsia.tracing//https://fuchsia.dev/reference/fuchsia.tracing#ProviderName` | The name of the provider. |

### ProviderSpec

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=307)*

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `name` | `https://fuchsia.dev/reference/fuchsia.tracing//https://fuchsia.dev/reference/fuchsia.tracing#ProviderName` |   |
| ### 2 | `buffer_size_megabytes_hint` | `uint32` |   |
| ### 3 | `categories` | `https://fuchsia.dev/reference/fuchsia.tracing//https://fuchsia.dev/reference/fuchsia.tracing#EnabledCategoryList` |   |

### ProviderStats

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=355)*

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

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `name` | `https://fuchsia.dev/reference/fuchsia.tracing//https://fuchsia.dev/reference/fuchsia.tracing#ProviderName` |   |
| ### 2 | `pid` | `https://fuchsia.dev/reference/zx//https://fuchsia.dev/reference/zx#Koid` |   |
| ### 3 | `buffering_mode` | `https://fuchsia.dev/reference/fuchsia.tracing//https://fuchsia.dev/reference/fuchsia.tracing#BufferingMode` |   |
| ### 4 | `buffer_wrapped_count` | `uint32` |   |
| ### 5 | `records_dropped` | `uint64` |   |
| ### 6 | `percentage_durable_buffer_used` | `float32` |   |
| ### 7 | `non_durable_bytes_written` | `uint64` |   |

### StartOptions

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=404)*

Additional options to control trace data collection.

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `buffer_disposition` | `https://fuchsia.dev/reference/fuchsia.tracing//https://fuchsia.dev/reference/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. |
| ### 2 | `additional_categories` | `https://fuchsia.dev/reference/fuchsia.tracing//https://fuchsia.dev/reference/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](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=421)*

Additional options to control stopping of a trace.

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `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](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=366)*

Result of a terminate request.

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `provider_stats` | `vector<https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#ProviderStats>:100` |   |

### TraceConfig

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=314)*

Provides options for the trace.

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `categories` | `https://fuchsia.dev/reference/fuchsia.tracing//https://fuchsia.dev/reference/fuchsia.tracing#EnabledCategoryList` | The trace categories to record. Prefix wildcards, such as 'kernel:\*' and '\*' are supported. |
| ### 2 | `buffer_size_megabytes_hint` | `uint32` | Suggested size of trace buffer which each provider should receive. |
| ### 3 | `start_timeout_milliseconds` | `uint64` | Acknowledge start request after at most `start_timeout_milliseconds`. |
| ### 4 | `buffering_mode` | `https://fuchsia.dev/reference/fuchsia.tracing//https://fuchsia.dev/reference/fuchsia.tracing#BufferingMode` |   |
| ### 5 | `provider_specs` | `vector<https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#ProviderSpec>:100` | Overrides for particular providers. |
| ### 6 | `version` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#FxtVersion` | Maximum trace format version supported byt the client. If not set, this defaults to the latest available trace format version. |
| ### 7 | `defer_transfer` | `bool` | When true, the session will buffer the trace within the fuchsia.tracing.controller server and only send the trace over the output socket to the client once the trace completes. It is recommended that defering the trace transfer be set to true when using streaming mode and the fuchsia.tracing.controller client is across the host-device boundary, such as with ffx. In this, or other cases where sending the trace data could cause exess cpu overhead, the disk writing cost is preferrable to the cost of sending to the client. NOTE: defer_transfer only has effect during BufferingMode.STREAMING as other modes don't otherwise send trace data to the client during a trace. Added: 28 |

### TraceOptions

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=75)*

Covers how a trace will be run when invoking `StartRecording`.
Added: 29

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `duration_ns` | `https://fuchsia.dev/reference/zx//https://fuchsia.dev/reference/zx#Duration` | Determines how long a trace recording will run before terminating in nanoseconds. This is an "at-least" duration, with the actual runtime terminating likely a few dozen milliseconds longer. If this is not set, a trace will run indefinitely and must be stopped using `StopRecording`. |
| ### 2 | `triggers` | `vector<https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#Trigger>` | The triggers to run against this trace. |
| ### 3 | `requested_categories` | `https://fuchsia.dev/reference/fuchsia.tracing//https://fuchsia.dev/reference/fuchsia.tracing#EnabledCategoryList` | The requested categories for the trace. These could include groups, or nothing. These categories are expanded and the expanded list is in the TraceConfig. This list is used to support the nice UX of explicitly checking for events with these categories and warn the user if the no events were captured for any of these categories. |
| ### 4 | `compression` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#CompressionType` | The compression algorithm to use for the trace data. Added: HEAD |

### TraceStatus

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=110)*

Status of the trace session managed by SessionManager
Added: 29

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 3 | `duration` | `https://fuchsia.dev/reference/zx//https://fuchsia.dev/reference/zx#Duration` | The total duration of the command in fractional seconds. This will not be set if the command is supposed to run indefinitely. |
| ### 4 | `remaining_runtime` | `https://fuchsia.dev/reference/zx//https://fuchsia.dev/reference/zx#Duration` | The amount of time remaining before the trace terminates. This will not be set if the command is supposed to run indefinitely. |
| ### 5 | `config` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#TraceConfig` | The original config sent to the `StartRecording` command. |
| ### 6 | `triggers` | `vector<https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#Trigger>` | A list of triggers active for this trace. See \[Trigger\] for more info. |
| ### 7 | `task_id` | `uint64` | unique id of this trace session. |

### Trigger

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=64)*

A trigger is an action that is done when a certain alert has been raised in the
fuchsia tracing system.
Added: 29

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `alert` | `string:14` | The name of the alert being watched. See fuchsia.tracing.controller.Controller.WatchAlert for more info. |
| ### 2 | `action` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#Action` | The action to run when this alert has been witnessed. |

## **UNIONS**

### Provisioner_GetKnownCategories_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=185)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#Provisioner_GetKnownCategories_Response` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### Provisioner_GetProviders_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=180)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#Provisioner_GetProviders_Response` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### SessionManager_AbortTraceSession_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=234)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#SessionManager_AbortTraceSession_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#RecordingError` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### SessionManager_EndTraceSession_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=225)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#SessionManager_EndTraceSession_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#RecordingError` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### SessionManager_GetKnownCategories_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=200)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#SessionManager_GetKnownCategories_Response` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### SessionManager_GetProviders_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=195)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#SessionManager_GetProviders_Response` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### SessionManager_StartTraceSessionOnBoot_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=216)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#SessionManager_StartTraceSessionOnBoot_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#RecordingError` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### SessionManager_StartTraceSession_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=208)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#SessionManager_StartTraceSession_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#RecordingError` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### SessionManager_Status_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=237)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#TraceStatus` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#RecordingError` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### Session_FlushBuffers_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=303)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#Session_FlushBuffers_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#FlushError` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### Session_StartTracing_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=267)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#Session_StartTracing_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#StartError` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### Session_StopTracing_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=274)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#StopResult` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#StopError` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

### Session_WatchAlert_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.tracing.controller/trace_controller.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=284)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#Session_WatchAlert_Response` |   |
| ### 3 | `framework_err` | `internal` |   |

<br />

## **CONSTANTS**

| Name | Value | Type | Description |
|---|---|---|---|
| [MAX_ALERT_NAME_LENGTH](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=14) | `14` | `uint32` | The maximum length of an alert name. |
| [MAX_NUM_PROVIDERS](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=11) | `100` | `uint32` | The maximum number of providers supported. |

## **ALIASES**

| Name | Value | Description |
|---|---|---|
| [AlertName](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.tracing.controller/trace_controller.fidl;l=17) | `string`\[`https://fuchsia.dev/reference/fidl/fuchsia.tracing.controller#MAX_ALERT_NAME_LENGTH`\] | aliases |