Deprecate profiler categories based on global enum
(to be supplanted by registered budgets in the future) Signed-off-by: Jeremy Ong <jcong@amazon.com>
This commit is contained in:
@@ -43,32 +43,25 @@ enum EProfiledSubsystem
|
||||
};
|
||||
#undef X
|
||||
|
||||
static_assert(static_cast<AZ::Debug::ProfileCategory>(PROFILE_LAST_SUBSYSTEM) == AZ::Debug::ProfileCategory::LegacyLast, "Mismatched AZ and Legacy profile categories");
|
||||
#include <AzCore/Debug/EventTrace.h>
|
||||
|
||||
|
||||
|
||||
#define FUNCTION_PROFILER_LEGACYONLY(pISystem, subsystem)
|
||||
|
||||
#define FUNCTION_PROFILER(pISystem, subsystem) \
|
||||
AZ_PROFILE_FUNCTION(static_cast<AZ::Debug::ProfileCategory>(subsystem));
|
||||
#define FUNCTION_PROFILER(pISystem, subsystem)
|
||||
|
||||
#define FUNCTION_PROFILER_FAST(pISystem, subsystem, bProfileEnabled) \
|
||||
AZ_PROFILE_FUNCTION(static_cast<AZ::Debug::ProfileCategory>(subsystem));
|
||||
#define FUNCTION_PROFILER_FAST(pISystem, subsystem, bProfileEnabled)
|
||||
|
||||
#define FUNCTION_PROFILER_ALWAYS(pISystem, subsystem) \
|
||||
AZ_PROFILE_FUNCTION(static_cast<AZ::Debug::ProfileCategory>(subsystem));
|
||||
#define FUNCTION_PROFILER_ALWAYS(pISystem, subsystem)
|
||||
|
||||
#define FRAME_PROFILER_LEGACYONLY(szProfilerName, pISystem, subsystem)
|
||||
|
||||
#define FRAME_PROFILER(szProfilerName, pISystem, subsystem) \
|
||||
AZ_PROFILE_SCOPE(static_cast<AZ::Debug::ProfileCategory>(subsystem), szProfilerName);
|
||||
#define FRAME_PROFILER(szProfilerName, pISystem, subsystem)
|
||||
|
||||
#define FRAME_PROFILER_FAST(szProfilerName, pISystem, subsystem, bProfileEnabled) \
|
||||
AZ_PROFILE_SCOPE(static_cast<AZ::Debug::ProfileCategory>(subsystem), szProfilerName);
|
||||
#define FRAME_PROFILER_FAST(szProfilerName, pISystem, subsystem, bProfileEnabled)
|
||||
|
||||
#define FUNCTION_PROFILER_SYS(subsystem) \
|
||||
FUNCTION_PROFILER(gEnv->pSystem, PROFILE_##subsystem)
|
||||
#define FUNCTION_PROFILER_SYS(subsystem)
|
||||
|
||||
#define STALL_PROFILER(cause)
|
||||
|
||||
|
||||
@@ -1151,10 +1151,10 @@ struct DiskOperationInfo
|
||||
|
||||
#if defined(ENABLE_LOADING_PROFILER) && AZ_PROFILE_TELEMETRY
|
||||
|
||||
#define LOADING_TIME_PROFILE_SECTION AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore)
|
||||
#define LOADING_TIME_PROFILE_SECTION_ARGS(...) AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, __VA_ARGS__)
|
||||
#define LOADING_TIME_PROFILE_SECTION_NAMED(sectionName) AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzCore, sectionName)
|
||||
#define LOADING_TIME_PROFILE_SECTION_NAMED_ARGS(sectionName, ...) AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, sectionName, __VA_ARGS__)
|
||||
#define LOADING_TIME_PROFILE_SECTION AZ_PROFILE_FUNCTION(AzCore)
|
||||
#define LOADING_TIME_PROFILE_SECTION_ARGS(...) AZ_PROFILE_SCOPE(AzCore, __VA_ARGS__)
|
||||
#define LOADING_TIME_PROFILE_SECTION_NAMED(sectionName) AZ_PROFILE_SCOPE(AzCore, sectionName)
|
||||
#define LOADING_TIME_PROFILE_SECTION_NAMED_ARGS(sectionName, ...) AZ_PROFILE_SCOPE(AzCore, sectionName, __VA_ARGS__)
|
||||
|
||||
#else
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace AZ
|
||||
}
|
||||
|
||||
pointer_type ptr = m_schema->Allocate(byteSize, alignment, flags, name, fileName, lineNum, suppressStackRecord);
|
||||
AZ_PROFILE_MEMORY_ALLOC_EX(AZ::Debug::ProfileCategory::MemoryReserved, fileName, lineNum, ptr, byteSize, name ? name : GetName());
|
||||
AZ_PROFILE_MEMORY_ALLOC_EX(MemoryReserved, fileName, lineNum, ptr, byteSize, name ? name : GetName());
|
||||
AZ_MEMORY_PROFILE(ProfileAllocation(ptr, byteSize, alignment, name, fileName, lineNum, suppressStackRecord));
|
||||
AZ_Assert(ptr || byteSize == 0, "OOM - Failed to allocate %zu bytes from LegacyAllocator", byteSize);
|
||||
return ptr;
|
||||
@@ -78,7 +78,7 @@ namespace AZ
|
||||
// DeAllocate with file/line, to track when allocs were freed from Cry
|
||||
void DeAllocate(pointer_type ptr, [[maybe_unused]] const char* file, [[maybe_unused]] const int line, size_type byteSize = 0, size_type alignment = 0)
|
||||
{
|
||||
AZ_PROFILE_MEMORY_FREE_EX(AZ::Debug::ProfileCategory::MemoryReserved, file, line, ptr);
|
||||
AZ_PROFILE_MEMORY_FREE_EX(MemoryReserved, file, line, ptr);
|
||||
AZ_MEMORY_PROFILE(ProfileDeallocation(ptr, byteSize, alignment, nullptr));
|
||||
m_schema->DeAllocate(ptr, byteSize, alignment);
|
||||
}
|
||||
@@ -94,9 +94,9 @@ namespace AZ
|
||||
}
|
||||
|
||||
AZ_MEMORY_PROFILE(ProfileReallocationBegin(ptr, newSize));
|
||||
AZ_PROFILE_MEMORY_FREE_EX(AZ::Debug::ProfileCategory::MemoryReserved, file, line, ptr);
|
||||
AZ_PROFILE_MEMORY_FREE_EX(MemoryReserved, file, line, ptr);
|
||||
pointer_type newPtr = m_schema->ReAllocate(ptr, newSize, newAlignment);
|
||||
AZ_PROFILE_MEMORY_ALLOC_EX(AZ::Debug::ProfileCategory::MemoryReserved, file, line, newPtr, newSize, "LegacyAllocator Realloc");
|
||||
AZ_PROFILE_MEMORY_ALLOC_EX(MemoryReserved, file, line, newPtr, newSize, "LegacyAllocator Realloc");
|
||||
AZ_MEMORY_PROFILE(ProfileReallocationEnd(ptr, newPtr, newSize, newAlignment));
|
||||
AZ_Assert(newPtr || newSize == 0, "OOM - Failed to reallocate %zu bytes from LegacyAllocator", newSize);
|
||||
return newPtr;
|
||||
|
||||
@@ -203,7 +203,7 @@ void __stl_debug_message(const char* format_str, ...)
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CrySleep(unsigned int dwMilliseconds)
|
||||
{
|
||||
AZ_PROFILE_FUNCTION_IDLE(AZ::Debug::ProfileCategory::System);
|
||||
AZ_PROFILE_FUNCTION(System);
|
||||
Sleep(dwMilliseconds);
|
||||
}
|
||||
|
||||
|
||||
@@ -701,7 +701,7 @@ void CSystem::SleepIfNeeded()
|
||||
int sleepMS = (int)(1000.0f * sleepTime + 0.5f);
|
||||
if (sleepMS > 0)
|
||||
{
|
||||
AZ_PROFILE_FUNCTION_IDLE(AZ::Debug::ProfileCategory::System);
|
||||
AZ_PROFILE_FUNCTION(System);
|
||||
Sleep(sleepMS);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user