Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorBartosz Taudul <wolf@nereid.pl>2022-10-11 23:56:23 +0300
committerBartosz Taudul <wolf@nereid.pl>2022-10-11 23:56:23 +0300
commit383ecb6a121b1844c042a893c215669d39a60365 (patch)
treec2ef9b96bc669459f0b192cda933f690d443b105 /public
parentac6902501addf1067f14e22358102805b09a2a25 (diff)
Remove CodeLocation query and CodeInformation response.
Diffstat (limited to 'public')
-rw-r--r--public/client/TracyCallstack.cpp121
-rw-r--r--public/client/TracyCallstack.hpp1
-rw-r--r--public/client/TracyProfiler.cpp43
-rw-r--r--public/client/TracyProfiler.hpp1
-rw-r--r--public/common/TracyProtocol.hpp3
-rw-r--r--public/common/TracyQueue.hpp17
6 files changed, 1 insertions, 185 deletions
diff --git a/public/client/TracyCallstack.cpp b/public/client/TracyCallstack.cpp
index 75420bff..1cfe9e79 100644
--- a/public/client/TracyCallstack.cpp
+++ b/public/client/TracyCallstack.cpp
@@ -6,7 +6,6 @@
#include "TracyFastVector.hpp"
#include "TracyStringHelpers.hpp"
#include "../common/TracyAlloc.hpp"
-#include "../common/TracyStackFrames.hpp"
#include "TracyDebug.hpp"
#ifdef TRACY_HAS_CALLSTACK
@@ -385,85 +384,6 @@ CallstackSymbolData DecodeSymbolAddress( uint64_t ptr )
return sym;
}
-CallstackSymbolData DecodeCodeAddress( uint64_t ptr )
-{
- CallstackSymbolData sym = {};
- const auto proc = GetCurrentProcess();
- bool done = false;
-
- char buf[sizeof( SYMBOL_INFO ) + MaxNameSize];
- auto si = (SYMBOL_INFO*)buf;
- si->SizeOfStruct = sizeof( SYMBOL_INFO );
- si->MaxNameLen = MaxNameSize;
-
- IMAGEHLP_LINE64 line;
- DWORD displacement = 0;
- line.SizeOfStruct = sizeof(IMAGEHLP_LINE64);
-
-#ifdef TRACY_DBGHELP_LOCK
- DBGHELP_LOCK;
-#endif
-#if !defined TRACY_NO_CALLSTACK_INLINES
- if( _SymAddrIncludeInlineTrace )
- {
- DWORD inlineNum = _SymAddrIncludeInlineTrace( proc, ptr );
- DWORD ctx = 0;
- DWORD idx;
- BOOL doInline = FALSE;
- if( inlineNum != 0 ) doInline = _SymQueryInlineTrace( proc, ptr, 0, ptr, ptr, &ctx, &idx );
- if( doInline )
- {
- if( _SymGetLineFromInlineContext( proc, ptr, ctx, 0, &displacement, &line ) != 0 )
- {
- sym.file = CopyString( line.FileName );
- sym.line = line.LineNumber;
- sym.needFree = true;
- done = true;
-
- if( _SymFromInlineContext( proc, ptr, ctx, nullptr, si ) != 0 )
- {
- sym.symAddr = si->Address;
- }
- else
- {
- sym.symAddr = 0;
- }
- }
- }
- }
-#endif
- if( !done )
- {
- const auto res = SymGetLineFromAddr64( proc, ptr, &displacement, &line );
- if( res == 0 || line.LineNumber >= 0xF00000 )
- {
- sym.file = "[unknown]";
- sym.line = 0;
- sym.symAddr = 0;
- sym.needFree = false;
- }
- else
- {
- sym.file = CopyString( line.FileName );
- sym.line = line.LineNumber;
- sym.needFree = true;
-
- if( SymFromAddr( proc, ptr, nullptr, si ) != 0 )
- {
- sym.symAddr = si->Address;
- }
- else
- {
- sym.symAddr = 0;
- }
- }
- }
-#ifdef TRACY_DBGHELP_LOCK
- DBGHELP_UNLOCK;
-#endif
- return sym;
-}
-
CallstackEntryData DecodeCallstackPtr( uint64_t ptr )
{
int write;
@@ -900,42 +820,6 @@ CallstackSymbolData DecodeSymbolAddress( uint64_t ptr )
return sym;
}
-static int CodeDataCb( void* data, uintptr_t pc, uintptr_t lowaddr, const char* fn, int lineno, const char* function )
-{
- if( !fn ) return 1;
-
- const auto fnsz = strlen( fn );
- if( fnsz >= s_tracySkipSubframesMinLen )
- {
- auto ptr = s_tracySkipSubframes;
- do
- {
- if( fnsz >= ptr->len && memcmp( fn + fnsz - ptr->len, ptr->str, ptr->len ) == 0 ) return 0;
- ptr++;
- }
- while( ptr->str );
- }
-
- auto& sym = *(CallstackSymbolData*)data;
- sym.file = NormalizePath( fn );
- if( !sym.file ) sym.file = CopyString( fn );
- sym.line = lineno;
- sym.needFree = true;
- sym.symAddr = lowaddr;
- return 1;
-}
-
-static void CodeErrorCb( void* /*data*/, const char* /*msg*/, int /*errnum*/ )
-{
-}
-
-CallstackSymbolData DecodeCodeAddress( uint64_t ptr )
-{
- CallstackSymbolData sym = { "[unknown]", 0, false, 0 };
- backtrace_pcinfo( cb_bts, ptr, CodeDataCb, CodeErrorCb, &sym );
- return sym;
-}
-
static int CallstackDataCb( void* /*data*/, uintptr_t pc, uintptr_t lowaddr, const char* fn, int lineno, const char* function )
{
cb_data[cb_num].symLen = 0;
@@ -1122,11 +1006,6 @@ CallstackSymbolData DecodeSymbolAddress( uint64_t ptr )
return CallstackSymbolData { symloc, 0, false, 0 };
}
-CallstackSymbolData DecodeCodeAddress( uint64_t ptr )
-{
- return DecodeSymbolAddress( ptr );
-}
-
CallstackEntryData DecodeCallstackPtr( uint64_t ptr )
{
static CallstackEntry cb;
diff --git a/public/client/TracyCallstack.hpp b/public/client/TracyCallstack.hpp
index bc50561c..5c24e7db 100644
--- a/public/client/TracyCallstack.hpp
+++ b/public/client/TracyCallstack.hpp
@@ -51,7 +51,6 @@ struct CallstackEntryData
};
CallstackSymbolData DecodeSymbolAddress( uint64_t ptr );
-CallstackSymbolData DecodeCodeAddress( uint64_t ptr );
const char* DecodeCallstackPtrFast( uint64_t ptr );
CallstackEntryData DecodeCallstackPtr( uint64_t ptr );
void InitCallstack();
diff --git a/public/client/TracyProfiler.cpp b/public/client/TracyProfiler.cpp
index caf39c2f..cb5a0c17 100644
--- a/public/client/TracyProfiler.cpp
+++ b/public/client/TracyProfiler.cpp
@@ -2173,16 +2173,6 @@ static void FreeAssociatedMemory( const QueueItem& item )
}
break;
}
- case QueueType::CodeInformation:
- {
- uint8_t needFree = MemRead<uint8_t>( &item.codeInformationFat.needFree );
- if( needFree )
- {
- ptr = MemRead<uint64_t>( &item.codeInformationFat.fileString );
- tracy_free( (void*)ptr );
- }
- break;
- }
case QueueType::SymbolCodeMetadata:
ptr = MemRead<uint64_t>( &item.symbolCodeMetadata.ptr );
tracy_free( (void*)ptr );
@@ -2481,14 +2471,6 @@ Profiler::DequeueStatus Profiler::Dequeue( moodycamel::ConsumerToken& token )
if( needFree ) tracy_free_fast( (void*)fileString );
break;
}
- case QueueType::CodeInformation:
- {
- auto fileString = (const char*)MemRead<uint64_t>( &item->codeInformationFat.fileString );
- auto needFree = MemRead<uint8_t>( &item->codeInformationFat.needFree );
- SendSingleString( fileString );
- if( needFree ) tracy_free_fast( (void*)fileString );
- break;
- }
case QueueType::SymbolCodeMetadata:
{
auto symbol = MemRead<uint64_t>( &item->symbolCodeMetadata.symbol );
@@ -3163,15 +3145,6 @@ void Profiler::QueueSymbolQuery( uint64_t symbol )
#endif
}
-void Profiler::QueueCodeLocation( uint64_t ptr )
-{
-#ifdef TRACY_HAS_CALLSTACK
- m_symbolQueue.emplace( SymbolQueueItem { SymbolQueueItemType::CodeLocation, ptr } );
-#else
- AckServerQuery();
-#endif
-}
-
void Profiler::QueueExternalName( uint64_t ptr )
{
#ifdef TRACY_HAS_SYSTEM_TRACING
@@ -3228,19 +3201,6 @@ void Profiler::HandleSymbolQueueItem( const SymbolQueueItem& si )
TracyLfqCommit;
break;
}
- case SymbolQueueItemType::CodeLocation:
- {
- const auto sym = DecodeCodeAddress( si.ptr );
- const uint64_t offset = si.ptr - sym.symAddr;
- TracyLfqPrepare( QueueType::CodeInformation );
- MemWrite( &item->codeInformationFat.ptrOffset, offset );
- MemWrite( &item->codeInformationFat.line, sym.line );
- MemWrite( &item->codeInformationFat.symAddr, sym.symAddr );
- MemWrite( &item->codeInformationFat.fileString, (uint64_t)sym.file );
- MemWrite( &item->codeInformationFat.needFree, (uint8_t)sym.needFree );
- TracyLfqCommit;
- break;
- }
#ifdef TRACY_HAS_SYSTEM_TRACING
case SymbolQueueItemType::ExternalName:
{
@@ -3404,9 +3364,6 @@ bool Profiler::HandleServerQuery()
HandleSymbolCodeQuery( ptr, extra );
break;
#endif
- case ServerQueryCodeLocation:
- QueueCodeLocation( ptr );
- break;
case ServerQuerySourceCode:
HandleSourceCodeQuery();
break;
diff --git a/public/client/TracyProfiler.hpp b/public/client/TracyProfiler.hpp
index 2c3f541d..f5078404 100644
--- a/public/client/TracyProfiler.hpp
+++ b/public/client/TracyProfiler.hpp
@@ -167,7 +167,6 @@ class Profiler
{
CallstackFrame,
SymbolQuery,
- CodeLocation,
ExternalName,
KernelCode
};
diff --git a/public/common/TracyProtocol.hpp b/public/common/TracyProtocol.hpp
index 0d60833f..f68eea50 100644
--- a/public/common/TracyProtocol.hpp
+++ b/public/common/TracyProtocol.hpp
@@ -9,7 +9,7 @@ namespace tracy
constexpr unsigned Lz4CompressBound( unsigned isize ) { return isize + ( isize / 255 ) + 16; }
-enum : uint32_t { ProtocolVersion = 60 };
+enum : uint32_t { ProtocolVersion = 61 };
enum : uint16_t { BroadcastVersion = 3 };
using lz4sz_t = uint32_t;
@@ -53,7 +53,6 @@ enum ServerQuery : uint8_t
ServerQueryExternalName,
ServerQuerySymbol,
ServerQuerySymbolCode,
- ServerQueryCodeLocation,
ServerQuerySourceCode,
ServerQueryDataTransfer,
ServerQueryDataTransferPart
diff --git a/public/common/TracyQueue.hpp b/public/common/TracyQueue.hpp
index 5d7d3f6b..03162574 100644
--- a/public/common/TracyQueue.hpp
+++ b/public/common/TracyQueue.hpp
@@ -61,7 +61,6 @@ enum class QueueType : uint8_t
GpuContextName,
CallstackFrameSize,
SymbolInformation,
- CodeInformation,
ExternalNameMetadata,
SymbolCodeMetadata,
FiberEnter,
@@ -546,19 +545,6 @@ struct QueueSymbolInformationFat : public QueueSymbolInformation
uint8_t needFree;
};
-struct QueueCodeInformation
-{
- uint64_t symAddr;
- uint32_t line;
- uint64_t ptrOffset;
-};
-
-struct QueueCodeInformationFat : public QueueCodeInformation
-{
- uint64_t fileString;
- uint8_t needFree;
-};
-
struct QueueCrashReport
{
int64_t time;
@@ -727,8 +713,6 @@ struct QueueItem
QueueCallstackFrame callstackFrame;
QueueSymbolInformation symbolInformation;
QueueSymbolInformationFat symbolInformationFat;
- QueueCodeInformation codeInformation;
- QueueCodeInformationFat codeInformationFat;
QueueCrashReport crashReport;
QueueCrashReportThread crashReportThread;
QueueSysTime sysTime;
@@ -803,7 +787,6 @@ static constexpr size_t QueueDataSize[] = {
sizeof( QueueHeader ) + sizeof( QueueGpuContextName ),
sizeof( QueueHeader ) + sizeof( QueueCallstackFrameSize ),
sizeof( QueueHeader ) + sizeof( QueueSymbolInformation ),
- sizeof( QueueHeader ) + sizeof( QueueCodeInformation ),
sizeof( QueueHeader ), // ExternalNameMetadata - not for wire transfer
sizeof( QueueHeader ), // SymbolCodeMetadata - not for wire transfer
sizeof( QueueHeader ) + sizeof( QueueFiberEnter ),