class TraceSession
Defined at line 43 of file ../../src/performance/trace_manager/trace_session.h
TraceSession keeps track of all TraceProvider instances that
are active for a tracing session.
Public Methods
void TraceSession (async::Executor &executor,std::shared_ptr<BufferForwarder>destination,std::vector<std::string>categories,size_tbuffer_size_megabytes,fuchsia_tracing::BufferingModebuffering_mode,TraceProviderSpecMap &&provider_specs,zx::durationstart_timeout,zx::durationstop_timeout,fuchsia_tracing_controller::FxtVersionfxt_version,fit::closureabort_handler,AlertCallbackalert_callback)
Initializes a new session that streams results to |destination|.
Every provider active in this session is handed |categories| and a vmo of size
|buffer_size_megabytes| when started.
|abort_handler| is invoked whenever the session encounters
unrecoverable errors that render the session dead.
Defined at line 31 of file ../../src/performance/trace_manager/trace_session.cc
void ~TraceSession ()
Frees all allocated resources and closes the outgoing
connection.
Defined at line 52 of file ../../src/performance/trace_manager/trace_session.cc
State state ()
For testing.
Defined at line 91 of file ../../src/performance/trace_manager/trace_session.h
void set_write_results_on_terminate (bool flag)
Defined at line 93 of file ../../src/performance/trace_manager/trace_session.h
void WriteTraceInfo ()
Writes all applicable trace info records.
These records are like a pre-amble to the trace, in particular they
provide a record at the start of the trace that when written to a file
can be used to identify the file as a Fuchsia Trace File.
Defined at line 866 of file ../../src/performance/trace_manager/trace_session.cc
void AddProvider (TraceProviderBundle * provider)
Initializes |provider| and adds it to this session.
Defined at line 58 of file ../../src/performance/trace_manager/trace_session.cc
void AddProvider (ProviderConnection * provider)
Initializes a v2 |provider| and adds it to this session.
Defined at line 133 of file ../../src/performance/trace_manager/trace_session.cc
void MarkInitialized ()
Called after all registered providers have been added.
Defined at line 231 of file ../../src/performance/trace_manager/trace_session.cc
void Terminate (fit::closure callback)
Terminates the trace.
Stops tracing first if necessary (see |Stop()|).
If terminating providers takes longer than |stop_timeout_|, we forcefully
terminate tracing and invoke |callback|.
Defined at line 233 of file ../../src/performance/trace_manager/trace_session.cc
void Start (fuchsia_tracing::BufferDispositionbuffer_disposition,const std::vector<std::string> &additional_categories,StartTracingCallbackcallback)
Starts the trace.
Invokes |callback| when all providers in this session have
acknowledged the start request, or after |start_timeout_| has elapsed.
Defined at line 258 of file ../../src/performance/trace_manager/trace_session.cc
void Stop (bool write_results, StopTracingCallback callback)
Stops all providers that are part of this session, streams out
all remaining trace records and finally invokes |callback|.
If |write_results| is true then trace results are written after
providers stop (and a flag is set to clear buffer contents if tracing
starts again).
If stopping providers takes longer than |stop_timeout_|, we forcefully
stop tracing and invoke |callback|.
Defined at line 302 of file ../../src/performance/trace_manager/trace_session.cc
void RemoveDeadProvider (TraceProviderBundle * bundle)
Remove |provider|, it's dead Jim.
Defined at line 775 of file ../../src/performance/trace_manager/trace_session.cc
void RemoveDeadV2Provider (ProviderConnection * connection)
Defined at line 783 of file ../../src/performance/trace_manager/trace_session.cc
void FlushProviders ()
Defined at line 791 of file ../../src/performance/trace_manager/trace_session.cc
Enumerations
enum class State
| Name | Value | Comments |
|---|---|---|
| kReady | 0 |
The session is ready to be initialized. |
| kInitialized | 1 |
The session has been initialized. |
| kStarting | 2 |
The session is starting. |
| kStarted | 3 |
The session is started. |
| kStopping | 4 |
The session is being stopped right now. |
| kStopped | 5 |
The session is stopped. |
| kTerminating | 6 |
The session is terminating. |
Defined at line 45 of file ../../src/performance/trace_manager/trace_session.h
Friends
std::ostream & TraceSession (std::ostream & outTraceSession::State state)