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

Tracy profiler backend adapter. More...

#include <tracy.hpp>

Inheritance diagram for helios::profile::TracyBackend:
helios::profile::Backend

Public Member Functions

size_t ZoneStorageSize () const noexcept override
 Returns the per-zone storage required by this backend.
void BeginZone (const ZoneSpec &spec, std::span< std::byte > storage) noexcept override
 Begins a profiling zone.
void EndZone (std::span< std::byte > storage) noexcept override
 Ends a profiling zone.
void ZoneText (std::span< std::byte > storage, std::string_view text) noexcept override
 Attaches text to the active zone.
void ZoneValue (std::span< std::byte > storage, uint64_t value) noexcept override
 Attaches a numeric value to the active zone.
void ZoneName (std::span< std::byte > storage, std::string_view name) noexcept override
 Renames the active zone.
void FrameMark () noexcept override
 Marks the end of the current frame.
void FrameMark (CStringView name) noexcept override
 Marks the end of a named frame.
void FrameMarkStart (CStringView name) noexcept override
 Marks the start of a named frame region.
void FrameMarkEnd (CStringView name) noexcept override
 Marks the end of a named frame region.
void Message (std::string_view text, uint32_t color) noexcept override
 Emits a timeline message.
void SetThreadName (CStringView name) noexcept override
 Sets the current thread name.
void Plot (CStringView name, double value) noexcept override
 Records a plot sample.
void PlotConfig (CStringView name, PlotFormat type, bool step, bool fill, uint32_t color) noexcept override
 Configures a plot channel.
void Alloc (const void *ptr, size_t size, std::optional< CStringView > name, int depth, std::source_location loc) noexcept override
 Records a memory allocation.
void Free (const void *ptr, std::optional< CStringView > name, int depth, std::source_location loc) noexcept override
 Records a memory deallocation.
void MemoryDiscard (CStringView name) noexcept override
 Discards tracked memory for a named pool.
void MemoryDiscard (CStringView name, int depth) noexcept override
 Discards tracked memory for a named pool with callstack depth.
std::string_view Name () const noexcept override
 Returns the backend name.
Public Member Functions inherited from helios::profile::Backend
virtual ~Backend () noexcept=default
virtual void Startup () noexcept
 Called once after finalization (single-threaded).
virtual void Shutdown () noexcept
 Called during shutdown (single-threaded).

Detailed Description

Tracy profiler backend adapter.

Definition at line 17 of file tracy.hpp.

Member Function Documentation

◆ Alloc()

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

Records a memory allocation.

Parameters
ptrAllocated pointer
sizeAllocation size
nameOptional allocation pool name
depthCallstack depth
locSource location

Implements helios::profile::Backend.

Definition at line 132 of file tracy.cpp.

◆ BeginZone()

void helios::profile::TracyBackend::BeginZone ( const ZoneSpec & spec,
std::span< std::byte > storage )
overridevirtualnoexcept

Begins a profiling zone.

Parameters
specZone specification
storageBackend-specific storage slice

Implements helios::profile::Backend.

Definition at line 58 of file tracy.cpp.

◆ EndZone()

void helios::profile::TracyBackend::EndZone ( std::span< std::byte > storage)
overridevirtualnoexcept

Ends a profiling zone.

Parameters
storageBackend-specific storage slice

Implements helios::profile::Backend.

Definition at line 72 of file tracy.cpp.

◆ FrameMark() [1/2]

void helios::profile::TracyBackend::FrameMark ( )
overridevirtualnoexcept

Marks the end of the current frame.

Implements helios::profile::Backend.

Definition at line 91 of file tracy.cpp.

◆ FrameMark() [2/2]

void helios::profile::TracyBackend::FrameMark ( CStringView name)
overridevirtualnoexcept

Marks the end of a named frame.

Parameters
nameFrame name

Implements helios::profile::Backend.

Definition at line 95 of file tracy.cpp.

◆ FrameMarkEnd()

void helios::profile::TracyBackend::FrameMarkEnd ( CStringView name)
overridevirtualnoexcept

Marks the end of a named frame region.

Parameters
nameFrame region name

Implements helios::profile::Backend.

Definition at line 104 of file tracy.cpp.

◆ FrameMarkStart()

void helios::profile::TracyBackend::FrameMarkStart ( CStringView name)
overridevirtualnoexcept

Marks the start of a named frame region.

Parameters
nameFrame region name

Implements helios::profile::Backend.

Definition at line 99 of file tracy.cpp.

◆ Free()

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

Records a memory deallocation.

Parameters
ptrDeallocated pointer
nameOptional allocation pool name
depthCallstack depth
locSource location

Implements helios::profile::Backend.

Definition at line 154 of file tracy.cpp.

◆ MemoryDiscard() [1/2]

void helios::profile::TracyBackend::MemoryDiscard ( CStringView name)
overridevirtualnoexcept

Discards tracked memory for a named pool.

Parameters
namePool name

Implements helios::profile::Backend.

Definition at line 174 of file tracy.cpp.

◆ MemoryDiscard() [2/2]

void helios::profile::TracyBackend::MemoryDiscard ( CStringView name,
int depth )
overridevirtualnoexcept

Discards tracked memory for a named pool with callstack depth.

Parameters
namePool name
depthCallstack depth

Implements helios::profile::Backend.

Definition at line 182 of file tracy.cpp.

◆ Message()

void helios::profile::TracyBackend::Message ( std::string_view text,
uint32_t color )
overridevirtualnoexcept

Emits a timeline message.

Parameters
textMessage text
colorOptional message color

Implements helios::profile::Backend.

Definition at line 109 of file tracy.cpp.

◆ Name()

std::string_view helios::profile::TracyBackend::Name ( ) const
inlinenodiscardoverridevirtualnoexcept

Returns the backend name.

Returns
Backend identifier

Implements helios::profile::Backend.

Definition at line 62 of file tracy.hpp.

◆ Plot()

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

Records a plot sample.

Parameters
namePlot channel name
valueSample value

Implements helios::profile::Backend.

Definition at line 122 of file tracy.cpp.

◆ PlotConfig()

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

Configures a plot channel.

Parameters
namePlot channel name
typePlot value format
stepWhether the plot is step-wise
fillWhether the plot is filled
colorPlot color

Implements helios::profile::Backend.

Definition at line 126 of file tracy.cpp.

◆ SetThreadName()

void helios::profile::TracyBackend::SetThreadName ( CStringView name)
overridevirtualnoexcept

Sets the current thread name.

Parameters
nameThread name

Implements helios::profile::Backend.

Definition at line 118 of file tracy.cpp.

◆ ZoneName()

void helios::profile::TracyBackend::ZoneName ( std::span< std::byte > storage,
std::string_view name )
overridevirtualnoexcept

Renames the active zone.

Parameters
storageBackend-specific storage slice
nameNew zone name

Implements helios::profile::Backend.

Definition at line 86 of file tracy.cpp.

◆ ZoneStorageSize()

size_t helios::profile::TracyBackend::ZoneStorageSize ( ) const
nodiscardoverridevirtualnoexcept

Returns the per-zone storage required by this backend.

Returns
Storage size in bytes

Implements helios::profile::Backend.

Definition at line 54 of file tracy.cpp.

◆ ZoneText()

void helios::profile::TracyBackend::ZoneText ( std::span< std::byte > storage,
std::string_view text )
overridevirtualnoexcept

Attaches text to the active zone.

Parameters
storageBackend-specific storage slice
textText to attach

Implements helios::profile::Backend.

Definition at line 76 of file tracy.cpp.

◆ ZoneValue()

void helios::profile::TracyBackend::ZoneValue ( std::span< std::byte > storage,
uint64_t value )
overridevirtualnoexcept

Attaches a numeric value to the active zone.

Parameters
storageBackend-specific storage slice
valueValue to attach

Implements helios::profile::Backend.

Definition at line 81 of file tracy.cpp.