Removes VTUNE profiler hooks from Cry (#5291)
* Removes VTUNE profiler hooks from Cry Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> * some more vtune cleanup Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
@@ -143,9 +143,6 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
#include <AzFramework/Input/Buses/Notifications/RawInputNotificationBus_Platform.h>
|
||||
|
||||
// To enable profiling with vtune (https://software.intel.com/en-us/intel-vtune-amplifier-xe), make sure the line below is not commented out
|
||||
//#define PROFILE_WITH_VTUNE
|
||||
|
||||
#include <process.h>
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
@@ -154,10 +151,6 @@ LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
|
||||
#include <AzFramework/IO/LocalFileIO.h>
|
||||
|
||||
// profilers api.
|
||||
VTuneFunction VTResume = NULL;
|
||||
VTuneFunction VTPause = NULL;
|
||||
|
||||
// Define global cvars.
|
||||
SSystemCVars g_cvars;
|
||||
|
||||
@@ -697,31 +690,6 @@ bool CSystem::UpdatePreTickBus(int updateFlags, int nPauseMode)
|
||||
m_bPaused = false;
|
||||
}
|
||||
|
||||
#ifdef PROFILE_WITH_VTUNE
|
||||
if (m_bInDevMode)
|
||||
{
|
||||
if (VTPause != NULL && VTResume != NULL)
|
||||
{
|
||||
static bool bVtunePaused = true;
|
||||
|
||||
const AzFramework::InputChannel* inputChannelScrollLock = AzFramework::InputChannelRequests::FindInputChannel(AzFramework::InputDeviceKeyboard::Key::WindowsSystemScrollLock);
|
||||
const bool bPaused = (inputChannelScrollLock ? inputChannelScrollLock->IsActive() : false);
|
||||
|
||||
{
|
||||
if (bVtunePaused && !bPaused)
|
||||
{
|
||||
GetIProfilingSystem()->VTuneResume();
|
||||
}
|
||||
if (!bVtunePaused && bPaused)
|
||||
{
|
||||
GetIProfilingSystem()->VTunePause();
|
||||
}
|
||||
bVtunePaused = bPaused;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif //PROFILE_WITH_VTUNE
|
||||
|
||||
#ifndef EXCLUDE_UPDATE_ON_CONSOLE
|
||||
if (m_bIgnoreUpdates)
|
||||
{
|
||||
@@ -1255,30 +1223,6 @@ CPNoise3* CSystem::GetNoiseGen()
|
||||
return &m_pNoiseGen;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CProfilingSystem::VTuneResume()
|
||||
{
|
||||
#ifdef PROFILE_WITH_VTUNE
|
||||
if (VTResume)
|
||||
{
|
||||
CryLogAlways("VTune Resume");
|
||||
VTResume();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CProfilingSystem::VTunePause()
|
||||
{
|
||||
#ifdef PROFILE_WITH_VTUNE
|
||||
if (VTPause)
|
||||
{
|
||||
VTPause();
|
||||
CryLogAlways("VTune Pause");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
void CSystem::OnLanguageCVarChanged(ICVar* language)
|
||||
{
|
||||
|
||||
@@ -105,10 +105,6 @@ struct IDataProbe;
|
||||
|
||||
#define PHSYICS_OBJECT_ENTITY 0
|
||||
|
||||
using VTuneFunction = void (__cdecl *)(void);
|
||||
extern VTuneFunction VTResume;
|
||||
extern VTuneFunction VTPause;
|
||||
|
||||
#define MAX_STREAMING_POOL_INDEX 6
|
||||
#define MAX_THREAD_POOL_INDEX 6
|
||||
|
||||
@@ -139,7 +135,6 @@ struct SSystemCVars
|
||||
int sys_ai;
|
||||
int sys_entitysystem;
|
||||
int sys_trackview;
|
||||
int sys_vtune;
|
||||
float sys_update_profile_time;
|
||||
int sys_limit_phys_thread_count;
|
||||
int sys_MaxFPS;
|
||||
@@ -169,21 +164,6 @@ extern SSystemCVars g_cvars;
|
||||
|
||||
class CSystem;
|
||||
|
||||
struct CProfilingSystem
|
||||
: public IProfilingSystem
|
||||
{
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// VTune Profiling interface.
|
||||
|
||||
// Summary:
|
||||
// Resumes vtune data collection.
|
||||
void VTuneResume() override;
|
||||
// Summary:
|
||||
// Pauses vtune data collection.
|
||||
void VTunePause() override;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
};
|
||||
|
||||
class AssetSystem;
|
||||
|
||||
/*
|
||||
@@ -262,7 +242,6 @@ public:
|
||||
IViewSystem* GetIViewSystem() override;
|
||||
ILevelSystem* GetILevelSystem() override;
|
||||
ISystemEventDispatcher* GetISystemEventDispatcher() override { return m_pSystemEventDispatcher; }
|
||||
IProfilingSystem* GetIProfilingSystem() override { return &m_ProfilingSystem; }
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// retrieves the perlin noise singleton instance
|
||||
CPNoise3* GetNoiseGen() override;
|
||||
@@ -564,8 +543,6 @@ private: // ------------------------------------------------------
|
||||
ESystemConfigSpec m_nMaxConfigSpec;
|
||||
ESystemConfigPlatform m_ConfigPlatform;
|
||||
|
||||
CProfilingSystem m_ProfilingSystem;
|
||||
|
||||
// Pause mode.
|
||||
bool m_bPaused;
|
||||
bool m_bNoUpdate;
|
||||
@@ -588,8 +565,6 @@ public:
|
||||
const SFileVersion& GetProductVersion() override;
|
||||
const SFileVersion& GetBuildVersion() override;
|
||||
|
||||
bool InitVTuneProfiler();
|
||||
|
||||
void OpenPlatformPaks();
|
||||
void OpenLanguagePak(const char* sLanguage);
|
||||
void OpenLanguageAudioPak(const char* sLanguage);
|
||||
|
||||
@@ -70,9 +70,6 @@
|
||||
#include "windows.h"
|
||||
#include <float.h>
|
||||
|
||||
// To enable profiling with vtune (https://software.intel.com/en-us/intel-vtune-amplifier-xe), make sure the line below is not commented out
|
||||
//#define PROFILE_WITH_VTUNE
|
||||
|
||||
#endif //WIN32
|
||||
|
||||
#include <IRenderer.h>
|
||||
@@ -681,33 +678,6 @@ bool CSystem::InitAudioSystem(const SSystemInitParams& initParams)
|
||||
return result;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool CSystem::InitVTuneProfiler()
|
||||
{
|
||||
#ifdef PROFILE_WITH_VTUNE
|
||||
|
||||
WIN_HMODULE hModule = LoadDLL("VTuneApi.dll");
|
||||
if (!hModule)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
VTPause = (VTuneFunction) CryGetProcAddress(hModule, "VTPause");
|
||||
VTResume = (VTuneFunction) CryGetProcAddress(hModule, "VTResume");
|
||||
if (!VTPause || !VTResume)
|
||||
{
|
||||
AZ_Assert(false, "VTune did not initialize correctly.")
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
AZ_TracePrintf(AZ_TRACE_SYSTEM_WINDOW, "VTune API Initialized");
|
||||
}
|
||||
#endif //PROFILE_WITH_VTUNE
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CSystem::InitLocalization()
|
||||
{
|
||||
@@ -1682,8 +1652,6 @@ void CSystem::CreateSystemVars()
|
||||
m_sys_memory_debug = REGISTER_INT("sys_memory_debug", 0, VF_CHEAT,
|
||||
"Enables to activate low memory situation is specific places in the code (argument defines which place), 0=off");
|
||||
|
||||
REGISTER_CVAR2("sys_vtune", &g_cvars.sys_vtune, 0, VF_NULL, "");
|
||||
|
||||
#if defined(AZ_RESTRICTED_PLATFORM)
|
||||
#define AZ_RESTRICTED_SECTION SYSTEMINIT_CPP_SECTION_17
|
||||
#include AZ_RESTRICTED_FILE(SystemInit_cpp)
|
||||
|
||||
Reference in New Issue
Block a user