|
ReXGlue SDK
|
#include <cstring>#include <optional>#include <string>#include <string_view>#include <rex/platform.h>#include <rex/result.h>#include <rex/types.h>#include <tracy/Tracy.hpp>Go to the source code of this file.
Classes | |
| class | rex::platform::Profiler |
Namespaces | |
| namespace | rex |
| namespace | rex::platform |
Macros | |
| #define | REX_PERF_APPLY(name, call) |
| #define | REX_PERF_SET(name, value) |
| #define | REX_PERF_INC(name) |
| #define | REX_PERF_ADD(name, delta) |
| #define | REX_PROFILE_SCOPE(name) |
| #define | REX_PROFILE_SCOPE_TEXT(name, detail) |
| #define | REX_PROFILE_THREAD(name) |
| #define | REX_PROFILE_FIBER_ENTER(name) |
| #define | REX_PROFILE_FIBER_LEAVE() |
| #define | REX_PROFILE_PLOT(name, value) |
| #define | REX_PROFILE_PLOT_F64(name, value) |
| #define | REX_PROFILE_ALLOC(ptr, size) |
| #define | REX_PROFILE_FREE(ptr) |
| #define | REX_PROFILE_ALLOC_NAMED(ptr, size, pool) |
| #define | REX_PROFILE_FREE_NAMED(ptr, pool) |
| #define | REX_PROFILE_ALLOC_STACK(ptr, size, depth) |
| #define | REX_PROFILE_FREE_STACK(ptr, depth) |
| #define | REX_PROFILE_ALLOC_NAMED_STACK(ptr, size, depth, pool) |
| #define | REX_PROFILE_FREE_NAMED_STACK(ptr, depth, pool) |
| #define | REX_PROFILE_SCOPE_DYNAMIC(name) |
| #define | REX_PROFILE_FRAME() |
| #define | REX_PROFILE_IS_CONNECTED() |
Enumerations | |
| enum class | rex::platform::CounterID : u8 { kFrameTimeUs , kFps } |
| enum class | rex::platform::CounterType : u8 { rex::platform::kAccumulator , rex::platform::kGauge } |
Functions | |
| Result< CounterID > | rex::platform::RegisterCounter (const char *name, CounterType type=CounterType::kAccumulator) |
| std::optional< CounterID > | rex::platform::FindCounter (std::string_view name) |
| const char * | rex::platform::GetCounterName (CounterID id) |
| void | rex::platform::SetCounter (CounterID id, i64 value) |
| void | rex::platform::IncrementCounter (CounterID id, i64 delta=1) |
| i64 | rex::platform::GetCounter (CounterID id) |
| void | rex::platform::ResetFrameCounters () |
| i64 | rex::platform::GetSnapshotCounter (CounterID id) |
| void | rex::platform::InitCounters () |
| void | rex::platform::SetCSVLogPath (const std::string &path) |
| void | rex::platform::WriteCSVFrame () |
| void | rex::platform::CloseCSV () |
Variables | |
| constexpr size_t | rex::platform::kMaxCounters = 64 |
| #define REX_PERF_ADD | ( | name, | |
| delta ) |
Adds a delta to a perf counter. Compiles to nothing when counters are disabled.
| name | The counter name in snake case, a string literal. |
| delta | The signed amount to add. |
| #define REX_PERF_APPLY | ( | name, | |
| call ) |
Looks the counter up once per call site, then applies an operation. Does nothing when the name is not registered.
| name | The snake case counter name, a string literal. |
| call | The operation, which sees the counter as rex_perf_id. |
| #define REX_PERF_INC | ( | name | ) |
Adds 1 to a perf counter. Compiles to nothing when counters are disabled.
| name | The counter name in snake case, a string literal. |
| #define REX_PERF_SET | ( | name, | |
| value ) |
Sets a perf counter to a value. Compiles to nothing when counters are disabled.
| name | The counter name in snake case, a string literal. |
| value | Evaluated only when the counter exists. |
| #define REX_PROFILE_ALLOC | ( | ptr, | |
| size ) |
Reports an allocation to the unnamed Tracy memory pool.
| size | The size in bytes, evaluated only while the profiler runs. |
| #define REX_PROFILE_ALLOC_NAMED | ( | ptr, | |
| size, | |||
| pool ) |
Reports an allocation to a named Tracy memory pool.
| size | The size in bytes, evaluated only while the profiler runs. |
| pool | The pool name, a string literal or another pointer that stays valid and has the same value for every call of the pool. |
| #define REX_PROFILE_ALLOC_NAMED_STACK | ( | ptr, | |
| size, | |||
| depth, | |||
| pool ) |
Reports an allocation to a named pool with a call stack.
| size | The size in bytes, evaluated only while the profiler runs. |
| depth | The number of stack frames to capture, 0 captures none. |
| pool | The pool name, as for REX_PROFILE_ALLOC_NAMED. |
| #define REX_PROFILE_ALLOC_STACK | ( | ptr, | |
| size, | |||
| depth ) |
Reports an allocation to the unnamed pool with a call stack.
| size | The size in bytes, evaluated only while the profiler runs. |
| depth | The number of stack frames to capture, 0 captures none. |
| #define REX_PROFILE_FIBER_ENTER | ( | name | ) |
Disabled fiber macros without TRACY_FIBERS. The enter form only type checks its name.
| name | The fiber name, never evaluated. |
| #define REX_PROFILE_FIBER_LEAVE | ( | ) |
Expands to nothing.
| #define REX_PROFILE_FRAME | ( | ) |
Marks the end of a frame on the main Tracy frame track.
| #define REX_PROFILE_FREE | ( | ptr | ) |
Reports a free to the unnamed Tracy memory pool.
| #define REX_PROFILE_FREE_NAMED | ( | ptr, | |
| pool ) |
Reports a free to a named Tracy memory pool.
| pool | The pool name given to REX_PROFILE_ALLOC_NAMED. |
| #define REX_PROFILE_FREE_NAMED_STACK | ( | ptr, | |
| depth, | |||
| pool ) |
Reports a free to a named pool with a call stack.
| depth | The number of stack frames to capture, 0 captures none. |
| pool | The pool name given to REX_PROFILE_ALLOC_NAMED_STACK. |
| #define REX_PROFILE_FREE_STACK | ( | ptr, | |
| depth ) |
Reports a free to the unnamed pool with a call stack.
| depth | The number of stack frames to capture, 0 captures none. |
| #define REX_PROFILE_IS_CONNECTED | ( | ) |
Reports whether a Tracy profiler is connected.
| #define REX_PROFILE_PLOT | ( | name, | |
| value ) |
Plots a value on a named Tracy graph.
| name | The plot name, a string literal. |
| value | The value, converted to a 64 bit integer. |
| #define REX_PROFILE_PLOT_F64 | ( | name, | |
| value ) |
Plots a floating point value on a named Tracy graph.
| name | The plot name, a string literal. |
| value | The value, converted to a 64 bit float. |
| #define REX_PROFILE_SCOPE | ( | name | ) |
Opens a Tracy CPU zone that lasts until the end of the enclosing scope.
| name | The zone name, a string literal. |
| #define REX_PROFILE_SCOPE_DYNAMIC | ( | name | ) |
Opens a Tracy CPU zone named at run time that lasts until the end of the enclosing scope.
| name | A std::string_view or std::string naming the zone, evaluated once. |
| #define REX_PROFILE_SCOPE_TEXT | ( | name, | |
| detail ) |
Opens a Tracy CPU zone with a text annotation that lasts until the end of the enclosing scope.
| name | The zone name, a string literal. |
| detail | A null terminated string attached to the zone. |
| #define REX_PROFILE_THREAD | ( | name | ) |
Names the calling thread in the profiler.
| name | A null terminated thread name. |