mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Store source location in a single object.
Source file, function name and line number are now stored in a const static container object. This has the following benefits: - Slightly lighter profiling workload (3 instructions less). - Profiling queue event size is significantly reduced, by 12 bytes. This has an effect on all queue event types. - Source location grouping has now no cost, as it's performed at the compilation stage. This allows simplification of server code. The downside is that the full source location resolution is now performed in two steps, as the server has to query both source location container and strings contained within. This has almost no real impact on profiler operation.
This commit is contained in:
@@ -18,6 +18,13 @@ namespace tracy
|
||||
|
||||
class Socket;
|
||||
|
||||
struct SourceLocation
|
||||
{
|
||||
const char* function;
|
||||
const char* file;
|
||||
uint32_t line;
|
||||
};
|
||||
|
||||
class Profiler
|
||||
{
|
||||
public:
|
||||
@@ -46,6 +53,7 @@ private:
|
||||
|
||||
bool SendData( const char* data, size_t len );
|
||||
bool SendString( uint64_t ptr, const char* str, QueueType type );
|
||||
bool SendSourceLocation( uint64_t ptr );
|
||||
|
||||
bool HandleServerQuery();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user