pub enum ControllerRequest {
InitializeTracing {
config: TraceConfig,
output: Socket,
control_handle: ControllerControlHandle,
},
TerminateTracing {
options: TerminateOptions,
responder: ControllerTerminateTracingResponder,
},
StartTracing {
options: StartOptions,
responder: ControllerStartTracingResponder,
},
StopTracing {
options: StopOptions,
responder: ControllerStopTracingResponder,
},
GetProviders {
responder: ControllerGetProvidersResponder,
},
GetKnownCategories {
responder: ControllerGetKnownCategoriesResponder,
},
WatchAlert {
responder: ControllerWatchAlertResponder,
},
_UnknownMethod {
ordinal: u64,
control_handle: ControllerControlHandle,
method_type: MethodType,
},
}
Expand description
The controller interface used by the trace tool to initialize/start/stop/terminate tracing.
The trace controller 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 controller 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 controller.
Variants§
InitializeTracing
Requests to initialize tracing with the specified config
.
A bad request will terminate the connection.
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.
TerminateTracing
Requests to terminate tracing.
If tracing has not yet stopped it is stopped first.
If options.write_results
is true, then the trace controller
continues to transfer any remaining data to the output socket
until finished, then closes the output.
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 controller 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.
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.
GetProviders
Return the set of registered providers.
Fields
responder: ControllerGetProvidersResponder
GetKnownCategories
Fields
responder: ControllerGetKnownCategoriesResponder
WatchAlert
Returns the next alert when it arrives.
Fields
responder: ControllerWatchAlertResponder
_UnknownMethod
An interaction was received which does not match any known method.
Fields
This variant is marked as non-exhaustive
control_handle: ControllerControlHandle
method_type: MethodType
Implementations§
source§impl ControllerRequest
impl ControllerRequest
pub fn into_initialize_tracing( self ) -> Option<(TraceConfig, Socket, ControllerControlHandle)>
pub fn into_terminate_tracing( self ) -> Option<(TerminateOptions, ControllerTerminateTracingResponder)>
pub fn into_start_tracing( self ) -> Option<(StartOptions, ControllerStartTracingResponder)>
pub fn into_stop_tracing( self ) -> Option<(StopOptions, ControllerStopTracingResponder)>
pub fn into_get_providers(self) -> Option<ControllerGetProvidersResponder>
pub fn into_get_known_categories( self ) -> Option<ControllerGetKnownCategoriesResponder>
pub fn into_watch_alert(self) -> Option<ControllerWatchAlertResponder>
sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL