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...
#include <tracer.h>
|
| | Tracer ()=default |
| virtual | ~Tracer ()=default |
| auto | makeScopedZone (const SourceLocation &location) |
| | Create a scoped zone. You can use scoped zones to trace the lifetime of a given block (the typical example is a function).
|
| auto | makeScopedZone (std::string_view name, const SourceLocation &location) |
| | Create a scoped zone with a given name.
|
| virtual void | frameStart (std::string_view name)=0 |
| | Marks the start of a (named) frame. Needs to be paired with a corresponding call to frameEnd.
|
| virtual void | frameEnd (std::string_view name)=0 |
| | Marks the end of a (named) frame. Needs to be paired with a corresponding call to frameStart.
|
| virtual void | message (std::string_view name)=0 |
| | Sends a message that will be traced.
|
| virtual void | plot (std::string_view name, float64_t value)=0 |
| | Sends a value that will be plotted.
|
| virtual void | plot (std::string_view name, int64_t value)=0 |
| | Sends a value that will be plotted.
|
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.
◆ Tracer()
| sen::kernel::Tracer::Tracer |
( |
| ) |
|
|
default |
◆ ~Tracer()
| virtual sen::kernel::Tracer::~Tracer |
( |
| ) |
|
|
virtualdefault |
◆ makeScopedZone() [1/2]
| auto sen::kernel::Tracer::makeScopedZone |
( |
const SourceLocation & | location | ) |
|
|
inlinenodiscard |
Create a scoped zone. You can use scoped zones to trace the lifetime of a given block (the typical example is a function).
- Parameters
-
example usage:
int myFunc()
{
static constexpr auto sl =
SEN_SL();
auto zone = tracer.makeScopedZone(sl);
}
#define SEN_SL()
Convenience macro including the source location info. NOLINTNEXTLINE(cppcoreguidelines-macro-usage).
Definition source_location.h:62
For a less verbose approach, you can use:
{
}
#define SEN_TRACE_ZONE(tracer)
Helper macro that creates a static source location and defines a scoped zone.
Definition tracer.h:149
◆ makeScopedZone() [2/2]
| auto sen::kernel::Tracer::makeScopedZone |
( |
std::string_view | name, |
|
|
const SourceLocation & | location ) |
|
inlinenodiscard |
Create a scoped zone with a given name.
- Parameters
-
| name | should not change for a given zone during the program execution. |
| location | use the SEN_SL macro. |
example usage:
{
static constexpr auto sl =
SEN_SL();
}
auto makeScopedZone(const SourceLocation &location)
Create a scoped zone. You can use scoped zones to trace the lifetime of a given block (the typical ex...
Definition tracer.h:162
For a less verbose approach, you can use:
{
}
#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
◆ frameStart()
| virtual void sen::kernel::Tracer::frameStart |
( |
std::string_view | name | ) |
|
|
pure virtual |
Marks the start of a (named) frame. Needs to be paired with a corresponding call to frameEnd.
- Parameters
-
| name | should not change for a given frame mark during the program execution. |
- Note
- Only supported by frame-oriented tracers.
◆ frameEnd()
| virtual void sen::kernel::Tracer::frameEnd |
( |
std::string_view | name | ) |
|
|
pure virtual |
Marks the end of a (named) frame. Needs to be paired with a corresponding call to frameStart.
- Parameters
-
| name | should not change for a given frame mark during the program execution. |
- Note
- Only supported by frame-oriented tracers.
◆ message()
| virtual void sen::kernel::Tracer::message |
( |
std::string_view | name | ) |
|
|
pure virtual |
Sends a message that will be traced.
- Parameters
-
| name | should not change for a given trace during the program execution. |
◆ plot() [1/2]
| virtual void sen::kernel::Tracer::plot |
( |
std::string_view | name, |
|
|
float64_t | value ) |
|
pure virtual |
Sends a value that will be plotted.
- Parameters
-
| name | should not change for a given plot during the program execution. |
| value | a value. |
- Note
- This function might not be available in all tracers.
◆ plot() [2/2]
| virtual void sen::kernel::Tracer::plot |
( |
std::string_view | name, |
|
|
int64_t | value ) |
|
pure virtual |
Sends a value that will be plotted.
- Parameters
-
| name | should not change for a given plot during the program execution. |
| value | a value. |
- Note
- This function might not be available in all tracers.
◆ zoneStart()
| virtual void sen::kernel::Tracer::zoneStart |
( |
std::string_view | name, |
|
|
const SourceLocation & | location ) |
|
protectedpure virtual |
◆ zoneEnd()
| virtual void sen::kernel::Tracer::zoneEnd |
( |
| ) |
|
|
protectedpure virtual |
The documentation for this class was generated from the following file: