2018-02-13 13:57:47 +00:00
|
|
|
#ifndef __TRACYWORKER_HPP__
|
|
|
|
#define __TRACYWORKER_HPP__
|
|
|
|
|
|
|
|
#include <atomic>
|
2019-10-28 22:22:50 +00:00
|
|
|
#include <condition_variable>
|
2018-03-18 19:15:45 +00:00
|
|
|
#include <limits>
|
2019-10-28 22:22:50 +00:00
|
|
|
#include <mutex>
|
2019-05-28 17:21:53 +00:00
|
|
|
#include <shared_mutex>
|
2018-04-21 12:18:13 +00:00
|
|
|
#include <stdexcept>
|
2018-02-13 13:57:47 +00:00
|
|
|
#include <string>
|
2019-10-24 21:03:13 +00:00
|
|
|
#include <string.h>
|
2018-02-13 13:57:47 +00:00
|
|
|
#include <thread>
|
2021-01-22 01:41:55 +00:00
|
|
|
#include <unordered_map>
|
2018-02-13 13:57:47 +00:00
|
|
|
#include <vector>
|
|
|
|
|
2022-07-17 11:41:40 +00:00
|
|
|
#include "../public/common/TracyForceInline.hpp"
|
|
|
|
#include "../public/common/TracyQueue.hpp"
|
|
|
|
#include "../public/common/TracyProtocol.hpp"
|
|
|
|
#include "../public/common/TracySocket.hpp"
|
2020-01-28 20:49:36 +00:00
|
|
|
#include "tracy_robin_hood.h"
|
2018-02-13 13:57:47 +00:00
|
|
|
#include "TracyEvent.hpp"
|
2019-11-02 14:52:34 +00:00
|
|
|
#include "TracyShortPtr.hpp"
|
2018-02-13 13:57:47 +00:00
|
|
|
#include "TracySlab.hpp"
|
2018-08-04 14:33:03 +00:00
|
|
|
#include "TracyStringDiscovery.hpp"
|
2020-03-02 01:00:35 +00:00
|
|
|
#include "TracyTextureCompression.hpp"
|
2019-08-19 20:56:02 +00:00
|
|
|
#include "TracyThreadCompress.hpp"
|
2018-06-19 19:15:36 +00:00
|
|
|
#include "TracyVarArray.hpp"
|
2018-02-13 13:57:47 +00:00
|
|
|
|
Compress frame images using zstd.
Memory usage and trace load times:
!comp 587 MB, 439 ms -> 541 MB, 523 ms (92%, 119%)
android-vk 197 MB, 136 ms -> 188 MB, 178 ms (95%, 130%)
big2 4463 MB, 2.93 s -> 4198 MB, 3.65 s (94%, 124%)
fi 483 MB, 346 ms -> 416 MB, 409 ms (86%, 118%)
fi-big 3307 MB, 3.15 s -> 2985 MB, 3.53 s (90%, 112%)
large 19.74 GB, 10.05 s -> 19.28 GB, 11.16 s (97%, 110%)
2020-02-09 20:22:12 +00:00
|
|
|
|
2018-02-13 13:57:47 +00:00
|
|
|
namespace tracy
|
|
|
|
{
|
|
|
|
|
|
|
|
class FileRead;
|
|
|
|
class FileWrite;
|
|
|
|
|
2018-04-20 14:03:09 +00:00
|
|
|
namespace EventType
|
|
|
|
{
|
|
|
|
enum Type : uint32_t
|
|
|
|
{
|
2019-08-12 22:56:57 +00:00
|
|
|
Locks = 1 << 0,
|
|
|
|
Messages = 1 << 1,
|
|
|
|
Plots = 1 << 2,
|
|
|
|
Memory = 1 << 3,
|
|
|
|
FrameImages = 1 << 4,
|
|
|
|
ContextSwitches = 1 << 5,
|
2020-02-22 16:13:53 +00:00
|
|
|
Samples = 1 << 6,
|
2020-03-25 19:52:59 +00:00
|
|
|
SymbolCode = 1 << 7,
|
2020-05-23 13:43:42 +00:00
|
|
|
SourceCache = 1 << 8,
|
2018-04-20 14:03:09 +00:00
|
|
|
|
2019-08-12 22:56:57 +00:00
|
|
|
None = 0,
|
|
|
|
All = std::numeric_limits<uint32_t>::max()
|
2018-04-20 14:03:09 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2018-04-21 12:18:13 +00:00
|
|
|
struct UnsupportedVersion : public std::exception
|
|
|
|
{
|
|
|
|
UnsupportedVersion( int version ) : version( version ) {}
|
|
|
|
int version;
|
|
|
|
};
|
|
|
|
|
2019-08-12 10:16:48 +00:00
|
|
|
struct LegacyVersion : public std::exception
|
|
|
|
{
|
|
|
|
LegacyVersion( int version ) : version ( version ) {}
|
|
|
|
int version;
|
|
|
|
};
|
|
|
|
|
2023-12-31 12:55:06 +00:00
|
|
|
struct LoadFailure : public std::exception
|
|
|
|
{
|
|
|
|
LoadFailure( const char* msg ) : msg( msg ) {}
|
|
|
|
std::string msg;
|
|
|
|
};
|
|
|
|
|
2018-07-28 15:59:17 +00:00
|
|
|
struct LoadProgress
|
|
|
|
{
|
2018-07-29 14:56:46 +00:00
|
|
|
enum Stage
|
|
|
|
{
|
|
|
|
Initialization,
|
|
|
|
Locks,
|
|
|
|
Messages,
|
|
|
|
Zones,
|
|
|
|
GpuZones,
|
|
|
|
Plots,
|
|
|
|
Memory,
|
2019-06-06 21:40:37 +00:00
|
|
|
CallStacks,
|
2019-08-12 22:56:57 +00:00
|
|
|
FrameImages,
|
2019-08-16 14:51:02 +00:00
|
|
|
ContextSwitches,
|
|
|
|
ContextSwitchesPerCpu
|
2018-07-29 14:56:46 +00:00
|
|
|
};
|
|
|
|
|
2018-07-28 18:13:06 +00:00
|
|
|
LoadProgress() : total( 0 ), progress( 0 ), subTotal( 0 ), subProgress( 0 ) {}
|
|
|
|
|
|
|
|
std::atomic<uint64_t> total;
|
|
|
|
std::atomic<uint64_t> progress;
|
|
|
|
std::atomic<uint64_t> subTotal;
|
|
|
|
std::atomic<uint64_t> subProgress;
|
2018-07-28 15:59:17 +00:00
|
|
|
};
|
|
|
|
|
2018-02-13 13:57:47 +00:00
|
|
|
class Worker
|
|
|
|
{
|
2018-07-21 18:26:13 +00:00
|
|
|
public:
|
2019-12-16 17:55:02 +00:00
|
|
|
struct ImportEventTimeline
|
|
|
|
{
|
|
|
|
uint64_t tid;
|
|
|
|
uint64_t timestamp;
|
|
|
|
std::string name;
|
2020-05-12 09:44:36 +00:00
|
|
|
std::string text;
|
2019-12-16 17:55:02 +00:00
|
|
|
bool isEnd;
|
2021-05-10 23:27:48 +00:00
|
|
|
std::string locFile;
|
|
|
|
uint32_t locLine;
|
2019-12-16 17:55:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct ImportEventMessages
|
|
|
|
{
|
|
|
|
uint64_t tid;
|
|
|
|
uint64_t timestamp;
|
|
|
|
std::string message;
|
|
|
|
};
|
|
|
|
|
2020-06-20 13:30:06 +00:00
|
|
|
struct ImportEventPlots
|
|
|
|
{
|
|
|
|
std::string name;
|
|
|
|
PlotValueFormatting format;
|
|
|
|
std::vector<std::pair<int64_t, double>> data;
|
|
|
|
};
|
|
|
|
|
2018-03-18 19:45:49 +00:00
|
|
|
struct ZoneThreadData
|
|
|
|
{
|
2019-10-29 00:32:09 +00:00
|
|
|
tracy_force_inline ZoneEvent* Zone() const { return (ZoneEvent*)( _zone_thread >> 16 ); }
|
|
|
|
tracy_force_inline void SetZone( ZoneEvent* zone ) { assert( ( uint64_t( zone ) & 0xFFFF000000000000 ) == 0 ); memcpy( ((char*)&_zone_thread)+2, &zone, 4 ); memcpy( ((char*)&_zone_thread)+6, ((char*)&zone)+4, 2 ); }
|
|
|
|
tracy_force_inline uint16_t Thread() const { return uint16_t( _zone_thread & 0xFFFF ); }
|
|
|
|
tracy_force_inline void SetThread( uint16_t thread ) { memcpy( &_zone_thread, &thread, 2 ); }
|
2019-08-30 22:55:51 +00:00
|
|
|
|
|
|
|
uint64_t _zone_thread;
|
2018-03-18 19:45:49 +00:00
|
|
|
};
|
2019-08-30 22:55:51 +00:00
|
|
|
enum { ZoneThreadDataSize = sizeof( ZoneThreadData ) };
|
2018-03-18 19:45:49 +00:00
|
|
|
|
2022-01-23 14:44:37 +00:00
|
|
|
struct GpuZoneThreadData
|
|
|
|
{
|
|
|
|
tracy_force_inline GpuEvent* Zone() const { return (GpuEvent*)( _zone_thread >> 16 ); }
|
|
|
|
tracy_force_inline void SetZone( GpuEvent* zone ) { assert( ( uint64_t( zone ) & 0xFFFF000000000000 ) == 0 ); memcpy( ((char*)&_zone_thread)+2, &zone, 4 ); memcpy( ((char*)&_zone_thread)+6, ((char*)&zone)+4, 2 ); }
|
|
|
|
tracy_force_inline uint16_t Thread() const { return uint16_t( _zone_thread & 0xFFFF ); }
|
|
|
|
tracy_force_inline void SetThread( uint16_t thread ) { memcpy( &_zone_thread, &thread, 2 ); }
|
|
|
|
|
|
|
|
uint64_t _zone_thread;
|
|
|
|
};
|
|
|
|
enum { GpuZoneThreadDataSize = sizeof( GpuZoneThreadData ) };
|
|
|
|
|
2019-11-29 21:46:57 +00:00
|
|
|
struct CpuThreadTopology
|
|
|
|
{
|
|
|
|
uint32_t package;
|
2024-08-24 14:36:04 +00:00
|
|
|
uint32_t die;
|
2019-11-29 21:46:57 +00:00
|
|
|
uint32_t core;
|
|
|
|
};
|
|
|
|
|
2020-05-23 12:05:11 +00:00
|
|
|
struct MemoryBlock
|
2020-03-25 19:04:55 +00:00
|
|
|
{
|
|
|
|
const char* data;
|
|
|
|
uint32_t len;
|
|
|
|
};
|
|
|
|
|
2020-05-31 19:17:21 +00:00
|
|
|
struct InlineStackData
|
|
|
|
{
|
|
|
|
uint64_t symAddr;
|
|
|
|
CallstackFrameId frame;
|
|
|
|
uint8_t inlineFrame;
|
|
|
|
};
|
|
|
|
|
2023-03-10 00:02:41 +00:00
|
|
|
struct PowerData
|
|
|
|
{
|
|
|
|
int64_t lastTime;
|
|
|
|
PlotData* plot;
|
|
|
|
};
|
|
|
|
|
2022-08-03 04:42:21 +00:00
|
|
|
#pragma pack( push, 1 )
|
2020-05-31 19:17:21 +00:00
|
|
|
struct GhostKey
|
|
|
|
{
|
|
|
|
CallstackFrameId frame;
|
|
|
|
uint8_t inlineFrame;
|
|
|
|
};
|
2022-08-03 04:42:21 +00:00
|
|
|
#pragma pack( pop )
|
2020-05-31 19:17:21 +00:00
|
|
|
|
|
|
|
struct GhostKeyHasher
|
|
|
|
{
|
|
|
|
size_t operator()( const GhostKey& key ) const
|
|
|
|
{
|
|
|
|
return charutil::hash( (const char*)&key, sizeof( GhostKey ) );
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct GhostKeyComparator
|
|
|
|
{
|
|
|
|
bool operator()( const GhostKey& lhs, const GhostKey& rhs ) const
|
|
|
|
{
|
|
|
|
return memcmp( &lhs, &rhs, sizeof( GhostKey ) ) == 0;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2018-07-21 18:26:13 +00:00
|
|
|
private:
|
2018-03-18 19:08:57 +00:00
|
|
|
struct SourceLocationZones
|
|
|
|
{
|
2021-02-07 18:35:53 +00:00
|
|
|
struct ZtdSort { bool operator()( const ZoneThreadData& lhs, const ZoneThreadData& rhs ) { return lhs.Zone()->Start() < rhs.Zone()->Start(); } };
|
|
|
|
|
|
|
|
SortedVector<ZoneThreadData, ZtdSort> zones;
|
2019-03-14 00:15:19 +00:00
|
|
|
int64_t min = std::numeric_limits<int64_t>::max();
|
|
|
|
int64_t max = std::numeric_limits<int64_t>::min();
|
|
|
|
int64_t total = 0;
|
2019-03-14 00:23:37 +00:00
|
|
|
double sumSq = 0;
|
2019-03-14 00:15:19 +00:00
|
|
|
int64_t selfMin = std::numeric_limits<int64_t>::max();
|
|
|
|
int64_t selfMax = std::numeric_limits<int64_t>::min();
|
|
|
|
int64_t selfTotal = 0;
|
2021-06-05 18:28:16 +00:00
|
|
|
size_t nonReentrantCount = 0;
|
|
|
|
int64_t nonReentrantMin = std::numeric_limits<int64_t>::max();
|
|
|
|
int64_t nonReentrantMax = std::numeric_limits<int64_t>::min();
|
|
|
|
int64_t nonReentrantTotal = 0;
|
2023-12-20 15:42:37 +00:00
|
|
|
unordered_flat_map<uint16_t, uint64_t> threadCnt;
|
2018-03-18 19:08:57 +00:00
|
|
|
};
|
|
|
|
|
2022-01-23 14:44:37 +00:00
|
|
|
struct GpuSourceLocationZones
|
|
|
|
{
|
|
|
|
struct GpuZtdSort { bool operator()( const GpuZoneThreadData& lhs, const GpuZoneThreadData& rhs ) { return lhs.Zone()->GpuStart() < rhs.Zone()->GpuStart(); } };
|
|
|
|
|
|
|
|
SortedVector<GpuZoneThreadData, GpuZtdSort> zones;
|
|
|
|
int64_t min = std::numeric_limits<int64_t>::max();
|
|
|
|
int64_t max = std::numeric_limits<int64_t>::min();
|
|
|
|
int64_t total = 0;
|
|
|
|
double sumSq = 0;
|
|
|
|
};
|
|
|
|
|
2019-03-03 15:37:21 +00:00
|
|
|
struct CallstackFrameIdHash
|
|
|
|
{
|
2019-03-03 16:54:00 +00:00
|
|
|
size_t operator()( const CallstackFrameId& id ) const { return id.data; }
|
2019-03-03 15:37:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct CallstackFrameIdCompare
|
|
|
|
{
|
2019-03-03 16:54:00 +00:00
|
|
|
bool operator()( const CallstackFrameId& lhs, const CallstackFrameId& rhs ) const { return lhs.data == rhs.data; }
|
2019-03-03 15:37:21 +00:00
|
|
|
};
|
|
|
|
|
2019-03-03 16:34:56 +00:00
|
|
|
struct RevFrameHash
|
|
|
|
{
|
2019-03-03 16:54:00 +00:00
|
|
|
size_t operator()( const CallstackFrameData* data ) const
|
2019-03-03 16:34:56 +00:00
|
|
|
{
|
|
|
|
size_t hash = data->size;
|
|
|
|
for( uint8_t i=0; i<data->size; i++ )
|
|
|
|
{
|
|
|
|
const auto& v = data->data[i];
|
|
|
|
hash = ( ( hash << 5 ) + hash ) ^ size_t( v.line );
|
2019-09-29 18:32:42 +00:00
|
|
|
hash = ( ( hash << 5 ) + hash ) ^ size_t( v.file.Idx() );
|
|
|
|
hash = ( ( hash << 5 ) + hash ) ^ size_t( v.name.Idx() );
|
2019-03-03 16:34:56 +00:00
|
|
|
}
|
|
|
|
return hash;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct RevFrameComp
|
|
|
|
{
|
2019-03-03 16:54:00 +00:00
|
|
|
bool operator()( const CallstackFrameData* lhs, const CallstackFrameData* rhs ) const
|
2019-03-03 16:34:56 +00:00
|
|
|
{
|
|
|
|
if( lhs->size != rhs->size ) return false;
|
|
|
|
for( uint8_t i=0; i<lhs->size; i++ )
|
|
|
|
{
|
2020-02-25 22:42:59 +00:00
|
|
|
if( memcmp( lhs->data + i, rhs->data + i, sizeof( CallstackFrameBasic ) ) != 0 ) return false;
|
2019-03-03 16:34:56 +00:00
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-02-27 11:39:05 +00:00
|
|
|
struct SymbolPending
|
|
|
|
{
|
|
|
|
StringIdx name;
|
|
|
|
StringIdx imageName;
|
2020-02-27 13:35:00 +00:00
|
|
|
StringIdx file;
|
|
|
|
uint32_t line;
|
2020-03-25 17:32:36 +00:00
|
|
|
uint32_t size;
|
2020-02-27 14:28:58 +00:00
|
|
|
bool isInline;
|
2020-02-27 11:39:05 +00:00
|
|
|
};
|
|
|
|
|
2018-02-13 13:57:47 +00:00
|
|
|
struct DataBlock
|
|
|
|
{
|
2021-02-07 17:11:24 +00:00
|
|
|
std::mutex lock;
|
2018-08-04 17:47:09 +00:00
|
|
|
StringDiscovery<FrameData*> frames;
|
|
|
|
FrameData* framesBase;
|
2018-02-13 13:57:47 +00:00
|
|
|
Vector<GpuCtxData*> gpuData;
|
2019-11-02 15:32:42 +00:00
|
|
|
Vector<short_ptr<MessageData>> messages;
|
2018-08-04 14:33:03 +00:00
|
|
|
StringDiscovery<PlotData*> plots;
|
2018-02-13 13:57:47 +00:00
|
|
|
Vector<ThreadData*> threads;
|
2020-01-26 14:57:55 +00:00
|
|
|
Vector<ZoneExtra> zoneExtra;
|
2020-09-23 13:53:17 +00:00
|
|
|
MemData* memory;
|
|
|
|
unordered_flat_map<uint64_t, MemData*> memNameMap;
|
2019-10-13 12:13:04 +00:00
|
|
|
uint64_t zonesCnt = 0;
|
|
|
|
uint64_t gpuCnt = 0;
|
2020-02-22 15:39:39 +00:00
|
|
|
uint64_t samplesCnt = 0;
|
2020-03-10 20:06:38 +00:00
|
|
|
uint64_t ghostCnt = 0;
|
2019-10-13 12:13:04 +00:00
|
|
|
int64_t baseTime = 0;
|
|
|
|
int64_t lastTime = 0;
|
|
|
|
uint64_t frameOffset = 0;
|
2020-03-25 20:48:24 +00:00
|
|
|
CpuArchitecture cpuArch = CpuArchUnknown;
|
2020-05-06 16:59:54 +00:00
|
|
|
uint32_t cpuId = 0;
|
|
|
|
char cpuManufacturer[13];
|
2018-02-13 13:57:47 +00:00
|
|
|
|
2020-01-28 20:49:36 +00:00
|
|
|
unordered_flat_map<uint64_t, const char*> strings;
|
2018-02-13 13:57:47 +00:00
|
|
|
Vector<const char*> stringData;
|
2020-01-28 20:49:36 +00:00
|
|
|
unordered_flat_map<charutil::StringKey, uint32_t, charutil::StringKey::Hasher, charutil::StringKey::Comparator> stringMap;
|
|
|
|
unordered_flat_map<uint64_t, const char*> threadNames;
|
|
|
|
unordered_flat_map<uint64_t, std::pair<const char*, const char*>> externalNames;
|
2018-02-13 13:57:47 +00:00
|
|
|
|
2020-01-28 20:49:36 +00:00
|
|
|
unordered_flat_map<uint64_t, SourceLocation> sourceLocation;
|
2019-11-02 15:37:27 +00:00
|
|
|
Vector<short_ptr<SourceLocation>> sourceLocationPayload;
|
2020-01-28 20:49:36 +00:00
|
|
|
unordered_flat_map<const SourceLocation*, int16_t, SourceLocationHasher, SourceLocationComparator> sourceLocationPayloadMap;
|
2018-03-04 15:32:51 +00:00
|
|
|
Vector<uint64_t> sourceLocationExpand;
|
2018-03-18 11:55:54 +00:00
|
|
|
#ifndef TRACY_NO_STATISTICS
|
2020-01-28 20:49:36 +00:00
|
|
|
unordered_flat_map<int16_t, SourceLocationZones> sourceLocationZones;
|
2020-02-26 23:26:58 +00:00
|
|
|
bool sourceLocationZonesReady = false;
|
2022-01-23 14:46:30 +00:00
|
|
|
unordered_flat_map<int16_t, GpuSourceLocationZones> gpuSourceLocationZones;
|
|
|
|
bool gpuSourceLocationZonesReady = false;
|
2018-07-29 12:16:13 +00:00
|
|
|
#else
|
2020-01-28 20:49:36 +00:00
|
|
|
unordered_flat_map<int16_t, uint64_t> sourceLocationZonesCnt;
|
2022-01-23 14:46:30 +00:00
|
|
|
unordered_flat_map<int16_t, uint64_t> gpuSourceLocationZonesCnt;
|
2018-03-18 11:55:54 +00:00
|
|
|
#endif
|
2018-02-13 13:57:47 +00:00
|
|
|
|
2020-01-28 20:49:36 +00:00
|
|
|
unordered_flat_map<VarArray<CallstackFrameId>*, uint32_t, VarArrayHasher<CallstackFrameId>, VarArrayComparator<CallstackFrameId>> callstackMap;
|
2019-11-02 15:34:51 +00:00
|
|
|
Vector<short_ptr<VarArray<CallstackFrameId>>> callstackPayload;
|
2020-01-28 20:49:36 +00:00
|
|
|
unordered_flat_map<CallstackFrameId, CallstackFrameData*, CallstackFrameIdHash, CallstackFrameIdCompare> callstackFrameMap;
|
|
|
|
unordered_flat_map<CallstackFrameData*, CallstackFrameId, RevFrameHash, RevFrameComp> revFrameMap;
|
2020-02-26 21:35:15 +00:00
|
|
|
unordered_flat_map<uint64_t, SymbolData> symbolMap;
|
2020-02-27 00:22:36 +00:00
|
|
|
unordered_flat_map<uint64_t, SymbolStats> symbolStats;
|
2020-03-27 16:34:51 +00:00
|
|
|
Vector<SymbolLocation> symbolLoc;
|
2020-04-08 10:44:12 +00:00
|
|
|
Vector<uint64_t> symbolLocInline;
|
2020-09-06 23:47:11 +00:00
|
|
|
int64_t newSymbolsIndex = -1;
|
|
|
|
int64_t newInlineSymbolsIndex = -1;
|
2021-06-19 17:07:35 +00:00
|
|
|
unordered_flat_map<uint64_t, uint64_t> codeSymbolMap;
|
2020-02-27 00:22:36 +00:00
|
|
|
|
|
|
|
#ifndef TRACY_NO_STATISTICS
|
2020-02-29 15:24:15 +00:00
|
|
|
unordered_flat_map<VarArray<CallstackFrameId>*, uint32_t, VarArrayHasher<CallstackFrameId>, VarArrayComparator<CallstackFrameId>> parentCallstackMap;
|
|
|
|
Vector<short_ptr<VarArray<CallstackFrameId>>> parentCallstackPayload;
|
2020-02-29 18:49:33 +00:00
|
|
|
unordered_flat_map<CallstackFrameId, CallstackFrameData*, CallstackFrameIdHash, CallstackFrameIdCompare> parentCallstackFrameMap;
|
2020-02-29 15:24:15 +00:00
|
|
|
unordered_flat_map<CallstackFrameData*, CallstackFrameId, RevFrameHash, RevFrameComp> revParentFrameMap;
|
2020-02-29 12:45:50 +00:00
|
|
|
unordered_flat_map<uint32_t, uint32_t> postponedSamples;
|
2020-03-24 22:54:30 +00:00
|
|
|
unordered_flat_map<CallstackFrameId, uint32_t, CallstackFrameIdHash, CallstackFrameIdCompare> pendingInstructionPointers;
|
|
|
|
unordered_flat_map<uint64_t, unordered_flat_map<CallstackFrameId, uint32_t, CallstackFrameIdHash, CallstackFrameIdCompare>> instructionPointersMap;
|
2020-08-10 12:52:51 +00:00
|
|
|
unordered_flat_map<uint64_t, Vector<SampleDataRange>> symbolSamples;
|
|
|
|
unordered_flat_map<CallstackFrameId, Vector<SampleDataRange>, CallstackFrameIdHash, CallstackFrameIdCompare> pendingSymbolSamples;
|
2021-11-27 01:03:59 +00:00
|
|
|
unordered_flat_map<uint64_t, Vector<ChildSample>> childSamples;
|
2020-02-29 13:12:04 +00:00
|
|
|
bool newFramesWereReceived = false;
|
2020-02-27 00:22:36 +00:00
|
|
|
bool callstackSamplesReady = false;
|
2021-11-13 01:38:33 +00:00
|
|
|
bool newContextSwitchesReceived = false;
|
2020-03-10 20:06:38 +00:00
|
|
|
bool ghostZonesReady = false;
|
2020-05-31 12:17:54 +00:00
|
|
|
bool ghostZonesPostponed = false;
|
2020-08-07 12:53:39 +00:00
|
|
|
bool symbolSamplesReady = false;
|
2020-02-27 00:22:36 +00:00
|
|
|
#endif
|
2018-06-19 19:15:36 +00:00
|
|
|
|
2020-01-28 20:49:36 +00:00
|
|
|
unordered_flat_map<uint32_t, LockMap*> lockMap;
|
2018-03-18 19:45:22 +00:00
|
|
|
|
2019-08-19 20:56:02 +00:00
|
|
|
ThreadCompress localThreadCompress;
|
2019-08-19 21:09:58 +00:00
|
|
|
ThreadCompress externalThreadCompress;
|
2018-07-22 14:05:50 +00:00
|
|
|
|
2019-11-02 15:17:20 +00:00
|
|
|
Vector<Vector<short_ptr<ZoneEvent>>> zoneChildren;
|
2019-11-02 14:52:34 +00:00
|
|
|
Vector<Vector<short_ptr<GpuEvent>>> gpuChildren;
|
2020-03-10 20:06:38 +00:00
|
|
|
#ifndef TRACY_NO_STATISTICS
|
|
|
|
Vector<Vector<GhostZone>> ghostChildren;
|
2020-05-31 19:17:21 +00:00
|
|
|
Vector<GhostKey> ghostFrames;
|
|
|
|
unordered_flat_map<GhostKey, uint32_t, GhostKeyHasher, GhostKeyComparator> ghostFramesMap;
|
2020-03-10 20:06:38 +00:00
|
|
|
#endif
|
2018-08-20 00:07:31 +00:00
|
|
|
|
2019-11-02 15:17:20 +00:00
|
|
|
Vector<Vector<short_ptr<ZoneEvent>>> zoneVectorCache;
|
2019-03-26 21:06:00 +00:00
|
|
|
|
2019-11-02 15:34:02 +00:00
|
|
|
Vector<short_ptr<FrameImage>> frameImage;
|
2019-07-12 16:30:45 +00:00
|
|
|
Vector<StringRef> appInfo;
|
2019-06-06 19:39:54 +00:00
|
|
|
|
2019-03-26 20:41:44 +00:00
|
|
|
CrashEvent crashEvent;
|
2019-08-12 22:13:50 +00:00
|
|
|
|
2020-01-28 20:49:36 +00:00
|
|
|
unordered_flat_map<uint64_t, ContextSwitch*> ctxSwitch;
|
2019-08-16 14:28:58 +00:00
|
|
|
|
|
|
|
CpuData cpuData[256];
|
2019-10-15 14:08:20 +00:00
|
|
|
int cpuDataCount = 0;
|
2020-01-28 20:49:36 +00:00
|
|
|
unordered_flat_map<uint64_t, uint64_t> tidToPid;
|
|
|
|
unordered_flat_map<uint64_t, CpuThreadData> cpuThreadData;
|
2019-10-25 16:16:27 +00:00
|
|
|
|
2019-10-25 17:19:35 +00:00
|
|
|
std::pair<uint64_t, ThreadData*> threadDataLast = std::make_pair( std::numeric_limits<uint64_t>::max(), nullptr );
|
|
|
|
std::pair<uint64_t, ContextSwitch*> ctxSwitchLast = std::make_pair( std::numeric_limits<uint64_t>::max(), nullptr );
|
2019-10-25 19:01:16 +00:00
|
|
|
uint64_t checkSrclocLast = 0;
|
2019-10-25 19:07:28 +00:00
|
|
|
std::pair<uint64_t, uint16_t> shrinkSrclocLast = std::make_pair( std::numeric_limits<uint64_t>::max(), 0 );
|
2019-10-25 19:29:55 +00:00
|
|
|
#ifndef TRACY_NO_STATISTICS
|
2019-12-16 18:11:23 +00:00
|
|
|
std::pair<uint16_t, SourceLocationZones*> srclocZonesLast = std::make_pair( 0, nullptr );
|
2022-01-23 14:46:30 +00:00
|
|
|
std::pair<uint16_t, GpuSourceLocationZones*> gpuZonesLast = std::make_pair( 0, nullptr );
|
2019-10-26 14:30:13 +00:00
|
|
|
#else
|
2019-12-16 18:11:23 +00:00
|
|
|
std::pair<uint16_t, uint64_t*> srclocCntLast = std::make_pair( 0, nullptr );
|
2022-01-23 14:46:30 +00:00
|
|
|
std::pair<uint16_t, uint64_t*> gpuCntLast = std::make_pair( 0, nullptr );
|
2019-10-25 19:29:55 +00:00
|
|
|
#endif
|
2019-11-04 23:40:41 +00:00
|
|
|
|
|
|
|
#ifndef TRACY_NO_STATISTICS
|
|
|
|
Vector<ContextSwitchUsage> ctxUsage;
|
|
|
|
bool ctxUsageReady = false;
|
|
|
|
#endif
|
2019-11-29 21:41:41 +00:00
|
|
|
|
2024-08-21 23:33:22 +00:00
|
|
|
unordered_flat_map<uint32_t, unordered_flat_map<uint32_t, unordered_flat_map<uint32_t, std::vector<uint32_t>>>> cpuTopology;
|
2020-01-28 20:49:36 +00:00
|
|
|
unordered_flat_map<uint32_t, CpuThreadTopology> cpuTopologyMap;
|
2020-03-25 19:04:55 +00:00
|
|
|
|
2020-05-23 12:05:11 +00:00
|
|
|
unordered_flat_map<uint64_t, MemoryBlock> symbolCode;
|
2020-03-25 19:04:55 +00:00
|
|
|
uint64_t symbolCodeSize = 0;
|
2020-04-01 20:37:19 +00:00
|
|
|
|
2020-05-23 12:09:47 +00:00
|
|
|
unordered_flat_map<const char*, MemoryBlock, charutil::Hasher, charutil::Comparator> sourceFileCache;
|
2021-05-19 21:05:33 +00:00
|
|
|
|
|
|
|
unordered_flat_map<uint64_t, HwSampleData> hwSamples;
|
2022-04-01 16:46:46 +00:00
|
|
|
bool hasBranchRetirement = false;
|
2021-11-02 00:51:54 +00:00
|
|
|
|
2021-11-02 00:53:10 +00:00
|
|
|
unordered_flat_map<uint64_t, uint64_t> fiberToThreadMap;
|
2018-02-13 13:57:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct MbpsBlock
|
|
|
|
{
|
2019-10-23 22:47:16 +00:00
|
|
|
MbpsBlock() : mbps( 64 ), compRatio( 1.0 ), queue( 0 ), transferred( 0 ) {}
|
2018-02-13 13:57:47 +00:00
|
|
|
|
2019-05-28 17:21:53 +00:00
|
|
|
std::shared_mutex lock;
|
2018-02-13 13:57:47 +00:00
|
|
|
std::vector<float> mbps;
|
|
|
|
float compRatio;
|
2019-04-01 17:55:37 +00:00
|
|
|
size_t queue;
|
2019-10-23 22:47:16 +00:00
|
|
|
uint64_t transferred;
|
2018-02-13 13:57:47 +00:00
|
|
|
};
|
|
|
|
|
2019-01-14 22:22:31 +00:00
|
|
|
struct FailureData
|
|
|
|
{
|
|
|
|
uint64_t thread;
|
2019-08-15 15:42:26 +00:00
|
|
|
int16_t srcloc;
|
2020-09-29 16:00:14 +00:00
|
|
|
uint32_t callstack;
|
2021-10-10 12:12:13 +00:00
|
|
|
std::string message;
|
2019-01-14 22:22:31 +00:00
|
|
|
};
|
|
|
|
|
2019-11-06 22:29:59 +00:00
|
|
|
struct FrameImagePending
|
|
|
|
{
|
|
|
|
const char* image;
|
|
|
|
uint32_t csz;
|
|
|
|
};
|
|
|
|
|
2018-02-13 13:57:47 +00:00
|
|
|
public:
|
2019-01-14 22:22:31 +00:00
|
|
|
enum class Failure
|
|
|
|
{
|
|
|
|
None,
|
2019-01-15 17:42:15 +00:00
|
|
|
ZoneStack,
|
2020-04-30 17:05:13 +00:00
|
|
|
ZoneDoubleEnd,
|
2019-01-16 00:17:01 +00:00
|
|
|
ZoneText,
|
2021-10-10 12:05:21 +00:00
|
|
|
ZoneValue,
|
2020-11-27 11:37:35 +00:00
|
|
|
ZoneColor,
|
2019-01-16 00:17:01 +00:00
|
|
|
ZoneName,
|
2019-01-15 17:56:26 +00:00
|
|
|
MemFree,
|
2021-03-09 21:10:29 +00:00
|
|
|
MemAllocTwice,
|
2019-02-28 18:32:42 +00:00
|
|
|
FrameEnd,
|
2019-06-09 11:44:53 +00:00
|
|
|
FrameImageIndex,
|
|
|
|
FrameImageTwice,
|
2021-11-02 00:47:31 +00:00
|
|
|
FiberLeave,
|
2023-12-31 11:58:56 +00:00
|
|
|
SourceLocationOverflow,
|
2019-01-15 17:42:15 +00:00
|
|
|
|
|
|
|
NUM_FAILURES
|
2019-01-14 22:22:31 +00:00
|
|
|
};
|
|
|
|
|
2024-05-05 18:50:03 +00:00
|
|
|
Worker( const char* addr, uint16_t port, int64_t memoryLimit );
|
2021-01-22 02:32:03 +00:00
|
|
|
Worker( const char* name, const char* program, const std::vector<ImportEventTimeline>& timeline, const std::vector<ImportEventMessages>& messages, const std::vector<ImportEventPlots>& plots, const std::unordered_map<uint64_t, std::string>& threadNames );
|
2023-11-17 20:48:17 +00:00
|
|
|
Worker( FileRead& f, EventType::Type eventMask = EventType::All, bool bgTasks = true, bool allowStringModification = false);
|
2018-02-13 13:57:47 +00:00
|
|
|
~Worker();
|
|
|
|
|
|
|
|
const std::string& GetAddr() const { return m_addr; }
|
2020-10-02 16:51:54 +00:00
|
|
|
uint16_t GetPort() const { return m_port; }
|
2018-02-13 13:57:47 +00:00
|
|
|
const std::string& GetCaptureName() const { return m_captureName; }
|
2018-08-28 22:57:11 +00:00
|
|
|
const std::string& GetCaptureProgram() const { return m_captureProgram; }
|
|
|
|
uint64_t GetCaptureTime() const { return m_captureTime; }
|
2021-01-31 16:51:55 +00:00
|
|
|
uint64_t GetExecutableTime() const { return m_executableTime; }
|
2018-08-19 16:24:43 +00:00
|
|
|
const std::string& GetHostInfo() const { return m_hostInfo; }
|
2018-02-13 13:57:47 +00:00
|
|
|
int64_t GetDelay() const { return m_delay; }
|
|
|
|
int64_t GetResolution() const { return m_resolution; }
|
2019-08-17 20:19:04 +00:00
|
|
|
uint64_t GetPid() const { return m_pid; };
|
2020-03-25 21:12:18 +00:00
|
|
|
CpuArchitecture GetCpuArch() const { return m_data.cpuArch; }
|
2020-05-06 17:15:22 +00:00
|
|
|
uint32_t GetCpuId() const { return m_data.cpuId; }
|
|
|
|
const char* GetCpuManufacturer() const { return m_data.cpuManufacturer; }
|
2018-02-13 13:57:47 +00:00
|
|
|
|
2021-02-07 17:11:24 +00:00
|
|
|
std::mutex& GetDataLock() { return m_data.lock; }
|
2018-08-04 17:47:09 +00:00
|
|
|
size_t GetFrameCount( const FrameData& fd ) const { return fd.frames.size(); }
|
2018-09-01 10:38:12 +00:00
|
|
|
size_t GetFullFrameCount( const FrameData& fd ) const;
|
2022-09-05 18:12:12 +00:00
|
|
|
bool AreFramesUsed() const;
|
2023-03-03 20:37:10 +00:00
|
|
|
int64_t GetFirstTime() const;
|
2018-02-13 13:57:47 +00:00
|
|
|
int64_t GetLastTime() const { return m_data.lastTime; }
|
|
|
|
uint64_t GetZoneCount() const { return m_data.zonesCnt; }
|
2020-01-26 16:28:37 +00:00
|
|
|
uint64_t GetZoneExtraCount() const { return m_data.zoneExtra.size() - 1; }
|
2019-10-13 12:13:28 +00:00
|
|
|
uint64_t GetGpuZoneCount() const { return m_data.gpuCnt; }
|
2018-08-08 17:21:53 +00:00
|
|
|
uint64_t GetLockCount() const;
|
|
|
|
uint64_t GetPlotCount() const;
|
2020-02-05 22:41:53 +00:00
|
|
|
uint64_t GetTracyPlotCount() const;
|
2019-08-12 22:29:09 +00:00
|
|
|
uint64_t GetContextSwitchCount() const;
|
2019-08-16 14:36:33 +00:00
|
|
|
uint64_t GetContextSwitchPerCpuCount() const;
|
2019-08-14 18:26:55 +00:00
|
|
|
bool HasContextSwitches() const { return !m_data.ctxSwitch.empty(); }
|
2018-08-14 14:36:25 +00:00
|
|
|
uint64_t GetSrcLocCount() const { return m_data.sourceLocationPayload.size() + m_data.sourceLocation.size(); }
|
|
|
|
uint64_t GetCallstackPayloadCount() const { return m_data.callstackPayload.size() - 1; }
|
2020-02-29 18:31:51 +00:00
|
|
|
#ifndef TRACY_NO_STATISTICS
|
2020-02-29 15:32:33 +00:00
|
|
|
uint64_t GetCallstackParentPayloadCount() const { return m_data.parentCallstackPayload.size(); }
|
|
|
|
uint64_t GetCallstackParentFrameCount() const { return m_callstackParentNextIdx; }
|
2020-02-29 18:31:51 +00:00
|
|
|
#endif
|
|
|
|
uint64_t GetCallstackFrameCount() const { return m_data.callstackFrameMap.size(); }
|
2020-02-22 15:42:26 +00:00
|
|
|
uint64_t GetCallstackSampleCount() const { return m_data.samplesCnt; }
|
2020-02-26 22:02:39 +00:00
|
|
|
uint64_t GetSymbolsCount() const { return m_data.symbolMap.size(); }
|
2020-03-25 19:08:39 +00:00
|
|
|
uint64_t GetSymbolCodeCount() const { return m_data.symbolCode.size(); }
|
|
|
|
uint64_t GetSymbolCodeSize() const { return m_data.symbolCodeSize; }
|
2020-03-10 20:06:38 +00:00
|
|
|
uint64_t GetGhostZonesCount() const { return m_data.ghostCnt; }
|
2019-06-22 12:11:45 +00:00
|
|
|
uint32_t GetFrameImageCount() const { return (uint32_t)m_data.frameImage.size(); }
|
2019-09-29 17:22:15 +00:00
|
|
|
uint64_t GetStringsCount() const { return m_data.strings.size() + m_data.stringData.size(); }
|
2021-05-19 21:29:27 +00:00
|
|
|
uint64_t GetHwSampleCountAddress() const { return m_data.hwSamples.size(); }
|
|
|
|
uint64_t GetHwSampleCount() const;
|
2022-04-01 16:48:11 +00:00
|
|
|
bool HasHwBranchRetirement() const { return m_data.hasBranchRetirement; }
|
2021-04-18 20:59:10 +00:00
|
|
|
#ifndef TRACY_NO_STATISTICS
|
2021-04-18 13:03:42 +00:00
|
|
|
uint64_t GetChildSamplesCountSyms() const { return m_data.childSamples.size(); }
|
|
|
|
uint64_t GetChildSamplesCountFull() const;
|
2021-11-13 01:47:39 +00:00
|
|
|
uint64_t GetContextSwitchSampleCount() const;
|
2021-04-18 20:59:10 +00:00
|
|
|
#endif
|
2018-07-10 20:39:41 +00:00
|
|
|
uint64_t GetFrameOffset() const { return m_data.frameOffset; }
|
2018-08-04 17:47:09 +00:00
|
|
|
const FrameData* GetFramesBase() const { return m_data.framesBase; }
|
2018-08-04 18:58:49 +00:00
|
|
|
const Vector<FrameData*>& GetFrames() const { return m_data.frames.Data(); }
|
2019-08-14 18:16:11 +00:00
|
|
|
const ContextSwitch* const GetContextSwitchData( uint64_t thread )
|
|
|
|
{
|
|
|
|
if( m_data.ctxSwitchLast.first == thread ) return m_data.ctxSwitchLast.second;
|
|
|
|
return GetContextSwitchDataImpl( thread );
|
|
|
|
}
|
2019-08-16 14:30:00 +00:00
|
|
|
const CpuData* GetCpuData() const { return m_data.cpuData; }
|
2019-10-15 14:08:20 +00:00
|
|
|
int GetCpuDataCpuCount() const { return m_data.cpuDataCount; }
|
2019-08-17 23:51:02 +00:00
|
|
|
uint64_t GetPidFromTid( uint64_t tid ) const;
|
2020-01-28 20:49:36 +00:00
|
|
|
const unordered_flat_map<uint64_t, CpuThreadData>& GetCpuThreadData() const { return m_data.cpuThreadData; }
|
2020-06-17 16:26:23 +00:00
|
|
|
const unordered_flat_map<const char*, MemoryBlock, charutil::Hasher, charutil::Comparator>& GetSourceFileCache() const { return m_data.sourceFileCache; }
|
2020-05-23 12:22:50 +00:00
|
|
|
uint64_t GetSourceFileCacheCount() const { return m_data.sourceFileCache.size(); }
|
|
|
|
uint64_t GetSourceFileCacheSize() const;
|
2020-05-23 13:08:26 +00:00
|
|
|
MemoryBlock GetSourceFileFromCache( const char* file ) const;
|
2021-06-04 11:58:00 +00:00
|
|
|
HwSampleData* GetHwSampleData( uint64_t addr );
|
2018-02-13 13:57:47 +00:00
|
|
|
|
2018-08-04 17:47:09 +00:00
|
|
|
int64_t GetFrameTime( const FrameData& fd, size_t idx ) const;
|
|
|
|
int64_t GetFrameBegin( const FrameData& fd, size_t idx ) const;
|
|
|
|
int64_t GetFrameEnd( const FrameData& fd, size_t idx ) const;
|
2019-06-06 19:48:01 +00:00
|
|
|
const FrameImage* GetFrameImage( const FrameData& fd, size_t idx ) const;
|
2019-06-22 12:05:18 +00:00
|
|
|
std::pair<int, int> GetFrameRange( const FrameData& fd, int64_t from, int64_t to );
|
2018-02-13 13:57:47 +00:00
|
|
|
|
2020-01-28 20:49:36 +00:00
|
|
|
const unordered_flat_map<uint32_t, LockMap*>& GetLockMap() const { return m_data.lockMap; }
|
2019-11-02 15:32:42 +00:00
|
|
|
const Vector<short_ptr<MessageData>>& GetMessages() const { return m_data.messages; }
|
2018-02-13 13:57:47 +00:00
|
|
|
const Vector<GpuCtxData*>& GetGpuData() const { return m_data.gpuData; }
|
2018-08-04 14:33:03 +00:00
|
|
|
const Vector<PlotData*>& GetPlots() const { return m_data.plots.Data(); }
|
2018-02-13 13:57:47 +00:00
|
|
|
const Vector<ThreadData*>& GetThreadData() const { return m_data.threads; }
|
2019-09-08 12:07:16 +00:00
|
|
|
const ThreadData* GetThreadData( uint64_t tid ) const;
|
2020-09-25 15:51:05 +00:00
|
|
|
const MemData& GetMemoryNamed( uint64_t name ) const;
|
|
|
|
const unordered_flat_map<uint64_t, MemData*>& GetMemNameMap() const { return m_data.memNameMap; }
|
2019-11-02 15:34:02 +00:00
|
|
|
const Vector<short_ptr<FrameImage>>& GetFrameImages() const { return m_data.frameImage; }
|
2019-07-12 16:39:07 +00:00
|
|
|
const Vector<StringRef>& GetAppInfo() const { return m_data.appInfo; }
|
2018-06-19 23:18:59 +00:00
|
|
|
|
2019-03-03 15:50:18 +00:00
|
|
|
const VarArray<CallstackFrameId>& GetCallstack( uint32_t idx ) const { return *m_data.callstackPayload[idx]; }
|
|
|
|
const CallstackFrameData* GetCallstackFrame( const CallstackFrameId& ptr ) const;
|
2020-05-10 14:56:13 +00:00
|
|
|
CallstackFrameId PackPointer( uint64_t ptr ) const;
|
2019-03-03 15:39:13 +00:00
|
|
|
uint64_t GetCanonicalPointer( const CallstackFrameId& id ) const;
|
2020-02-26 21:46:02 +00:00
|
|
|
const SymbolData* GetSymbolData( uint64_t sym ) const;
|
2020-08-13 14:24:09 +00:00
|
|
|
bool HasSymbolCode( uint64_t sym ) const;
|
2020-03-25 21:15:22 +00:00
|
|
|
const char* GetSymbolCode( uint64_t sym, uint32_t& len ) const;
|
2021-11-14 12:05:05 +00:00
|
|
|
uint64_t GetSymbolForAddress( uint64_t address );
|
|
|
|
uint64_t GetSymbolForAddress( uint64_t address, uint32_t& offset );
|
2021-06-19 17:13:34 +00:00
|
|
|
uint64_t GetInlineSymbolForAddress( uint64_t address ) const;
|
|
|
|
bool HasInlineSymbolAddresses() const { return !m_data.codeSymbolMap.empty(); }
|
2020-04-01 22:31:53 +00:00
|
|
|
StringIdx GetLocationForAddress( uint64_t address, uint32_t& line ) const;
|
2021-11-14 12:05:05 +00:00
|
|
|
const uint64_t* GetInlineSymbolList( uint64_t sym, uint32_t len );
|
2018-02-13 13:57:47 +00:00
|
|
|
|
2023-11-17 20:48:17 +00:00
|
|
|
unordered_flat_map<CallstackFrameId, CallstackFrameData*, CallstackFrameIdHash, CallstackFrameIdCompare>& GetCallstackFrameMap() { return m_data.callstackFrameMap; }
|
|
|
|
|
2020-02-29 16:58:41 +00:00
|
|
|
#ifndef TRACY_NO_STATISTICS
|
|
|
|
const VarArray<CallstackFrameId>& GetParentCallstack( uint32_t idx ) const { return *m_data.parentCallstackPayload[idx]; }
|
2020-02-29 18:49:33 +00:00
|
|
|
const CallstackFrameData* GetParentCallstackFrame( const CallstackFrameId& ptr ) const;
|
2020-08-10 12:52:51 +00:00
|
|
|
const Vector<SampleDataRange>* GetSamplesForSymbol( uint64_t symAddr ) const;
|
2021-11-27 01:03:59 +00:00
|
|
|
const Vector<ChildSample>* GetChildSamples( uint64_t addr ) const;
|
2020-02-29 16:58:41 +00:00
|
|
|
#endif
|
|
|
|
|
2019-03-26 20:41:44 +00:00
|
|
|
const CrashEvent& GetCrashEvent() const { return m_data.crashEvent; }
|
2018-08-20 00:23:29 +00:00
|
|
|
|
2018-03-18 01:53:00 +00:00
|
|
|
// Some zones may have incomplete timing data (only start time is available, end hasn't arrived yet).
|
|
|
|
// GetZoneEnd() will try to infer the end time by looking at child zones (parent zone can't end
|
|
|
|
// before its children have ended).
|
|
|
|
// GetZoneEndDirect() will only return zone's direct timing data, without looking at children.
|
2023-04-30 23:28:32 +00:00
|
|
|
tracy_force_inline int64_t GetZoneEnd( const ZoneEvent& ev ) { return ev.IsEndValid() ? ev.End() : GetZoneEndImpl( ev ); }
|
|
|
|
tracy_force_inline int64_t GetZoneEnd( const GpuEvent& ev ) { return ev.GpuEnd() >= 0 ? ev.GpuEnd() : GetZoneEndImpl( ev ); }
|
2020-01-23 17:50:13 +00:00
|
|
|
static tracy_force_inline int64_t GetZoneEndDirect( const ZoneEvent& ev ) { return ev.IsEndValid() ? ev.End() : ev.Start(); }
|
2019-10-30 22:50:37 +00:00
|
|
|
static tracy_force_inline int64_t GetZoneEndDirect( const GpuEvent& ev ) { return ev.GpuEnd() >= 0 ? ev.GpuEnd() : ev.GpuStart(); }
|
2018-03-18 01:53:00 +00:00
|
|
|
|
2020-04-02 00:08:00 +00:00
|
|
|
uint32_t FindStringIdx( const char* str ) const;
|
2018-02-13 13:57:47 +00:00
|
|
|
const char* GetString( uint64_t ptr ) const;
|
|
|
|
const char* GetString( const StringRef& ref ) const;
|
|
|
|
const char* GetString( const StringIdx& idx ) const;
|
2019-08-27 21:00:13 +00:00
|
|
|
const char* GetThreadName( uint64_t id ) const;
|
2020-02-22 17:51:53 +00:00
|
|
|
bool IsThreadLocal( uint64_t id );
|
2021-11-06 18:02:02 +00:00
|
|
|
bool IsThreadFiber( uint64_t id );
|
2019-08-15 15:42:26 +00:00
|
|
|
const SourceLocation& GetSourceLocation( int16_t srcloc ) const;
|
2019-08-16 17:49:16 +00:00
|
|
|
std::pair<const char*, const char*> GetExternalName( uint64_t id ) const;
|
2018-02-13 13:57:47 +00:00
|
|
|
|
2019-02-10 15:45:19 +00:00
|
|
|
const char* GetZoneName( const SourceLocation& srcloc ) const;
|
2018-06-29 13:14:20 +00:00
|
|
|
const char* GetZoneName( const ZoneEvent& ev ) const;
|
|
|
|
const char* GetZoneName( const ZoneEvent& ev, const SourceLocation& srcloc ) const;
|
|
|
|
const char* GetZoneName( const GpuEvent& ev ) const;
|
|
|
|
|
2019-11-02 15:17:20 +00:00
|
|
|
tracy_force_inline const Vector<short_ptr<ZoneEvent>>& GetZoneChildren( int32_t idx ) const { return m_data.zoneChildren[idx]; }
|
2019-11-02 14:52:34 +00:00
|
|
|
tracy_force_inline const Vector<short_ptr<GpuEvent>>& GetGpuChildren( int32_t idx ) const { return m_data.gpuChildren[idx]; }
|
2020-03-10 20:06:38 +00:00
|
|
|
#ifndef TRACY_NO_STATISTICS
|
|
|
|
tracy_force_inline const Vector<GhostZone>& GetGhostChildren( int32_t idx ) const { return m_data.ghostChildren[idx]; }
|
2020-05-31 19:17:21 +00:00
|
|
|
tracy_force_inline const GhostKey& GetGhostFrame( const Int24& frame ) const { return m_data.ghostFrames[frame.Val()]; }
|
2020-03-10 20:06:38 +00:00
|
|
|
#endif
|
2018-07-22 14:05:50 +00:00
|
|
|
|
2020-01-26 14:57:55 +00:00
|
|
|
tracy_force_inline const bool HasZoneExtra( const ZoneEvent& ev ) const { return ev.extra != 0; }
|
|
|
|
tracy_force_inline const ZoneExtra& GetZoneExtra( const ZoneEvent& ev ) const { return m_data.zoneExtra[ev.extra]; }
|
|
|
|
|
2019-08-15 15:42:26 +00:00
|
|
|
std::vector<int16_t> GetMatchingSourceLocation( const char* query, bool ignoreCase ) const;
|
2018-03-24 13:48:52 +00:00
|
|
|
|
2022-05-01 22:36:49 +00:00
|
|
|
const unordered_flat_map<uint64_t, SymbolData>& GetSymbolMap() const { return m_data.symbolMap; }
|
|
|
|
|
2018-03-18 11:55:54 +00:00
|
|
|
#ifndef TRACY_NO_STATISTICS
|
2021-11-14 15:05:55 +00:00
|
|
|
SourceLocationZones& GetZonesForSourceLocation( int16_t srcloc );
|
2019-08-15 15:42:26 +00:00
|
|
|
const SourceLocationZones& GetZonesForSourceLocation( int16_t srcloc ) const;
|
2020-01-28 20:49:36 +00:00
|
|
|
const unordered_flat_map<int16_t, SourceLocationZones>& GetSourceLocationZones() const { return m_data.sourceLocationZones; }
|
2022-01-29 14:22:49 +00:00
|
|
|
const unordered_flat_map<int16_t, GpuSourceLocationZones>& GetGpuSourceLocationZones() const { return m_data.gpuSourceLocationZones; }
|
2018-04-30 01:54:09 +00:00
|
|
|
bool AreSourceLocationZonesReady() const { return m_data.sourceLocationZonesReady; }
|
2022-01-28 23:51:43 +00:00
|
|
|
bool AreGpuSourceLocationZonesReady() const { return m_data.gpuSourceLocationZonesReady; }
|
2019-11-04 23:40:41 +00:00
|
|
|
bool IsCpuUsageReady() const { return m_data.ctxUsageReady; }
|
2023-03-25 16:55:15 +00:00
|
|
|
const Vector<ContextSwitchUsage>& GetCpuUsage() const { return m_data.ctxUsage; }
|
2020-02-27 01:08:20 +00:00
|
|
|
|
|
|
|
const unordered_flat_map<uint64_t, SymbolStats>& GetSymbolStats() const { return m_data.symbolStats; }
|
2020-02-29 17:41:07 +00:00
|
|
|
const SymbolStats* GetSymbolStats( uint64_t symAddr ) const;
|
2020-03-25 00:08:29 +00:00
|
|
|
const unordered_flat_map<CallstackFrameId, uint32_t, CallstackFrameIdHash, CallstackFrameIdCompare>* GetSymbolInstructionPointers( uint64_t symAddr ) const;
|
2020-02-27 00:22:36 +00:00
|
|
|
bool AreCallstackSamplesReady() const { return m_data.callstackSamplesReady; }
|
2020-03-16 23:15:00 +00:00
|
|
|
bool AreGhostZonesReady() const { return m_data.ghostZonesReady; }
|
2020-08-07 12:53:39 +00:00
|
|
|
bool AreSymbolSamplesReady() const { return m_data.symbolSamplesReady; }
|
2018-03-18 11:55:54 +00:00
|
|
|
#endif
|
2018-03-04 15:52:45 +00:00
|
|
|
|
2019-08-19 20:56:02 +00:00
|
|
|
tracy_force_inline uint16_t CompressThread( uint64_t thread ) { return m_data.localThreadCompress.CompressThread( thread ); }
|
|
|
|
tracy_force_inline uint64_t DecompressThread( uint16_t thread ) const { return m_data.localThreadCompress.DecompressThread( thread ); }
|
2019-08-19 21:09:58 +00:00
|
|
|
tracy_force_inline uint64_t DecompressThreadExternal( uint16_t thread ) const { return m_data.externalThreadCompress.DecompressThread( thread ); }
|
2018-03-18 19:45:22 +00:00
|
|
|
|
2019-05-28 17:21:53 +00:00
|
|
|
std::shared_mutex& GetMbpsDataLock() { return m_mbpsData.lock; }
|
2018-02-13 13:57:47 +00:00
|
|
|
const std::vector<float>& GetMbpsData() const { return m_mbpsData.mbps; }
|
|
|
|
float GetCompRatio() const { return m_mbpsData.compRatio; }
|
2019-04-01 17:55:37 +00:00
|
|
|
size_t GetSendQueueSize() const { return m_mbpsData.queue; }
|
2020-03-27 01:00:26 +00:00
|
|
|
size_t GetSendInFlight() const { return m_serverQuerySpaceBase - m_serverQuerySpaceLeft; }
|
2019-10-23 22:47:16 +00:00
|
|
|
uint64_t GetDataTransferred() const { return m_mbpsData.transferred; }
|
2018-02-13 13:57:47 +00:00
|
|
|
|
|
|
|
bool HasData() const { return m_hasData.load( std::memory_order_acquire ); }
|
|
|
|
bool IsConnected() const { return m_connected.load( std::memory_order_relaxed ); }
|
2018-03-24 13:43:57 +00:00
|
|
|
bool IsDataStatic() const { return !m_thread.joinable(); }
|
2019-06-02 13:00:38 +00:00
|
|
|
bool IsBackgroundDone() const { return m_backgroundDone.load( std::memory_order_relaxed ); }
|
2023-03-03 23:19:58 +00:00
|
|
|
bool IsOnDemand() const { return m_onDemand; }
|
2018-02-13 13:57:47 +00:00
|
|
|
void Shutdown() { m_shutdown.store( true, std::memory_order_relaxed ); }
|
2019-08-01 21:14:09 +00:00
|
|
|
void Disconnect();
|
2021-04-01 18:16:29 +00:00
|
|
|
bool WasDisconnectIssued() const { return m_disconnect; }
|
2024-05-05 18:59:25 +00:00
|
|
|
int64_t GetMemoryLimit() const { return m_memoryLimit; }
|
2018-02-13 13:57:47 +00:00
|
|
|
|
2021-05-15 13:50:20 +00:00
|
|
|
void Write( FileWrite& f, bool fiDict );
|
2018-07-29 13:33:48 +00:00
|
|
|
int GetTraceVersion() const { return m_traceVersion; }
|
2018-09-09 17:28:53 +00:00
|
|
|
uint8_t GetHandshakeStatus() const { return m_handshake.load( std::memory_order_relaxed ); }
|
2020-02-27 01:08:20 +00:00
|
|
|
int64_t GetSamplingPeriod() const { return m_samplingPeriod; }
|
2021-10-16 14:15:19 +00:00
|
|
|
bool AreSamplesInconsistent() const { return m_inconsistentSamples; }
|
2018-02-13 13:57:47 +00:00
|
|
|
|
2018-07-28 15:59:17 +00:00
|
|
|
static const LoadProgress& GetLoadProgress() { return s_loadProgress; }
|
2019-01-06 18:09:50 +00:00
|
|
|
int64_t GetLoadTime() const { return m_loadTime; }
|
2018-07-28 15:59:17 +00:00
|
|
|
|
2019-01-14 22:22:31 +00:00
|
|
|
void ClearFailure() { m_failure = Failure::None; }
|
|
|
|
Failure GetFailureType() const { return m_failure; }
|
|
|
|
const FailureData& GetFailureData() const { return m_failureData; }
|
2019-01-15 17:42:15 +00:00
|
|
|
static const char* GetFailureString( Failure failure );
|
2019-01-14 22:22:31 +00:00
|
|
|
|
2020-03-02 01:00:35 +00:00
|
|
|
const char* UnpackFrameImage( const FrameImage& image ) { return m_texcomp.Unpack( image ); }
|
2019-06-08 10:17:18 +00:00
|
|
|
|
2019-11-25 22:59:48 +00:00
|
|
|
const Vector<Parameter>& GetParameters() const { return m_params; }
|
|
|
|
void SetParameter( size_t paramIdx, int32_t val );
|
|
|
|
|
2019-11-29 21:41:41 +00:00
|
|
|
const decltype(DataBlock::cpuTopology)& GetCpuTopology() const { return m_data.cpuTopology; }
|
2019-11-29 21:46:57 +00:00
|
|
|
const CpuThreadTopology* GetThreadTopology( uint32_t cpuThread ) const;
|
2019-11-29 21:41:41 +00:00
|
|
|
|
2020-03-14 13:35:57 +00:00
|
|
|
std::pair<uint64_t, uint64_t> GetTextureCompressionBytes() const { return std::make_pair( m_texcomp.GetInputBytesCount(), m_texcomp.GetOutputBytesCount() ); }
|
|
|
|
|
2021-11-14 12:05:05 +00:00
|
|
|
void DoPostponedSymbols();
|
|
|
|
void DoPostponedInlineSymbols();
|
2021-02-07 17:29:29 +00:00
|
|
|
void DoPostponedWork();
|
2021-11-14 12:01:27 +00:00
|
|
|
void DoPostponedWorkAll();
|
2021-02-07 17:29:29 +00:00
|
|
|
|
2022-03-30 14:07:15 +00:00
|
|
|
void CacheSourceFiles();
|
|
|
|
|
2023-11-18 20:04:02 +00:00
|
|
|
StringLocation StoreString(const char* str, size_t sz);
|
2023-11-17 20:48:17 +00:00
|
|
|
|
2024-08-03 17:55:37 +00:00
|
|
|
std::vector<uint32_t>& GetPendingThreadHints() { return m_pendingThreadHints; }
|
|
|
|
void ClearPendingThreadHints() { m_pendingThreadHints.clear(); }
|
|
|
|
|
2018-02-13 13:57:47 +00:00
|
|
|
private:
|
2019-10-28 21:45:10 +00:00
|
|
|
void Network();
|
2018-02-13 13:57:47 +00:00
|
|
|
void Exec();
|
2020-03-25 19:04:01 +00:00
|
|
|
void Query( ServerQuery type, uint64_t data, uint32_t extra = 0 );
|
2019-06-09 13:58:56 +00:00
|
|
|
void QueryTerminate();
|
2022-05-01 12:25:07 +00:00
|
|
|
void QuerySourceFile( const char* fn, const char* image );
|
2021-02-03 23:03:25 +00:00
|
|
|
void QueryDataTransfer( const void* ptr, size_t size );
|
2018-02-13 13:57:47 +00:00
|
|
|
|
2019-11-07 00:29:11 +00:00
|
|
|
tracy_force_inline bool DispatchProcess( const QueueItem& ev, const char*& ptr );
|
2019-01-14 22:08:34 +00:00
|
|
|
tracy_force_inline bool Process( const QueueItem& ev );
|
2019-08-02 18:18:08 +00:00
|
|
|
tracy_force_inline void ProcessThreadContext( const QueueThreadContext& ev );
|
2018-02-13 13:57:47 +00:00
|
|
|
tracy_force_inline void ProcessZoneBegin( const QueueZoneBegin& ev );
|
2018-06-21 23:07:25 +00:00
|
|
|
tracy_force_inline void ProcessZoneBeginCallstack( const QueueZoneBegin& ev );
|
2020-05-10 17:20:59 +00:00
|
|
|
tracy_force_inline void ProcessZoneBeginAllocSrcLoc( const QueueZoneBeginLean& ev );
|
|
|
|
tracy_force_inline void ProcessZoneBeginAllocSrcLocCallstack( const QueueZoneBeginLean& ev );
|
2019-01-15 17:55:21 +00:00
|
|
|
tracy_force_inline void ProcessZoneEnd( const QueueZoneEnd& ev );
|
2019-01-14 21:56:10 +00:00
|
|
|
tracy_force_inline void ProcessZoneValidation( const QueueZoneValidation& ev );
|
2018-02-13 13:57:47 +00:00
|
|
|
tracy_force_inline void ProcessFrameMark( const QueueFrameMark& ev );
|
2018-08-05 00:09:59 +00:00
|
|
|
tracy_force_inline void ProcessFrameMarkStart( const QueueFrameMark& ev );
|
|
|
|
tracy_force_inline void ProcessFrameMarkEnd( const QueueFrameMark& ev );
|
2022-07-30 17:51:29 +00:00
|
|
|
tracy_force_inline void ProcessFrameVsync( const QueueFrameVsync& ev );
|
2020-07-26 12:18:48 +00:00
|
|
|
tracy_force_inline void ProcessFrameImage( const QueueFrameImage& ev );
|
2020-07-25 22:53:55 +00:00
|
|
|
tracy_force_inline void ProcessZoneText();
|
|
|
|
tracy_force_inline void ProcessZoneName();
|
2020-11-27 11:37:35 +00:00
|
|
|
tracy_force_inline void ProcessZoneColor( const QueueZoneColor& ev );
|
2020-05-24 14:13:09 +00:00
|
|
|
tracy_force_inline void ProcessZoneValue( const QueueZoneValue& ev );
|
2018-02-13 13:57:47 +00:00
|
|
|
tracy_force_inline void ProcessLockAnnounce( const QueueLockAnnounce& ev );
|
2018-12-16 19:39:30 +00:00
|
|
|
tracy_force_inline void ProcessLockTerminate( const QueueLockTerminate& ev );
|
2018-02-13 13:57:47 +00:00
|
|
|
tracy_force_inline void ProcessLockWait( const QueueLockWait& ev );
|
|
|
|
tracy_force_inline void ProcessLockObtain( const QueueLockObtain& ev );
|
|
|
|
tracy_force_inline void ProcessLockRelease( const QueueLockRelease& ev );
|
|
|
|
tracy_force_inline void ProcessLockSharedWait( const QueueLockWait& ev );
|
|
|
|
tracy_force_inline void ProcessLockSharedObtain( const QueueLockObtain& ev );
|
2022-07-18 00:06:19 +00:00
|
|
|
tracy_force_inline void ProcessLockSharedRelease( const QueueLockReleaseShared& ev );
|
2018-02-13 13:57:47 +00:00
|
|
|
tracy_force_inline void ProcessLockMark( const QueueLockMark& ev );
|
2020-03-08 12:47:38 +00:00
|
|
|
tracy_force_inline void ProcessLockName( const QueueLockName& ev );
|
2022-07-24 11:00:36 +00:00
|
|
|
tracy_force_inline void ProcessPlotDataInt( const QueuePlotDataInt& ev );
|
|
|
|
tracy_force_inline void ProcessPlotDataFloat( const QueuePlotDataFloat& ev );
|
|
|
|
tracy_force_inline void ProcessPlotDataDouble( const QueuePlotDataDouble& ev );
|
2019-11-05 17:02:08 +00:00
|
|
|
tracy_force_inline void ProcessPlotConfig( const QueuePlotConfig& ev );
|
2018-02-13 13:57:47 +00:00
|
|
|
tracy_force_inline void ProcessMessage( const QueueMessage& ev );
|
2020-07-25 23:15:11 +00:00
|
|
|
tracy_force_inline void ProcessMessageLiteral( const QueueMessageLiteral& ev );
|
2019-05-10 18:17:44 +00:00
|
|
|
tracy_force_inline void ProcessMessageColor( const QueueMessageColor& ev );
|
2020-07-25 23:15:11 +00:00
|
|
|
tracy_force_inline void ProcessMessageLiteralColor( const QueueMessageColorLiteral& ev );
|
2019-11-14 23:42:44 +00:00
|
|
|
tracy_force_inline void ProcessMessageCallstack( const QueueMessage& ev );
|
2020-07-25 23:15:11 +00:00
|
|
|
tracy_force_inline void ProcessMessageLiteralCallstack( const QueueMessageLiteral& ev );
|
2019-11-14 23:42:44 +00:00
|
|
|
tracy_force_inline void ProcessMessageColorCallstack( const QueueMessageColor& ev );
|
2020-07-25 23:15:11 +00:00
|
|
|
tracy_force_inline void ProcessMessageLiteralColorCallstack( const QueueMessageColorLiteral& ev );
|
2019-07-12 16:30:45 +00:00
|
|
|
tracy_force_inline void ProcessMessageAppInfo( const QueueMessage& ev );
|
2018-02-13 13:57:47 +00:00
|
|
|
tracy_force_inline void ProcessGpuNewContext( const QueueGpuNewContext& ev );
|
2019-10-23 22:04:31 +00:00
|
|
|
tracy_force_inline void ProcessGpuZoneBegin( const QueueGpuZoneBegin& ev, bool serial );
|
|
|
|
tracy_force_inline void ProcessGpuZoneBeginCallstack( const QueueGpuZoneBegin& ev, bool serial );
|
2021-01-15 19:33:45 +00:00
|
|
|
tracy_force_inline void ProcessGpuZoneBeginAllocSrcLoc( const QueueGpuZoneBeginLean& ev, bool serial );
|
|
|
|
tracy_force_inline void ProcessGpuZoneBeginAllocSrcLocCallstack( const QueueGpuZoneBeginLean& ev, bool serial );
|
2019-10-23 22:04:31 +00:00
|
|
|
tracy_force_inline void ProcessGpuZoneEnd( const QueueGpuZoneEnd& ev, bool serial );
|
2018-02-13 13:57:47 +00:00
|
|
|
tracy_force_inline void ProcessGpuTime( const QueueGpuTime& ev );
|
2020-07-07 18:32:25 +00:00
|
|
|
tracy_force_inline void ProcessGpuCalibration( const QueueGpuCalibration& ev );
|
2023-10-22 04:03:58 +00:00
|
|
|
tracy_force_inline void ProcessGpuTimeSync( const QueueGpuTimeSync& ev );
|
2021-01-31 17:56:03 +00:00
|
|
|
tracy_force_inline void ProcessGpuContextName( const QueueGpuContextName& ev );
|
2020-09-29 14:59:28 +00:00
|
|
|
tracy_force_inline MemEvent* ProcessMemAlloc( const QueueMemAlloc& ev );
|
|
|
|
tracy_force_inline MemEvent* ProcessMemAllocNamed( const QueueMemAlloc& ev );
|
|
|
|
tracy_force_inline MemEvent* ProcessMemFree( const QueueMemFree& ev );
|
|
|
|
tracy_force_inline MemEvent* ProcessMemFreeNamed( const QueueMemFree& ev );
|
2018-06-19 16:52:45 +00:00
|
|
|
tracy_force_inline void ProcessMemAllocCallstack( const QueueMemAlloc& ev );
|
2020-09-23 23:23:10 +00:00
|
|
|
tracy_force_inline void ProcessMemAllocCallstackNamed( const QueueMemAlloc& ev );
|
2018-06-19 16:52:45 +00:00
|
|
|
tracy_force_inline void ProcessMemFreeCallstack( const QueueMemFree& ev );
|
2020-09-23 23:23:10 +00:00
|
|
|
tracy_force_inline void ProcessMemFreeCallstackNamed( const QueueMemFree& ev );
|
2021-01-15 19:49:39 +00:00
|
|
|
tracy_force_inline void ProcessCallstackSerial();
|
2020-05-10 17:43:12 +00:00
|
|
|
tracy_force_inline void ProcessCallstack();
|
2020-07-26 12:28:13 +00:00
|
|
|
tracy_force_inline void ProcessCallstackSample( const QueueCallstackSample& ev );
|
2021-12-21 13:18:32 +00:00
|
|
|
tracy_force_inline void ProcessCallstackSampleContextSwitch( const QueueCallstackSample& ev );
|
2019-01-20 18:11:48 +00:00
|
|
|
tracy_force_inline void ProcessCallstackFrameSize( const QueueCallstackFrameSize& ev );
|
2020-09-30 13:49:29 +00:00
|
|
|
tracy_force_inline void ProcessCallstackFrame( const QueueCallstackFrame& ev, bool querySymbols );
|
2020-02-27 11:49:48 +00:00
|
|
|
tracy_force_inline void ProcessSymbolInformation( const QueueSymbolInformation& ev );
|
2018-08-20 00:07:31 +00:00
|
|
|
tracy_force_inline void ProcessCrashReport( const QueueCrashReport& ev );
|
2019-02-21 21:45:39 +00:00
|
|
|
tracy_force_inline void ProcessSysTime( const QueueSysTime& ev );
|
2023-03-10 00:02:41 +00:00
|
|
|
tracy_force_inline void ProcessSysPower( const QueueSysPower& ev );
|
2019-08-12 22:13:50 +00:00
|
|
|
tracy_force_inline void ProcessContextSwitch( const QueueContextSwitch& ev );
|
2019-08-17 15:05:29 +00:00
|
|
|
tracy_force_inline void ProcessThreadWakeup( const QueueThreadWakeup& ev );
|
2019-08-17 20:32:41 +00:00
|
|
|
tracy_force_inline void ProcessTidToPid( const QueueTidToPid& ev );
|
2021-05-19 00:31:20 +00:00
|
|
|
tracy_force_inline void ProcessHwSampleCpuCycle( const QueueHwSample& ev );
|
|
|
|
tracy_force_inline void ProcessHwSampleInstructionRetired( const QueueHwSample& ev );
|
2021-05-20 00:19:11 +00:00
|
|
|
tracy_force_inline void ProcessHwSampleCacheReference( const QueueHwSample& ev );
|
|
|
|
tracy_force_inline void ProcessHwSampleCacheMiss( const QueueHwSample& ev );
|
|
|
|
tracy_force_inline void ProcessHwSampleBranchRetired( const QueueHwSample& ev );
|
|
|
|
tracy_force_inline void ProcessHwSampleBranchMiss( const QueueHwSample& ev );
|
2019-11-25 22:59:48 +00:00
|
|
|
tracy_force_inline void ProcessParamSetup( const QueueParamSetup& ev );
|
2022-10-13 17:00:22 +00:00
|
|
|
tracy_force_inline void ProcessSourceCodeNotAvailable( const QueueSourceCodeNotAvailable& ev );
|
2019-11-29 21:41:41 +00:00
|
|
|
tracy_force_inline void ProcessCpuTopology( const QueueCpuTopology& ev );
|
2020-09-23 13:15:39 +00:00
|
|
|
tracy_force_inline void ProcessMemNamePayload( const QueueMemNamePayload& ev );
|
2024-08-03 17:55:27 +00:00
|
|
|
tracy_force_inline void ProcessThreadGroupHint( const QueueThreadGroupHint& ev );
|
2021-11-02 00:53:10 +00:00
|
|
|
tracy_force_inline void ProcessFiberEnter( const QueueFiberEnter& ev );
|
|
|
|
tracy_force_inline void ProcessFiberLeave( const QueueFiberLeave& ev );
|
2018-02-13 13:57:47 +00:00
|
|
|
|
2019-11-10 20:26:57 +00:00
|
|
|
tracy_force_inline ZoneEvent* AllocZoneEvent();
|
2018-06-21 23:07:25 +00:00
|
|
|
tracy_force_inline void ProcessZoneBeginImpl( ZoneEvent* zone, const QueueZoneBegin& ev );
|
2020-05-10 17:20:59 +00:00
|
|
|
tracy_force_inline void ProcessZoneBeginAllocSrcLocImpl( ZoneEvent* zone, const QueueZoneBeginLean& ev );
|
2019-10-23 22:04:31 +00:00
|
|
|
tracy_force_inline void ProcessGpuZoneBeginImpl( GpuEvent* zone, const QueueGpuZoneBegin& ev, bool serial );
|
2021-01-15 19:33:45 +00:00
|
|
|
tracy_force_inline void ProcessGpuZoneBeginAllocSrcLocImpl( GpuEvent* zone, const QueueGpuZoneBeginLean& ev, bool serial );
|
|
|
|
tracy_force_inline void ProcessGpuZoneBeginImplCommon( GpuEvent* zone, const QueueGpuZoneBeginLean& ev, bool serial );
|
2022-07-24 11:00:36 +00:00
|
|
|
tracy_force_inline void ProcessPlotDataImpl( uint64_t name, int64_t evTime, double val );
|
2023-04-16 16:12:14 +00:00
|
|
|
tracy_force_inline MemEvent* ProcessMemAllocImpl( MemData& memdata, const QueueMemAlloc& ev );
|
|
|
|
tracy_force_inline MemEvent* ProcessMemFreeImpl( MemData& memdata, const QueueMemFree& ev );
|
2021-11-13 01:26:11 +00:00
|
|
|
tracy_force_inline void ProcessCallstackSampleImpl( const SampleData& sd, ThreadData& td );
|
2021-12-21 13:18:14 +00:00
|
|
|
tracy_force_inline void ProcessCallstackSampleInsertSample( const SampleData& sd, ThreadData& td );
|
2021-11-13 01:40:32 +00:00
|
|
|
#ifndef TRACY_NO_STATISTICS
|
|
|
|
tracy_force_inline void ProcessCallstackSampleImplStats( const SampleData& sd, ThreadData& td );
|
|
|
|
#endif
|
2018-06-21 23:07:25 +00:00
|
|
|
|
2019-01-14 22:22:31 +00:00
|
|
|
void ZoneStackFailure( uint64_t thread, const ZoneEvent* ev );
|
2020-04-30 17:05:13 +00:00
|
|
|
void ZoneDoubleEndFailure( uint64_t thread, const ZoneEvent* ev );
|
2021-10-10 12:14:33 +00:00
|
|
|
void ZoneTextFailure( uint64_t thread, const char* text );
|
2021-10-10 12:12:13 +00:00
|
|
|
void ZoneValueFailure( uint64_t thread, uint64_t value );
|
2020-11-27 11:37:35 +00:00
|
|
|
void ZoneColorFailure( uint64_t thread );
|
2019-01-16 00:17:01 +00:00
|
|
|
void ZoneNameFailure( uint64_t thread );
|
2019-01-15 17:56:26 +00:00
|
|
|
void MemFreeFailure( uint64_t thread );
|
2021-03-09 21:10:29 +00:00
|
|
|
void MemAllocTwiceFailure( uint64_t thread );
|
2019-02-28 18:32:42 +00:00
|
|
|
void FrameEndFailure();
|
2019-06-09 11:44:53 +00:00
|
|
|
void FrameImageIndexFailure();
|
|
|
|
void FrameImageTwiceFailure();
|
2021-11-02 00:47:31 +00:00
|
|
|
void FiberLeaveFailure();
|
2023-12-31 11:58:56 +00:00
|
|
|
void SourceLocationOverflowFailure();
|
2019-01-14 22:22:31 +00:00
|
|
|
|
2018-02-13 13:57:47 +00:00
|
|
|
tracy_force_inline void CheckSourceLocation( uint64_t ptr );
|
|
|
|
void NewSourceLocation( uint64_t ptr );
|
2019-10-25 19:07:28 +00:00
|
|
|
tracy_force_inline int16_t ShrinkSourceLocation( uint64_t srcloc )
|
|
|
|
{
|
|
|
|
if( m_data.shrinkSrclocLast.first == srcloc ) return m_data.shrinkSrclocLast.second;
|
|
|
|
return ShrinkSourceLocationReal( srcloc );
|
|
|
|
}
|
|
|
|
int16_t ShrinkSourceLocationReal( uint64_t srcloc );
|
2019-08-15 15:42:26 +00:00
|
|
|
int16_t NewShrinkedSourceLocation( uint64_t srcloc );
|
2018-02-13 13:57:47 +00:00
|
|
|
|
2023-04-16 16:12:14 +00:00
|
|
|
tracy_force_inline void MemAllocChanged( MemData& memdata, int64_t time );
|
2020-09-25 14:39:00 +00:00
|
|
|
void CreateMemAllocPlot( MemData& memdata );
|
|
|
|
void ReconstructMemAllocPlot( MemData& memdata );
|
2018-04-28 13:49:12 +00:00
|
|
|
|
2019-11-10 16:23:04 +00:00
|
|
|
void InsertMessageData( MessageData* msg );
|
2018-02-13 13:57:47 +00:00
|
|
|
|
2019-08-03 12:35:01 +00:00
|
|
|
ThreadData* NoticeThreadReal( uint64_t thread );
|
2024-08-03 22:09:51 +00:00
|
|
|
ThreadData* NewThread( uint64_t thread, bool fiber, int32_t groupHint );
|
2019-10-24 20:33:48 +00:00
|
|
|
tracy_force_inline ThreadData* NoticeThread( uint64_t thread )
|
2019-08-03 12:35:01 +00:00
|
|
|
{
|
|
|
|
if( m_data.threadDataLast.first == thread ) return m_data.threadDataLast.second;
|
|
|
|
return NoticeThreadReal( thread );
|
|
|
|
}
|
2019-10-24 20:33:48 +00:00
|
|
|
ThreadData* RetrieveThreadReal( uint64_t thread );
|
|
|
|
tracy_force_inline ThreadData* RetrieveThread( uint64_t thread )
|
|
|
|
{
|
|
|
|
if( m_data.threadDataLast.first == thread ) return m_data.threadDataLast.second;
|
|
|
|
return RetrieveThreadReal( thread );
|
|
|
|
}
|
2018-02-13 13:57:47 +00:00
|
|
|
|
2021-11-06 17:55:29 +00:00
|
|
|
tracy_force_inline ThreadData* GetCurrentThreadData();
|
|
|
|
|
2019-10-25 19:29:55 +00:00
|
|
|
#ifndef TRACY_NO_STATISTICS
|
|
|
|
SourceLocationZones* GetSourceLocationZones( uint16_t srcloc )
|
|
|
|
{
|
|
|
|
if( m_data.srclocZonesLast.first == srcloc ) return m_data.srclocZonesLast.second;
|
|
|
|
return GetSourceLocationZonesReal( srcloc );
|
|
|
|
}
|
|
|
|
SourceLocationZones* GetSourceLocationZonesReal( uint16_t srcloc );
|
2022-01-23 14:46:30 +00:00
|
|
|
|
|
|
|
GpuSourceLocationZones* GetGpuSourceLocationZones( uint16_t srcloc )
|
|
|
|
{
|
|
|
|
if( m_data.gpuZonesLast.first == srcloc ) return m_data.gpuZonesLast.second;
|
|
|
|
return GetGpuSourceLocationZonesReal( srcloc );
|
|
|
|
}
|
|
|
|
GpuSourceLocationZones* GetGpuSourceLocationZonesReal( uint16_t srcloc );
|
2019-10-26 14:30:13 +00:00
|
|
|
#else
|
|
|
|
uint64_t* GetSourceLocationZonesCnt( uint16_t srcloc )
|
|
|
|
{
|
|
|
|
if( m_data.srclocCntLast.first == srcloc ) return m_data.srclocCntLast.second;
|
|
|
|
return GetSourceLocationZonesCntReal( srcloc );
|
|
|
|
}
|
|
|
|
uint64_t* GetSourceLocationZonesCntReal( uint16_t srcloc );
|
2022-01-23 14:46:30 +00:00
|
|
|
|
|
|
|
uint64_t* GetGpuSourceLocationZonesCnt( uint16_t srcloc )
|
|
|
|
{
|
|
|
|
if( m_data.gpuCntLast.first == srcloc ) return m_data.gpuCntLast.second;
|
|
|
|
return GetGpuSourceLocationZonesCntReal( srcloc );
|
|
|
|
}
|
|
|
|
uint64_t* GetGpuSourceLocationZonesCntReal( uint16_t srcloc );
|
2019-10-25 19:29:55 +00:00
|
|
|
#endif
|
|
|
|
|
2021-11-06 17:55:29 +00:00
|
|
|
tracy_force_inline void NewZone( ZoneEvent* zone );
|
2018-02-13 13:57:47 +00:00
|
|
|
|
2019-10-24 21:25:04 +00:00
|
|
|
void InsertLockEvent( LockMap& lockmap, LockEvent* lev, uint64_t thread, int64_t time );
|
2018-02-13 13:57:47 +00:00
|
|
|
|
2020-05-23 11:08:57 +00:00
|
|
|
bool CheckString( uint64_t ptr );
|
2018-02-13 13:57:47 +00:00
|
|
|
void CheckThreadString( uint64_t id );
|
2021-11-03 17:57:30 +00:00
|
|
|
void CheckFiberName( uint64_t id, uint64_t tid );
|
2019-08-16 17:22:23 +00:00
|
|
|
void CheckExternalName( uint64_t id );
|
2018-02-13 13:57:47 +00:00
|
|
|
|
|
|
|
void AddSourceLocation( const QueueSourceLocation& srcloc );
|
2023-04-16 16:08:48 +00:00
|
|
|
void AddSourceLocationPayload( const char* data, size_t sz );
|
2018-02-13 13:57:47 +00:00
|
|
|
|
2019-11-07 00:29:11 +00:00
|
|
|
void AddString( uint64_t ptr, const char* str, size_t sz );
|
|
|
|
void AddThreadString( uint64_t id, const char* str, size_t sz );
|
2021-11-03 17:57:30 +00:00
|
|
|
void AddFiberName( uint64_t id, const char* str, size_t sz );
|
2020-07-25 21:13:01 +00:00
|
|
|
void AddSingleString( const char* str, size_t sz );
|
2020-09-30 13:57:14 +00:00
|
|
|
void AddSingleStringFailure( const char* str, size_t sz );
|
2020-07-25 23:32:49 +00:00
|
|
|
void AddSecondString( const char* str, size_t sz );
|
2019-11-07 00:29:11 +00:00
|
|
|
void AddExternalName( uint64_t ptr, const char* str, size_t sz );
|
|
|
|
void AddExternalThreadName( uint64_t ptr, const char* str, size_t sz );
|
2023-04-16 16:08:48 +00:00
|
|
|
void AddFrameImageData( const char* data, size_t sz );
|
2020-03-25 19:04:55 +00:00
|
|
|
void AddSymbolCode( uint64_t ptr, const char* data, size_t sz );
|
2022-10-13 17:00:22 +00:00
|
|
|
void AddSourceCode( uint32_t id, const char* data, size_t sz );
|
2018-02-13 13:57:47 +00:00
|
|
|
|
2023-04-16 16:08:48 +00:00
|
|
|
tracy_force_inline void AddCallstackPayload( const char* data, size_t sz );
|
|
|
|
tracy_force_inline void AddCallstackAllocPayload( const char* data );
|
2021-11-27 14:06:58 +00:00
|
|
|
uint32_t MergeCallstacks( uint32_t first, uint32_t second );
|
2018-06-19 19:15:36 +00:00
|
|
|
|
2018-02-13 13:57:47 +00:00
|
|
|
void InsertPlot( PlotData* plot, int64_t time, double val );
|
2019-11-07 00:29:11 +00:00
|
|
|
void HandlePlotName( uint64_t name, const char* str, size_t sz );
|
|
|
|
void HandleFrameName( uint64_t name, const char* str, size_t sz );
|
2018-04-01 00:03:34 +00:00
|
|
|
|
2020-02-29 13:12:04 +00:00
|
|
|
void HandlePostponedSamples();
|
2020-05-31 12:31:39 +00:00
|
|
|
void HandlePostponedGhostZones();
|
2018-02-13 13:57:47 +00:00
|
|
|
|
2023-04-16 15:49:21 +00:00
|
|
|
bool IsFailureThreadStringRetrieved();
|
2020-03-29 21:01:57 +00:00
|
|
|
bool IsSourceLocationRetrieved( int16_t srcloc );
|
2020-09-29 16:39:48 +00:00
|
|
|
bool IsCallstackRetrieved( uint32_t callstack );
|
2020-03-29 21:01:57 +00:00
|
|
|
bool HasAllFailureData();
|
|
|
|
void HandleFailure( const char* ptr, const char* end );
|
|
|
|
void DispatchFailure( const QueueItem& ev, const char*& ptr );
|
|
|
|
|
2020-07-25 22:35:41 +00:00
|
|
|
uint32_t GetSingleStringIdx();
|
2020-07-25 23:32:49 +00:00
|
|
|
uint32_t GetSecondStringIdx();
|
2019-08-14 18:16:11 +00:00
|
|
|
const ContextSwitch* const GetContextSwitchDataImpl( uint64_t thread );
|
2018-02-13 13:57:47 +00:00
|
|
|
|
2022-05-01 12:25:07 +00:00
|
|
|
void CacheSource( const StringRef& str, const StringIdx& image = StringIdx() );
|
2022-03-30 14:06:35 +00:00
|
|
|
void CacheSourceFromFile( const char* fn );
|
2020-05-23 12:09:47 +00:00
|
|
|
|
2019-11-02 15:17:20 +00:00
|
|
|
tracy_force_inline Vector<short_ptr<ZoneEvent>>& GetZoneChildrenMutable( int32_t idx ) { return m_data.zoneChildren[idx]; }
|
2022-01-28 23:40:11 +00:00
|
|
|
tracy_force_inline Vector<short_ptr<GpuEvent>>& GetGpuChildrenMutable( int32_t idx ) { return m_data.gpuChildren[idx]; }
|
2020-03-18 01:20:21 +00:00
|
|
|
#ifndef TRACY_NO_STATISTICS
|
|
|
|
tracy_force_inline Vector<GhostZone>& GetGhostChildrenMutable( int32_t idx ) { return m_data.ghostChildren[idx]; }
|
|
|
|
#endif
|
2019-11-02 15:17:20 +00:00
|
|
|
|
2019-11-04 23:40:41 +00:00
|
|
|
#ifndef TRACY_NO_STATISTICS
|
|
|
|
void ReconstructContextSwitchUsage();
|
2020-05-31 12:05:16 +00:00
|
|
|
bool UpdateSampleStatistics( uint32_t callstack, uint32_t count, bool canPostpone );
|
2020-02-29 13:12:04 +00:00
|
|
|
void UpdateSampleStatisticsPostponed( decltype(Worker::DataBlock::postponedSamples.begin())& it );
|
2020-03-28 17:04:33 +00:00
|
|
|
void UpdateSampleStatisticsImpl( const CallstackFrameData** frames, uint16_t framesCount, uint32_t count, const VarArray<CallstackFrameId>& cs );
|
2020-05-31 19:17:21 +00:00
|
|
|
tracy_force_inline void GetStackWithInlines( Vector<InlineStackData>& ret, const VarArray<CallstackFrameId>& cs );
|
2020-05-31 12:51:33 +00:00
|
|
|
tracy_force_inline int AddGhostZone( const VarArray<CallstackFrameId>& cs, Vector<GhostZone>* vec, uint64_t t );
|
2019-11-04 23:40:41 +00:00
|
|
|
#endif
|
|
|
|
|
2020-02-12 19:59:36 +00:00
|
|
|
tracy_force_inline int64_t ReadTimeline( FileRead& f, ZoneEvent* zone, int64_t refTime, int32_t& childIdx );
|
|
|
|
tracy_force_inline int64_t ReadTimelineHaveSize( FileRead& f, ZoneEvent* zone, int64_t refTime, int32_t& childIdx, uint32_t sz );
|
2019-11-02 11:38:07 +00:00
|
|
|
tracy_force_inline void ReadTimeline( FileRead& f, GpuEvent* zone, int64_t& refTime, int64_t& refGpuTime, int32_t& childIdx );
|
2020-02-12 01:14:21 +00:00
|
|
|
tracy_force_inline void ReadTimelineHaveSize( FileRead& f, GpuEvent* zone, int64_t& refTime, int64_t& refGpuTime, int32_t& childIdx, uint64_t sz );
|
2018-03-15 21:54:10 +00:00
|
|
|
|
2019-11-08 22:53:43 +00:00
|
|
|
#ifndef TRACY_NO_STATISTICS
|
2021-11-14 15:42:11 +00:00
|
|
|
tracy_force_inline void ReconstructZoneStatistics( uint8_t* countMap, ZoneEvent& zone, uint16_t thread );
|
2022-01-28 23:48:01 +00:00
|
|
|
tracy_force_inline void ReconstructZoneStatistics( GpuEvent& zone, uint16_t thread );
|
2019-11-08 22:53:43 +00:00
|
|
|
#else
|
|
|
|
tracy_force_inline void CountZoneStatistics( ZoneEvent* zone );
|
2022-01-23 14:47:03 +00:00
|
|
|
tracy_force_inline void CountZoneStatistics( GpuEvent* zone );
|
2019-11-08 22:53:43 +00:00
|
|
|
#endif
|
2018-06-21 23:30:08 +00:00
|
|
|
|
2020-01-26 14:57:55 +00:00
|
|
|
tracy_force_inline ZoneExtra& GetZoneExtraMutable( const ZoneEvent& ev ) { return m_data.zoneExtra[ev.extra]; }
|
2020-02-20 22:39:40 +00:00
|
|
|
tracy_force_inline ZoneExtra& AllocZoneExtra( ZoneEvent& ev );
|
2020-02-20 22:37:55 +00:00
|
|
|
tracy_force_inline ZoneExtra& RequestZoneExtra( ZoneEvent& ev );
|
2020-01-26 14:57:55 +00:00
|
|
|
|
2023-04-30 23:28:32 +00:00
|
|
|
int64_t GetZoneEndImpl( const ZoneEvent& ev );
|
|
|
|
int64_t GetZoneEndImpl( const GpuEvent& ev );
|
|
|
|
|
2020-04-29 00:36:38 +00:00
|
|
|
void UpdateMbps( int64_t td );
|
|
|
|
|
2020-02-12 19:59:36 +00:00
|
|
|
int64_t ReadTimeline( FileRead& f, Vector<short_ptr<ZoneEvent>>& vec, uint32_t size, int64_t refTime, int32_t& childIdx );
|
2019-11-02 14:52:34 +00:00
|
|
|
void ReadTimeline( FileRead& f, Vector<short_ptr<GpuEvent>>& vec, uint64_t size, int64_t& refTime, int64_t& refGpuTime, int32_t& childIdx );
|
2018-02-13 13:57:47 +00:00
|
|
|
|
2019-11-10 15:34:38 +00:00
|
|
|
tracy_force_inline void WriteTimeline( FileWrite& f, const Vector<short_ptr<ZoneEvent>>& vec, int64_t& refTime );
|
|
|
|
tracy_force_inline void WriteTimeline( FileWrite& f, const Vector<short_ptr<GpuEvent>>& vec, int64_t& refTime, int64_t& refGpuTime );
|
|
|
|
template<typename Adapter, typename V>
|
|
|
|
void WriteTimelineImpl( FileWrite& f, const V& vec, int64_t& refTime );
|
|
|
|
template<typename Adapter, typename V>
|
|
|
|
void WriteTimelineImpl( FileWrite& f, const V& vec, int64_t& refTime, int64_t& refGpuTime );
|
2018-02-13 13:57:47 +00:00
|
|
|
|
2022-06-21 23:30:01 +00:00
|
|
|
int64_t TscTime( int64_t tsc ) { return int64_t( ( tsc - m_data.baseTime ) * m_timerMul ); }
|
|
|
|
int64_t TscTime( uint64_t tsc ) { return int64_t( ( tsc - m_data.baseTime ) * m_timerMul ); }
|
|
|
|
int64_t TscPeriod( uint64_t tsc ) { return int64_t( tsc * m_timerMul ); }
|
2018-02-13 13:57:47 +00:00
|
|
|
|
|
|
|
Socket m_sock;
|
|
|
|
std::string m_addr;
|
2020-10-02 16:51:54 +00:00
|
|
|
uint16_t m_port;
|
2018-02-13 13:57:47 +00:00
|
|
|
|
2018-04-30 01:54:09 +00:00
|
|
|
std::thread m_thread;
|
2019-10-28 21:45:10 +00:00
|
|
|
std::thread m_threadNet;
|
2019-05-27 12:09:55 +00:00
|
|
|
std::atomic<bool> m_connected { false };
|
2018-02-13 13:57:47 +00:00
|
|
|
std::atomic<bool> m_hasData;
|
2019-05-27 12:09:55 +00:00
|
|
|
std::atomic<bool> m_shutdown { false };
|
2018-02-13 13:57:47 +00:00
|
|
|
|
2019-06-02 13:00:38 +00:00
|
|
|
std::atomic<bool> m_backgroundDone { true };
|
2019-02-14 00:17:37 +00:00
|
|
|
std::thread m_threadBackground;
|
2018-04-30 01:54:09 +00:00
|
|
|
|
2018-02-13 13:57:47 +00:00
|
|
|
int64_t m_delay;
|
|
|
|
int64_t m_resolution;
|
|
|
|
double m_timerMul;
|
|
|
|
std::string m_captureName;
|
2018-08-28 22:57:11 +00:00
|
|
|
std::string m_captureProgram;
|
|
|
|
uint64_t m_captureTime;
|
2021-01-31 16:51:16 +00:00
|
|
|
uint64_t m_executableTime;
|
2018-08-19 16:21:56 +00:00
|
|
|
std::string m_hostInfo;
|
2019-08-17 20:19:04 +00:00
|
|
|
uint64_t m_pid;
|
2020-02-25 22:13:28 +00:00
|
|
|
int64_t m_samplingPeriod;
|
2019-01-06 18:04:50 +00:00
|
|
|
bool m_terminate = false;
|
|
|
|
bool m_crashed = false;
|
2019-08-01 21:14:09 +00:00
|
|
|
bool m_disconnect = false;
|
2019-11-06 00:25:38 +00:00
|
|
|
void* m_stream; // LZ4_streamDecode_t*
|
2018-02-13 13:57:47 +00:00
|
|
|
char* m_buffer;
|
|
|
|
int m_bufferOffset;
|
2018-07-11 23:21:04 +00:00
|
|
|
bool m_onDemand;
|
2019-06-13 12:15:17 +00:00
|
|
|
bool m_ignoreMemFreeFaults;
|
2023-11-19 18:09:58 +00:00
|
|
|
bool m_ignoreFrameEndFaults;
|
2020-08-15 23:31:54 +00:00
|
|
|
bool m_codeTransfer;
|
2021-06-14 23:33:43 +00:00
|
|
|
bool m_combineSamples;
|
2023-02-24 21:57:14 +00:00
|
|
|
bool m_identifySamples = false;
|
2021-10-16 14:15:19 +00:00
|
|
|
bool m_inconsistentSamples;
|
2023-11-17 20:48:17 +00:00
|
|
|
bool m_allowStringModification = false;
|
2018-02-13 13:57:47 +00:00
|
|
|
|
2019-11-02 15:29:29 +00:00
|
|
|
short_ptr<GpuCtxData> m_gpuCtxMap[256];
|
2020-09-29 15:04:41 +00:00
|
|
|
uint32_t m_pendingCallstackId = 0;
|
2020-05-10 17:20:59 +00:00
|
|
|
int16_t m_pendingSourceLocationPayload = 0;
|
2018-02-13 13:57:47 +00:00
|
|
|
Vector<uint64_t> m_sourceLocationQueue;
|
2020-01-28 20:49:36 +00:00
|
|
|
unordered_flat_map<uint64_t, int16_t> m_sourceLocationShrink;
|
|
|
|
unordered_flat_map<uint64_t, ThreadData*> m_threadMap;
|
2022-07-30 17:51:29 +00:00
|
|
|
unordered_flat_map<uint32_t, FrameData*> m_vsyncFrameMap;
|
2020-05-10 18:16:08 +00:00
|
|
|
FrameImagePending m_pendingFrameImageData = {};
|
2020-02-27 11:39:05 +00:00
|
|
|
unordered_flat_map<uint64_t, SymbolPending> m_pendingSymbols;
|
2020-05-23 12:09:47 +00:00
|
|
|
unordered_flat_set<StringRef, StringRefHasher, StringRefComparator> m_pendingFileStrings;
|
|
|
|
unordered_flat_set<StringRef, StringRefHasher, StringRefComparator> m_checkedFileStrings;
|
2020-07-25 21:13:01 +00:00
|
|
|
StringLocation m_pendingSingleString = {};
|
2020-07-25 23:32:49 +00:00
|
|
|
StringLocation m_pendingSecondString = {};
|
2018-02-13 13:57:47 +00:00
|
|
|
|
|
|
|
uint32_t m_pendingStrings;
|
|
|
|
uint32_t m_pendingThreads;
|
2021-11-03 17:57:30 +00:00
|
|
|
uint32_t m_pendingFibers;
|
2019-08-16 17:22:23 +00:00
|
|
|
uint32_t m_pendingExternalNames;
|
2018-02-13 13:57:47 +00:00
|
|
|
uint32_t m_pendingSourceLocation;
|
2018-06-20 21:42:00 +00:00
|
|
|
uint32_t m_pendingCallstackFrames;
|
2019-01-20 18:11:48 +00:00
|
|
|
uint8_t m_pendingCallstackSubframes;
|
2021-11-25 21:35:43 +00:00
|
|
|
uint32_t m_pendingSymbolCode;
|
2019-01-20 18:11:48 +00:00
|
|
|
|
|
|
|
CallstackFrameData* m_callstackFrameStaging;
|
|
|
|
uint64_t m_callstackFrameStagingPtr;
|
2019-03-03 16:34:56 +00:00
|
|
|
uint64_t m_callstackAllocNextIdx = 0;
|
2020-02-29 15:24:15 +00:00
|
|
|
uint64_t m_callstackParentNextIdx = 0;
|
2018-02-13 13:57:47 +00:00
|
|
|
|
2021-01-15 19:49:39 +00:00
|
|
|
uint32_t m_serialNextCallstack = 0;
|
2020-09-23 13:15:39 +00:00
|
|
|
uint64_t m_memNamePayload = 0;
|
2018-06-19 16:52:45 +00:00
|
|
|
|
2018-02-13 13:57:47 +00:00
|
|
|
Slab<64*1024*1024> m_slab;
|
2024-05-05 18:50:03 +00:00
|
|
|
int64_t m_memoryLimit;
|
2018-02-13 13:57:47 +00:00
|
|
|
|
|
|
|
DataBlock m_data;
|
|
|
|
MbpsBlock m_mbpsData;
|
2018-07-28 15:59:17 +00:00
|
|
|
|
2018-07-29 13:33:48 +00:00
|
|
|
int m_traceVersion;
|
2019-05-27 12:09:55 +00:00
|
|
|
std::atomic<uint8_t> m_handshake { 0 };
|
2018-07-29 13:33:48 +00:00
|
|
|
|
2018-07-28 15:59:17 +00:00
|
|
|
static LoadProgress s_loadProgress;
|
2019-01-06 18:09:50 +00:00
|
|
|
int64_t m_loadTime;
|
2019-01-14 22:22:31 +00:00
|
|
|
|
|
|
|
Failure m_failure = Failure::None;
|
2020-09-29 15:59:37 +00:00
|
|
|
FailureData m_failureData = {};
|
2019-02-21 21:45:39 +00:00
|
|
|
|
|
|
|
PlotData* m_sysTimePlot = nullptr;
|
2019-04-01 17:17:18 +00:00
|
|
|
|
2022-03-30 22:04:32 +00:00
|
|
|
Vector<ServerQueryPacket> m_serverQueryQueue, m_serverQueryQueuePrio;
|
2020-03-27 01:00:26 +00:00
|
|
|
size_t m_serverQuerySpaceLeft, m_serverQuerySpaceBase;
|
2019-06-08 10:17:18 +00:00
|
|
|
|
2020-01-28 20:49:36 +00:00
|
|
|
unordered_flat_map<uint64_t, int32_t> m_frameImageStaging;
|
2019-06-08 10:17:18 +00:00
|
|
|
char* m_frameImageBuffer = nullptr;
|
|
|
|
size_t m_frameImageBufferSize = 0;
|
2020-03-02 01:00:35 +00:00
|
|
|
TextureCompression m_texcomp;
|
2019-08-02 18:18:08 +00:00
|
|
|
|
|
|
|
uint64_t m_threadCtx = 0;
|
2019-11-10 16:17:07 +00:00
|
|
|
ThreadData* m_threadCtxData = nullptr;
|
2019-10-23 22:04:31 +00:00
|
|
|
int64_t m_refTimeThread = 0;
|
|
|
|
int64_t m_refTimeSerial = 0;
|
2019-10-25 17:13:11 +00:00
|
|
|
int64_t m_refTimeCtx = 0;
|
2019-10-25 17:52:01 +00:00
|
|
|
int64_t m_refTimeGpu = 0;
|
2019-10-28 22:22:50 +00:00
|
|
|
|
|
|
|
std::atomic<uint64_t> m_bytes { 0 };
|
|
|
|
std::atomic<uint64_t> m_decBytes { 0 };
|
|
|
|
|
|
|
|
struct NetBuffer
|
|
|
|
{
|
|
|
|
int bufferOffset;
|
|
|
|
int size;
|
|
|
|
};
|
|
|
|
|
|
|
|
std::vector<NetBuffer> m_netRead;
|
|
|
|
std::mutex m_netReadLock;
|
|
|
|
std::condition_variable m_netReadCv;
|
|
|
|
|
|
|
|
int m_netWriteCnt = 0;
|
|
|
|
std::mutex m_netWriteLock;
|
|
|
|
std::condition_variable m_netWriteCv;
|
2019-11-10 20:26:57 +00:00
|
|
|
|
2019-11-10 23:04:45 +00:00
|
|
|
#ifdef TRACY_NO_STATISTICS
|
2019-11-10 20:26:57 +00:00
|
|
|
Vector<ZoneEvent*> m_zoneEventPool;
|
2019-11-10 22:55:27 +00:00
|
|
|
#endif
|
2019-11-25 22:59:48 +00:00
|
|
|
|
|
|
|
Vector<Parameter> m_params;
|
2020-05-24 14:17:54 +00:00
|
|
|
|
|
|
|
char* m_tmpBuf = nullptr;
|
|
|
|
size_t m_tmpBufSize = 0;
|
2020-09-29 14:59:28 +00:00
|
|
|
|
|
|
|
unordered_flat_map<uint64_t, uint32_t> m_nextCallstack;
|
2022-10-13 17:00:22 +00:00
|
|
|
unordered_flat_map<uint32_t, const char*> m_sourceCodeQuery;
|
|
|
|
uint32_t m_nextSourceCodeQuery = 0;
|
2023-03-10 00:02:41 +00:00
|
|
|
|
|
|
|
unordered_flat_map<uint64_t, PowerData> m_powerData;
|
2024-05-04 12:42:40 +00:00
|
|
|
|
|
|
|
Vector<InlineStackData> m_inlineStack;
|
2024-08-03 17:55:37 +00:00
|
|
|
|
|
|
|
std::vector<uint32_t> m_pendingThreadHints;
|
2018-02-13 13:57:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|