Yaets
Loading...
Searching...
No Matches
tracing.hpp File Reference
#include <chrono>
#include <string>
#include <mutex>
#include <queue>
#include <condition_variable>
#include <thread>
#include <atomic>
#include <unordered_map>
#include <memory>
Include dependency graph for tracing.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  NamedSharedTrace
 Class to manage shared traces across different parts of the code. More...
 
struct  TraceEvent
 Structure to represent a trace event. More...
 
class  TraceGuard
 Class to manage the trace of a single function execution. More...
 
class  TraceRegistry
 Singleton class to manage global NamedSharedTrace instances. More...
 
class  TraceSession
 Class to manage a trace session. More...
 

Namespaces

namespace  yaets
 

Macros

#define SHARED_TRACE_END(id)
 Macro to end a shared trace by its unique identifier.
 
#define SHARED_TRACE_INIT(session, id)
 Macro to initialize a shared trace with a unique identifier.
 
#define SHARED_TRACE_START(id)
 Macro to start a shared trace by its unique identifier.
 
#define TRACE_EVENT(session)
 Macro to create a TraceGuard object for function tracing.
 

Macro Definition Documentation

◆ SHARED_TRACE_END

#define SHARED_TRACE_END ( id)
Value:
void endTrace(const std::string &id)
End a trace identified by a unique ID.
Definition tracing.cpp:182
static TraceRegistry & getInstance()
Retrieve the singleton instance of the TraceRegistry.
Definition tracing.hpp:283

Macro to end a shared trace by its unique identifier.

This macro ends the NamedSharedTrace instance associated with the provided trace identifier.

Parameters
idThe unique identifier for the trace.

◆ SHARED_TRACE_INIT

#define SHARED_TRACE_INIT ( session,
id )
Value:
void registerTrace(const std::string &id, TraceSession &session)
Register a new NamedSharedTrace with a unique identifier.
Definition tracing.cpp:166

Macro to initialize a shared trace with a unique identifier.

This macro registers a new NamedSharedTrace instance with the global TraceRegistry, associated with the provided TraceSession.

Parameters
sessionThe TraceSession to associate with the trace.
idThe unique identifier for the trace.

◆ SHARED_TRACE_START

#define SHARED_TRACE_START ( id)
Value:
void startTrace(const std::string &id)
Start a trace identified by a unique ID.
Definition tracing.cpp:173

Macro to start a shared trace by its unique identifier.

This macro starts the NamedSharedTrace instance associated with the provided trace identifier.

Parameters
idThe unique identifier for the trace.

◆ TRACE_EVENT

#define TRACE_EVENT ( session)
Value:
yaets::TraceGuard trace_guard(session, __FUNCTION__)
Class to manage the trace of a single function execution.
Definition tracing.hpp:163

Macro to create a TraceGuard object for function tracing.

This macro creates a TraceGuard object at the start of the function to automatically trace its execution using the provided TraceSession. The name of the function is automatically captured.