This commit is contained in:
Wojtek Figat
2021-07-06 15:33:28 +02:00
parent 1c012a202e
commit 9f9d946d69
3 changed files with 7 additions and 3 deletions

View File

@@ -137,7 +137,7 @@ void PlatformBase::LogInfo()
LOG(Info, "CPU package count: {0}, Core count: {1}, Logical processors: {2}", cpuInfo.ProcessorPackageCount, cpuInfo.ProcessorCoreCount, cpuInfo.LogicalProcessorCount);
LOG(Info, "CPU Page size: {0}, cache line size: {1} bytes", Utilities::BytesToText(cpuInfo.PageSize), cpuInfo.CacheLineSize);
LOG(Info, "L1 cache: {0}, L2 cache: {1}, L3 cache: {2}", Utilities::BytesToText(cpuInfo.L1CacheSize), Utilities::BytesToText(cpuInfo.L2CacheSize), Utilities::BytesToText(cpuInfo.L3CacheSize));
LOG(Info, "Clock speed: {0} GHz", Utilities::RoundTo2DecimalPlaces(cpuInfo.ClockSpeed * 0.000001f));
LOG(Info, "Clock speed: {0} GHz", Utilities::RoundTo2DecimalPlaces(cpuInfo.ClockSpeed * 1e-9f));
const MemoryStats memStats = Platform::GetMemoryStats();
LOG(Info, "Physical Memory: {0} total, {1} used ({2}%)", Utilities::BytesToText(memStats.TotalPhysicalMemory), Utilities::BytesToText(memStats.UsedPhysicalMemory), Utilities::RoundTo2DecimalPlaces((float)memStats.UsedPhysicalMemory * 100.0f / (float)memStats.TotalPhysicalMemory));
@@ -167,12 +167,14 @@ void PlatformBase::Exit()
#if COMPILE_WITH_PROFILER
#define TRACY_ENABLE_MEMORY (TRACY_ENABLE && !USE_EDITOR)
void PlatformBase::OnMemoryAlloc(void* ptr, uint64 size)
{
if (!ptr)
return;
#if TRACY_ENABLE && !USE_EDITOR
#if TRACY_ENABLE_MEMORY
// Track memory allocation in Tracy
//tracy::Profiler::MemAlloc(ptr, size, false);
tracy::Profiler::MemAllocCallstack(ptr, size, 12, false);
@@ -195,7 +197,7 @@ void PlatformBase::OnMemoryFree(void* ptr)
if (!ptr)
return;
#if TRACY_ENABLE
#if TRACY_ENABLE_MEMORY
// Track memory allocation in Tracy
tracy::Profiler::MemFree(ptr, false);
#endif