Reformat chunk summary table, include size per-chunk

This commit is contained in:
baldurk
2014-09-03 23:12:54 +01:00
parent 04335a7179
commit 9622c7ba22
+20 -7
View File
@@ -926,8 +926,9 @@ void WrappedID3D11Device::ReadLogInitialisation()
struct chunkinfo
{
chunkinfo() : count(0), total(0.0) {}
chunkinfo() : count(0), totalsize(0), total(0.0) {}
int count;
uint64_t totalsize;
double total;
};
@@ -954,14 +955,20 @@ void WrappedID3D11Device::ReadLogInitialisation()
if(context == CAPTURE_SCOPE)
{
m_pImmediateContext->ReplayLog(READING, 0, 0, false);
}
uint64_t offset2 = m_pSerialiser->GetOffset();
chunkInfos[context].total += timer.GetMilliseconds();
chunkInfos[context].totalsize += offset2 - offset;
chunkInfos[context].count++;
if(context == CAPTURE_SCOPE)
{
if(m_pSerialiser->GetOffset() > lastFrame)
break;
}
chunkInfos[context].total += timer.GetMilliseconds();
chunkInfos[context].count++;
if(m_pSerialiser->AtEnd())
{
break;
@@ -970,9 +977,15 @@ void WrappedID3D11Device::ReadLogInitialisation()
for(auto it=chunkInfos.begin(); it != chunkInfos.end(); ++it)
{
RDCDEBUG("%hs: %.3f total time in %d chunks - %.3f average",
GetChunkName(it->first), it->second.total, it->second.count,
it->second.total/double(it->second.count));
double dcount = double(it->second.count);
RDCDEBUG("% 5d chunks - Time: %9.3fms total/%9.3fms avg - Size: %8.3fMB total/%7.3fMB avg - %hs (%u)",
it->second.count,
it->second.total, it->second.total/dcount,
double(it->second.totalsize)/(1024.0*1024.0),
double(it->second.totalsize)/(dcount*1024.0*1024.0),
GetChunkName(it->first), uint32_t(it->first)
);
}
RDCDEBUG("Allocating %llu persistant bytes of memory for the log.", m_pSerialiser->GetSize() - firstFrame);