mirror of
https://github.com/wolfpld/tracy
synced 2025-05-08 16:03:53 +00:00
Two plot types: user and memory.
Only user plots are saved in a dump file.
This commit is contained in:
parent
5b6d9769af
commit
cd34ed6968
@ -212,6 +212,12 @@ struct PlotItem
|
|||||||
double val;
|
double val;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum class PlotType
|
||||||
|
{
|
||||||
|
User,
|
||||||
|
Memory
|
||||||
|
};
|
||||||
|
|
||||||
struct PlotData
|
struct PlotData
|
||||||
{
|
{
|
||||||
uint64_t name;
|
uint64_t name;
|
||||||
@ -220,6 +226,7 @@ struct PlotData
|
|||||||
Vector<PlotItem> data;
|
Vector<PlotItem> data;
|
||||||
Vector<PlotItem> postpone;
|
Vector<PlotItem> postpone;
|
||||||
uint64_t postponeTime;
|
uint64_t postponeTime;
|
||||||
|
PlotType type;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct MemData
|
struct MemData
|
||||||
|
@ -485,6 +485,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask )
|
|||||||
for( uint64_t i=0; i<sz; i++ )
|
for( uint64_t i=0; i<sz; i++ )
|
||||||
{
|
{
|
||||||
auto pd = m_slab.AllocInit<PlotData>();
|
auto pd = m_slab.AllocInit<PlotData>();
|
||||||
|
pd->type = PlotType::User;
|
||||||
f.Read( &pd->name, sizeof( pd->name ) );
|
f.Read( &pd->name, sizeof( pd->name ) );
|
||||||
f.Read( &pd->min, sizeof( pd->min ) );
|
f.Read( &pd->min, sizeof( pd->min ) );
|
||||||
f.Read( &pd->max, sizeof( pd->max ) );
|
f.Read( &pd->max, sizeof( pd->max ) );
|
||||||
@ -1649,6 +1650,7 @@ void Worker::ProcessPlotData( const QueuePlotData& ev )
|
|||||||
{
|
{
|
||||||
plot = m_slab.AllocInit<PlotData>();
|
plot = m_slab.AllocInit<PlotData>();
|
||||||
plot->name = ev.name;
|
plot->name = ev.name;
|
||||||
|
plot->type = PlotType::User;
|
||||||
m_pendingPlots.emplace( ev.name, plot );
|
m_pendingPlots.emplace( ev.name, plot );
|
||||||
ServerQuery( ServerQueryPlotName, ev.name );
|
ServerQuery( ServerQueryPlotName, ev.name );
|
||||||
}
|
}
|
||||||
@ -2062,9 +2064,11 @@ void Worker::Write( FileWrite& f )
|
|||||||
}
|
}
|
||||||
|
|
||||||
sz = m_data.plots.size();
|
sz = m_data.plots.size();
|
||||||
|
for( auto& plot : m_data.plots ) { if( plot->type != PlotType::User ) sz--; }
|
||||||
f.Write( &sz, sizeof( sz ) );
|
f.Write( &sz, sizeof( sz ) );
|
||||||
for( auto& plot : m_data.plots )
|
for( auto& plot : m_data.plots )
|
||||||
{
|
{
|
||||||
|
if( plot->type != PlotType::User ) continue;
|
||||||
f.Write( &plot->name, sizeof( plot->name ) );
|
f.Write( &plot->name, sizeof( plot->name ) );
|
||||||
f.Write( &plot->min, sizeof( plot->min ) );
|
f.Write( &plot->min, sizeof( plot->min ) );
|
||||||
f.Write( &plot->max, sizeof( plot->max ) );
|
f.Write( &plot->max, sizeof( plot->max ) );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user