Sen API
Sen Libraries
Loading...
Searching...
No Matches
tracer.h File Reference
#include "sen/core/base/compiler_macros.h"
#include "sen/core/base/numbers.h"
#include "sen/core/base/scope_guard.h"
#include "sen/core/base/source_location.h"
#include <functional>
#include <memory>
#include <string_view>

Go to the source code of this file.

Classes

class  sen::kernel::Tracer
 Interface implemented by tracers. You can use it to trace the behavior of your code. Please note that not all tracers support the functions below. More...

Namespaces

namespace  sen
namespace  sen::kernel
 Strong type for the unique identifier for a transport timer.

Macros

#define SEN_TRACE_ZONE_NAMED(tracer, name)
 Helper macro that creates a static source location and defines a named scoped zone.
#define SEN_TRACE_ZONE(tracer)
 Helper macro that creates a static source location and defines a scoped zone.

Typedefs

using sen::kernel::TracerFactory = std::function<std::unique_ptr<Tracer>(std::string_view)>
 A factory function for tracers.

Functions

TracerFactory sen::kernel::getDefaultTracerFactory ()
 A function that returns a no-op tracer.

Macro Definition Documentation

◆ SEN_TRACE_ZONE_NAMED

#define SEN_TRACE_ZONE_NAMED ( tracer,
name )
Value:
static constexpr auto __senSourceLocation ## __LINE__ = SEN_SL(); auto __senScopedZone ## __LINE__ = (tracer).makeScopedZone(name, __senSourceLocation ## __LINE__)
#define SEN_SL()
Convenience macro including the source location info. NOLINTNEXTLINE(cppcoreguidelines-macro-usage).
Definition source_location.h:62

Helper macro that creates a static source location and defines a named scoped zone.

Example:

void myFunc(Tracer& tracer)
{
SEN_TRACE_ZONE_NAMED(tracer, "doing something");
}
#define SEN_TRACE_ZONE_NAMED(tracer, name)
Helper macro that creates a static source location and defines a named scoped zone.
Definition tracer.h:136

NOLINTNEXTLINE(cppcoreguidelines-macro-usage)

◆ SEN_TRACE_ZONE

#define SEN_TRACE_ZONE ( tracer)
Value:
static constexpr auto __senSourceLocation ## __LINE__ = SEN_SL(); auto __senScopedZone ## __LINE__ = (tracer).makeScopedZone(__senSourceLocation ## __LINE__)

Helper macro that creates a static source location and defines a scoped zone.

Example:

int myFunc(Tracer& tracer)
{
SEN_TRACE_ZONE(tracer);
}
#define SEN_TRACE_ZONE(tracer)
Helper macro that creates a static source location and defines a scoped zone.
Definition tracer.h:149

NOLINTNEXTLINE(cppcoreguidelines-macro-usage)