Skip to content

Commit

Permalink
zone count function
Browse files Browse the repository at this point in the history
  • Loading branch information
Aidan63 committed Sep 12, 2024
1 parent 37ba18e commit 3a85591
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion include/hx/TelemetryTracy.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
::hx::strbuf TracyConcat(_hx_tracy_str_buffer, TracyLine); \
int TracyConcat(_hx_tracy_str_length, TracyLine); \
const char *TracyConcat(_hx_tracy_str_buffer_ptr, TracyLine) = name.utf8_str(&TracyConcat(_hx_tracy_str_buffer, TracyLine), false, &TracyConcat(_hx_tracy_str_length, TracyLine)); \
::tracy::ScopedZone TracyConcat(_hx_tracy_scoped_zone,TracyLine)(_hx_stackframe.lineNumber, _hx_stackframe.position->fileName, strlen(_hx_stackframe.position->fileName), _hx_stackframe.position->fullName, strlen(_hx_stackframe.position->fullName), TracyConcat(_hx_tracy_str_buffer_ptr, TracyLine), TracyConcat(_hx_tracy_str_length, TracyLine), _hx_stackframe.ctx->getDepth());
::tracy::ScopedZone TracyConcat(_hx_tracy_scoped_zone,TracyLine)(_hx_stackframe.lineNumber, _hx_stackframe.position->fileName, strlen(_hx_stackframe.position->fileName), _hx_stackframe.position->fullName, strlen(_hx_stackframe.position->fullName), TracyConcat(_hx_tracy_str_buffer_ptr, TracyLine), TracyConcat(_hx_tracy_str_length, TracyLine), __hxcpp_tracy_get_zone_count());
#else
#define HXCPP_TRACY_ZONE(name) \
::hx::strbuf TracyConcat(_hx_tracy_str_buffer, TracyLine); \
Expand All @@ -39,5 +39,6 @@ void __hxcpp_tracy_plot_config(::String name, uint8_t format, bool step, bool fi
void __hxcpp_tracy_message(::String msg, int color);
void __hxcpp_tracy_message_app_info(::String info);
void __hxcpp_tracy_set_thread_name_and_group(String name, int groupHint);
int __hxcpp_tracy_get_zone_count();

#endif
7 changes: 6 additions & 1 deletion src/hx/TelemetryTracy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,4 +254,9 @@ void __hxcpp_tracy_set_thread_name_and_group(String name, int groupHint)
{
hx::strbuf buffer;
::tracy::SetThreadNameWithHint(name.utf8_str(&buffer), groupHint);
}
}

int __hxcpp_tracy_get_zone_count()
{
return static_cast<int>(hx::StackContext::getCurrent()->mTelemetry->tracyZones.size());
}

0 comments on commit 3a85591

Please sign in to comment.