Celeritas 0.7.0-dev.127+develop.e63889793
|
RAII wrapper for a tracing session. More...
#include <TracingSession.hh>
Classes | |
struct | Impl |
Public Member Functions | |
TracingSession () noexcept | |
Start a system tracing session. | |
TracingSession (std::string const &filename) noexcept | |
Start an in-process tracing session. | |
void | start () noexcept |
The session is now started on construction; this is now a null-op. | |
operator bool () const | |
Return whether profiling is enabled. | |
Static Public Member Functions | |
static void | flush () noexcept |
Flush profiling events associated with the calling thread. | |
RAII wrapper for a tracing session.
Constructors will only configure and initialize the session. 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 modes.
|
inlinestaticnoexcept |
Flush profiling events associated with the calling thread.
In multi-threaded applications, this should be called from each worker thread to ensure that their track events are correctly written.
This is used by the Geant4 interface class LocalTransporter
which may not have access to the session instance.