1#include <Foundation/Basics.h>
2#include <Foundation/Strings/HashedString.h>
4#if PL_ENABLED(PL_USE_PROFILING) && TRACY_ENABLE && !PL_DOCS
6# include <tracy/tracy/Tracy.hpp>
8PL_ALWAYS_INLINE plUInt32 __tracyPlStringLength(
const char* szString)
13PL_ALWAYS_INLINE plUInt32 __tracyPlStringLength(
plStringView sString)
18PL_ALWAYS_INLINE plUInt32 __tracyPlStringLength(
const plString& sString)
23PL_ALWAYS_INLINE plUInt32 __tracyPlStringLength(
const plStringBuilder& sString)
28PL_ALWAYS_INLINE plUInt32 __tracyPlStringLength(
const plHashedString& sString)
33PL_ALWAYS_INLINE
const char* __tracyPlStringToConstChar(
const plString& sString)
38PL_ALWAYS_INLINE
const char* __tracyPlStringToConstChar(
const plStringBuilder& sString)
43PL_ALWAYS_INLINE
const char* __tracyPlStringToConstChar(
const plHashedString& sString)
48PL_ALWAYS_INLINE
const char* __tracyPlStringToConstChar(
const plStringView& sString)
54PL_ALWAYS_INLINE
const char* __tracyPlStringToConstChar(
const char* szString)
60# define PL_TRACY_PROFILE_SCOPE(ScopeName) \
62 ZoneName(__tracyPlStringToConstChar(ScopeName), __tracyPlStringLength(ScopeName))
66# undef PL_PROFILE_SCOPE
67# define PL_PROFILE_SCOPE(ScopeName) \
68 plProfilingScope PL_PP_CONCAT(_plProfilingScope, PL_SOURCE_LINE)(ScopeName, PL_SOURCE_FUNCTION, plTime::MakeZero()); \
69 PL_TRACY_PROFILE_SCOPE(ScopeName)
71# undef PL_PROFILE_SCOPE_WITH_TIMEOUT
72# define PL_PROFILE_SCOPE_WITH_TIMEOUT(ScopeName, Timeout) \
73 plProfilingScope PL_PP_CONCAT(_plProfilingScope, PL_SOURCE_LINE)(ScopeName, PL_SOURCE_FUNCTION, Timeout); \
74 PL_TRACY_PROFILE_SCOPE(ScopeName);
76# undef PL_PROFILE_LIST_SCOPE
77# define PL_PROFILE_LIST_SCOPE(ListName, FirstSectionName) \
78 plProfilingListScope PL_PP_CONCAT(_plProfilingScope, PL_SOURCE_LINE)(ListName, FirstSectionName, PL_SOURCE_FUNCTION); \
79 PL_TRACY_PROFILE_SCOPE(ScopeName);
81# undef PL_PROFILER_FRAME_MARKER
82# define PL_PROFILER_FRAME_MARKER() FrameMark
87# define PL_TRACY_PROFILE_SCOPE(ScopeName)
This class is optimized to take nearly no memory (sizeof(void*)) and to allow very fast checks whethe...
Definition HashedString.h:25
PL_ALWAYS_INLINE plStringView GetView() const
Returns a string view to this string's data.
Definition HashedString.h:128
const char * GetData() const
Gives access to the actual string data, so you can do all the typical (read-only) string operations o...
Definition HashedString_inl.h:110
plStringBuilder is a class that is meant for creating and modifying strings.
Definition StringBuilder.h:35
const char * GetData() const
Returns a char pointer to the internal Utf8 data.
Definition StringBuilder_inl.h:148
plUInt32 GetElementCount() const
Returns the number of bytes that this string takes up.
Definition StringBuilder_inl.h:78
static constexpr plUInt32 GetStringElementCount(const T *pString)
Returns the number of elements of type T that the string contains, until it hits an element that is z...
Definition StringUtils_inl.h:45
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
plUInt32 GetElementCount() const
Returns the number of bytes from the start position up to its end.
Definition StringView.h:93
const char * GetStartPointer() const
Returns the start of the view range.
Definition StringView.h:102
const char * GetData() const
Returns a pointer to the internal Utf8 string.
Definition String_inl.h:56
plUInt32 GetElementCount() const
Returns the amount of bytes that this string takes (excluding the '\0' terminator).
Definition String_inl.h:65