1
0
mirror of https://github.com/wolfpld/tracy synced 2025-05-08 07:53:52 +00:00

Two plot types: user and memory.

Only user plots are saved in a dump file.
This commit is contained in:
Bartosz Taudul 2018-04-28 15:48:05 +02:00
parent 5b6d9769af
commit cd34ed6968
2 changed files with 11 additions and 0 deletions

View File

@ -212,6 +212,12 @@ struct PlotItem
double val;
};
enum class PlotType
{
User,
Memory
};
struct PlotData
{
uint64_t name;
@ -220,6 +226,7 @@ struct PlotData
Vector<PlotItem> data;
Vector<PlotItem> postpone;
uint64_t postponeTime;
PlotType type;
};
struct MemData

View File

@ -485,6 +485,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask )
for( uint64_t i=0; i<sz; i++ )
{
auto pd = m_slab.AllocInit<PlotData>();
pd->type = PlotType::User;
f.Read( &pd->name, sizeof( pd->name ) );
f.Read( &pd->min, sizeof( pd->min ) );
f.Read( &pd->max, sizeof( pd->max ) );
@ -1649,6 +1650,7 @@ void Worker::ProcessPlotData( const QueuePlotData& ev )
{
plot = m_slab.AllocInit<PlotData>();
plot->name = ev.name;
plot->type = PlotType::User;
m_pendingPlots.emplace( ev.name, plot );
ServerQuery( ServerQueryPlotName, ev.name );
}
@ -2062,9 +2064,11 @@ void Worker::Write( FileWrite& f )
}
sz = m_data.plots.size();
for( auto& plot : m_data.plots ) { if( plot->type != PlotType::User ) sz--; }
f.Write( &sz, sizeof( sz ) );
for( auto& plot : m_data.plots )
{
if( plot->type != PlotType::User ) continue;
f.Write( &plot->name, sizeof( plot->name ) );
f.Write( &plot->min, sizeof( plot->min ) );
f.Write( &plot->max, sizeof( plot->max ) );