1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Send callstacks before sending events they belong to.

This commit is contained in:
Bartosz Taudul
2020-09-29 16:39:56 +02:00
parent 8eb51aa01d
commit bd31e3d2d6
9 changed files with 47 additions and 49 deletions
+14 -14
View File
@@ -197,6 +197,13 @@ static inline int LuaZoneBeginS( lua_State* L )
if( !GetLuaZoneState().active ) return 0;
#endif
#ifdef TRACY_CALLSTACK
const uint32_t depth = TRACY_CALLSTACK;
#else
const auto depth = uint32_t( lua_tointeger( L, 1 ) );
#endif
SendLuaCallstack( L, depth );
TracyLfqPrepare( QueueType::ZoneBeginAllocSrcLocCallstack );
lua_Debug dbg;
lua_getstack( L, 1, &dbg );
@@ -206,13 +213,6 @@ static inline int LuaZoneBeginS( lua_State* L )
MemWrite( &item->zoneBegin.srcloc, srcloc );
TracyLfqCommit;
#ifdef TRACY_CALLSTACK
const uint32_t depth = TRACY_CALLSTACK;
#else
const auto depth = uint32_t( lua_tointeger( L, 1 ) );
#endif
SendLuaCallstack( L, depth );
return 0;
}
@@ -225,6 +225,13 @@ static inline int LuaZoneBeginNS( lua_State* L )
if( !GetLuaZoneState().active ) return 0;
#endif
#ifdef TRACY_CALLSTACK
const uint32_t depth = TRACY_CALLSTACK;
#else
const auto depth = uint32_t( lua_tointeger( L, 2 ) );
#endif
SendLuaCallstack( L, depth );
TracyLfqPrepare( QueueType::ZoneBeginAllocSrcLocCallstack );
lua_Debug dbg;
lua_getstack( L, 1, &dbg );
@@ -236,13 +243,6 @@ static inline int LuaZoneBeginNS( lua_State* L )
MemWrite( &item->zoneBegin.srcloc, srcloc );
TracyLfqCommit;
#ifdef TRACY_CALLSTACK
const uint32_t depth = TRACY_CALLSTACK;
#else
const auto depth = uint32_t( lua_tointeger( L, 2 ) );
#endif
SendLuaCallstack( L, depth );
return 0;
}
#endif