Celeritas 0.6.0-rc.2.10+develop.de0a3a05
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
celeritas::TracingSession Class Reference

RAII wrapper for a tracing session. More...

#include <TracingSession.hh>

Public Member Functions

 TracingSession () noexcept
 Start a system tracing session.
 
 TracingSession (std::string_view filename) noexcept
 Start an in-process tracing session.
 
 ~TracingSession ()
 Block until the current session is closed.
 
void start () noexcept
 Start the profiling session.
 
void flush () noexcept
 Flush track events associated with the calling thread for the profiling session.
 
 CELER_DELETE_COPY_MOVE (TracingSession)
 

Detailed Description

RAII wrapper for a tracing session.

Constructors will only configure and initialize the session. It needs to be started explicitly by calling TracingSession::start Only a single tracing mode is supported. If you are only interested in application-level events (ScopedProfiling and trace_counter), then the in-process mode is sufficient and is enabled by providing the trace data filename to the constructor. When using in-process tracing, the buffer size can be configured by setting CELER_PERFETTO_BUFFER_SIZE_MB.

If no filename is provided, start a system tracing session which records both application-level events and kernel events. Root privilege and Linux ftrace https://kernel.org/doc/Documentation/trace/ftrace.txt are required. To start the system daemons using the perfetto backend, see https://perfetto.dev/docs/quickstart/linux-tracing#capturing-a-trace

TODO: Support multiple tracing mode.

Member Function Documentation

◆ flush()

void celeritas::TracingSession::flush ( )
inlinenoexcept

Flush track events associated with the calling thread for the profiling session.

In multi-threaded applications, this should be called from each worker thread to ensure that their track events are correctly written.


The documentation for this class was generated from the following files: