Remove RAD (pending future interface for external profiler registration)

Signed-off-by: Jeremy Ong <jcong@amazon.com>
This commit is contained in:
Jeremy Ong
2021-08-18 17:20:27 -06:00
parent 11d4543442
commit ec6e9407f6
44 changed files with 12 additions and 1184 deletions
@@ -11,7 +11,6 @@
#include <AzCore/Component/Component.h>
#include <AzCore/Component/Entity.h>
#include <AzCore/Component/TickBus.h>
#include <AzCore/Debug/ProfileModuleInit.h>
#include <AzCore/Memory/AllocationRecords.h>
#include <AzCore/Memory/OSAllocator.h>
#include <AzCore/Module/DynamicModuleHandle.h>
@@ -38,17 +38,6 @@ namespace AZ
}
}
#ifdef AZ_PROFILE_TELEMETRY
# define AZ_TRACE_METHOD_NAME_CATEGORY(name, category) AZ::Debug::EventTrace::ScopedSlice AZ_JOIN(ScopedSlice__, __LINE__)(name, category);
# define AZ_TRACE_METHOD_NAME(name) \
AZ_TRACE_METHOD_NAME_CATEGORY(name, "") \
AZ_PROFILE_SCOPE(AzTrace, name)
# define AZ_TRACE_METHOD() \
AZ_TRACE_METHOD_NAME_CATEGORY(AZ_FUNCTION_SIGNATURE, "") \
AZ_PROFILE_FUNCTION(AzTrace)
#else
# define AZ_TRACE_METHOD_NAME_CATEGORY(name, category)
# define AZ_TRACE_METHOD_NAME(name) AZ_TRACE_METHOD_NAME_CATEGORY(name, "")
# define AZ_TRACE_METHOD() AZ_TRACE_METHOD_NAME(AZ_FUNCTION_SIGNATURE)
#endif
#define AZ_TRACE_METHOD_NAME_CATEGORY(name, category)
#define AZ_TRACE_METHOD_NAME(name) AZ_TRACE_METHOD_NAME_CATEGORY(name, "")
#define AZ_TRACE_METHOD() AZ_TRACE_METHOD_NAME(AZ_FUNCTION_SIGNATURE)
@@ -1,53 +0,0 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#include <AzCore/Debug/ProfileModuleInit.h>
#ifdef AZ_PROFILE_TELEMETRY
# include <RADTelemetry/ProfileTelemetryBus.h>
// Define the per-module RAD Telemetry instance pointer
struct tm_api;
tm_api* g_radTmApi;
#endif
namespace AZ
{
namespace Debug
{
void ProfileModuleInit()
{
#if defined(AZ_PROFILE_TELEMETRY)
{
if (!g_radTmApi)
{
using namespace RADTelemetry;
ProfileTelemetryRequestBus::BroadcastResult(g_radTmApi, &ProfileTelemetryRequests::GetApiInstance);
}
}
#endif
// Add additional per-DLL required profiler initialization here
}
ProfileModuleInitializer::ProfileModuleInitializer()
{
ProfilerNotificationBus::Handler::BusConnect();
}
ProfileModuleInitializer::~ProfileModuleInitializer()
{
ProfilerNotificationBus::Handler::BusDisconnect();
}
void ProfileModuleInitializer::OnProfileSystemInitialized()
{
ProfileModuleInit();
}
}
}
@@ -1,36 +0,0 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include <AzCore/Debug/ProfilerBus.h>
namespace AZ
{
namespace Debug
{
//! Perform any required per-module initialization of the current profiler
void ProfileModuleInit();
/*!
* ProfileModuleInitializer
* Helper class that calls ProfileModuleInit when OnProfileSystemInitialized is fired.
*/
class ProfileModuleInitializer
: private AZ::Debug::ProfilerNotificationBus::Handler
{
public:
ProfileModuleInitializer();
~ProfileModuleInitializer() override;
private:
void OnProfileSystemInitialized() override;
};
}
}
@@ -15,10 +15,6 @@
#include <WinPixEventRuntime/pix3.h>
#endif
#ifdef AZ_PROFILE_TELEMETRY
# include <RADTelemetry/ProfileTelemetry.h>
#endif
#if defined(AZ_PROFILER_MACRO_DISABLE) // by default we never disable the profiler registers as their overhead should be minimal, you can still do that for your code though.
# define AZ_PROFILE_SCOPE(...)
# define AZ_PROFILE_FUNCTION(...)
@@ -38,7 +34,6 @@
#endif // AZ_PROFILER_MACRO_DISABLE
#ifndef AZ_PROFILE_INTERVAL_START
// No other profiler has defined the performance markers AZ_PROFILE_INTERVAL_START/END, fallback to a Driller implementation (currently empty)
# define AZ_PROFILE_INTERVAL_START(...)
# define AZ_PROFILE_INTERVAL_START_COLORED(...)
# define AZ_PROFILE_INTERVAL_END(...)
@@ -46,7 +41,6 @@
#endif
#ifndef AZ_PROFILE_DATAPOINT
// No other profiler has defined the performance markers AZ_PROFILE_DATAPOINT, fallback to a Driller implementation (currently empty)
# define AZ_PROFILE_DATAPOINT(...)
# define AZ_PROFILE_DATAPOINT_PERCENT(...)
#endif
@@ -9,7 +9,6 @@
#define AZCORE_MODULE_INCLUDE_H 1
#include <AzCore/Component/Component.h>
#include <AzCore/Debug/ProfileModuleInit.h>
#include <AzCore/Memory/SystemAllocator.h>
#include <AzCore/Module/Environment.h>
#include <AzCore/Interface/Interface.h>
@@ -78,9 +77,6 @@ namespace AZ
protected:
AZStd::list<AZ::ComponentDescriptor*> m_descriptors;
private:
AZ::Debug::ProfileModuleInitializer m_moduleProfilerInit;
};
} // namespace AZ
@@ -287,14 +287,6 @@ void ScriptSystemComponent::OnSystemTick()
contextContainer.m_context->GetDebugContext()->ProcessDebugCommands();
}
#ifdef AZ_PROFILE_TELEMETRY
if (contextContainer.m_context->GetId() == ScriptContextIds::DefaultScriptContextId)
{
size_t memoryUsageBytes = contextContainer.m_context->GetMemoryUsage();
AZ_PROFILE_DATAPOINT(Script, memoryUsageBytes / 1024.0, "Script Memory (KB)");
}
#endif // AZ_PROFILE_TELEMETRY
contextContainer.m_context->GarbageCollectStep(contextContainer.m_garbageCollectorSteps);
}
}
@@ -17,7 +17,7 @@
#include <AzCore/Debug/Profiler.h>
#if !defined(AZ_PROFILE_TELEMETRY) && defined(AZ_STATISTICAL_PROFILING_ENABLED)
#if defined(AZ_STATISTICAL_PROFILING_ENABLED)
#if defined(AZ_PROFILE_SCOPE)
#undef AZ_PROFILE_SCOPE
@@ -27,7 +27,7 @@
static const AZStd::string AZ_JOIN(blockName, __LINE__)(scopeNameId); \
AZ::Statistics::StatisticalProfilerProxy::TimedScope AZ_JOIN(scope, __LINE__)(profiler, AZ_JOIN(blockName, __LINE__));
#endif //#if !defined(AZ_PROFILE_TELEMETRY)
#endif //#if defined(AZ_STATISTICAL_PROFILING_ENABLED)
namespace AZ::Statistics
{
@@ -100,8 +100,6 @@ set(FILES
Debug/FrameProfilerComponent.h
Debug/IEventLogger.h
Debug/MemoryProfiler.h
Debug/ProfileModuleInit.cpp
Debug/ProfileModuleInit.h
Debug/Profiler.cpp
Debug/Profiler.h
Debug/ProfilerBus.h