Helios Engine
A modular ECS based data-oriented C++23 game engine framework
Loading...
Searching...
No Matches
helios::profile Namespace Reference

Namespaces

namespace  anonymous_namespace{flamegraph.cpp}
namespace  anonymous_namespace{profiler.cpp}
namespace  anonymous_namespace{tracy.cpp}
namespace  anonymous_namespace{zone.cpp}
namespace  details

Classes

class  Backend
 Abstract profiler backend interface. More...
class  FlamegraphBackend
 Profiling backend that emits a Chrome Tracing JSON file. More...
struct  FlamegraphBackendConfig
 Configuration for the FlamegraphBackend. More...
class  Profiler
 Global profiler registry and multi-backend fan-out dispatcher. More...
class  ScopedZone
 RAII scope zone that delegates to the active profiling backends. More...
class  TracyBackend
 Tracy profiler backend adapter. More...
struct  ZoneSpec
 Immutable zone description for a single instrumentation site. More...

Concepts

concept  ProfilerBackendTrait
 Trait to identify concrete profiler backend types.

Typedefs

using BackendTypeId = utils::TypeId
 Type alias for profiler backend type IDs.
using BackendTypeIndex = utils::TypeIndex
 Type alias for profiler backend type indices.

Enumerations

enum class  PlotFormat : uint8_t { kNumber , kMemory , kPercentage , kWatts }
 Plot value format for timeline plots. More...

Functions

void FrameMark () noexcept
 Marks the end of the current frame on all active backends.
void FrameMarkNamed (CStringView name) noexcept
 Marks the end of a named frame.
void FrameMarkStart (CStringView name) noexcept
 Marks the start of a named frame region.
void FrameMarkEnd (CStringView name) noexcept
 Marks the end of a named frame region.
void Alloc (const void *ptr, size_t size, std::optional< CStringView > name, int depth, std::source_location loc=std::source_location::current()) noexcept
 Profile an allocation of memory.
void Free (const void *ptr, std::optional< CStringView > name, int depth, std::source_location loc=std::source_location::current()) noexcept
 Profile a deallocation of memory.
void MemoryDiscard (CStringView name) noexcept
 Profile memory discard.
void MemoryDiscardS (CStringView name, int depth) noexcept
 Profile memory discard with depth.
void Message (std::string_view text, uint32_t color=0) noexcept
 Emits a timeline message on all active backends.
void SetThreadName (CStringView name) noexcept
 Sets the name of the current thread on all active backends.
void Plot (CStringView name, double value) noexcept
 Records a plot sample on all active backends.
void PlotConfig (CStringView name, PlotFormat type, bool step, bool fill, uint32_t color) noexcept
 Configures a plot channel on all active backends.

Variables

constexpr size_t kZoneStorageBytes = HELIOS_PROFILE_ZONE_STORAGE_BYTES

Typedef Documentation

◆ BackendTypeId

Type alias for profiler backend type IDs.

Definition at line 180 of file backend.hpp.

◆ BackendTypeIndex

Type alias for profiler backend type indices.

Definition at line 183 of file backend.hpp.

Enumeration Type Documentation

◆ PlotFormat

enum class helios::profile::PlotFormat : uint8_t
strong

Plot value format for timeline plots.

Enumerator
kNumber 
kMemory 
kPercentage 
kWatts 

Definition at line 10 of file common.hpp.

Function Documentation

◆ Alloc()

void helios::profile::Alloc ( const void * ptr,
size_t size,
std::optional< CStringView > name,
int depth,
std::source_location loc = std::source_location::current() )
inlinenoexcept

Profile an allocation of memory.

Parameters
ptrThe pointer to the allocated memory
sizeThe size of the allocated memory
nameThe name of the allocation, used for grouping in the profiler
depthThe depth of the allocation, used for grouping in the profiler
locThe source location of the allocation, used for grouping in the profiler

Definition at line 20 of file memory.hpp.

◆ FrameMark()

void helios::profile::FrameMark ( )
inlinenoexcept

Marks the end of the current frame on all active backends.

Definition at line 9 of file frame.hpp.

◆ FrameMarkEnd()

void helios::profile::FrameMarkEnd ( CStringView name)
inlinenoexcept

Marks the end of a named frame region.

Parameters
nameThe name of the frame region to mark

Definition at line 33 of file frame.hpp.

◆ FrameMarkNamed()

void helios::profile::FrameMarkNamed ( CStringView name)
inlinenoexcept

Marks the end of a named frame.

Parameters
nameThe name of the frame to mark

Definition at line 17 of file frame.hpp.

◆ FrameMarkStart()

void helios::profile::FrameMarkStart ( CStringView name)
inlinenoexcept

Marks the start of a named frame region.

Parameters
nameThe name of the frame region to mark

Definition at line 25 of file frame.hpp.

◆ Free()

void helios::profile::Free ( const void * ptr,
std::optional< CStringView > name,
int depth,
std::source_location loc = std::source_location::current() )
inlinenoexcept

Profile a deallocation of memory.

Parameters
ptrThe pointer to the deallocated memory
nameThe name of the deallocation, used for grouping in the profiler
depthThe depth of the deallocation, used for grouping in the profiler
locThe source location of the deallocation, used for grouping in the profiler

Definition at line 34 of file memory.hpp.

◆ MemoryDiscard()

void helios::profile::MemoryDiscard ( CStringView name)
inlinenoexcept

Profile memory discard.

Parameters
nameThe name of the memory discard, used for grouping in the profiler

Definition at line 44 of file memory.hpp.

◆ MemoryDiscardS()

void helios::profile::MemoryDiscardS ( CStringView name,
int depth )
inlinenoexcept

Profile memory discard with depth.

Parameters
nameThe name of the memory discard, used for grouping in the profiler
depthThe depth of the memory discard, used for grouping in the profiler

Definition at line 54 of file memory.hpp.

◆ Message()

void helios::profile::Message ( std::string_view text,
uint32_t color = 0 )
inlinenoexcept

Emits a timeline message on all active backends.

Parameters
textThe message text to emit
colorAn optional color to associate with the message (default: 0)

Definition at line 16 of file message.hpp.

◆ Plot()

void helios::profile::Plot ( CStringView name,
double value )
inlinenoexcept

Records a plot sample on all active backends.

Parameters
nameThe name of the plot channel
valueThe value to record

Definition at line 15 of file plot.hpp.

◆ PlotConfig()

void helios::profile::PlotConfig ( CStringView name,
PlotFormat type,
bool step,
bool fill,
uint32_t color )
inlinenoexcept

Configures a plot channel on all active backends.

Parameters
nameThe name of the plot channel
typeThe format of the plot channel
stepWhether the plot should be step-wise
fillWhether the plot should be filled
colorThe color to associate with the plot channel

Definition at line 27 of file plot.hpp.

◆ SetThreadName()

void helios::profile::SetThreadName ( CStringView name)
inlinenoexcept

Sets the name of the current thread on all active backends.

Parameters
nameThe name to set for the current thread

Definition at line 24 of file message.hpp.

Variable Documentation

◆ kZoneStorageBytes

size_t helios::profile::kZoneStorageBytes = HELIOS_PROFILE_ZONE_STORAGE_BYTES
inlineconstexpr

Definition at line 12 of file config.hpp.