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:
@@ -548,7 +548,6 @@ public:
|
||||
{ "BatchMode", m_bConsoleMode },
|
||||
{ "NullRenderer", m_bNullRenderer },
|
||||
{ "devmode", m_bDeveloperMode },
|
||||
{ "VTUNE", dummy },
|
||||
{ "runpython", m_bRunPythonScript },
|
||||
{ "runpythontest", m_bRunPythonTestScript },
|
||||
{ "version", m_bShowVersionInfo },
|
||||
|
||||
@@ -60,15 +60,6 @@
|
||||
#include <LmbrCentral/Audio/AudioSystemComponentBus.h>
|
||||
#include <LmbrCentral/Rendering/EditorLightComponentBus.h> // for LmbrCentral::EditorLightComponentRequestBus
|
||||
|
||||
//#define PROFILE_LOADING_WITH_VTUNE
|
||||
|
||||
// profilers api.
|
||||
//#include "pure.h"
|
||||
#ifdef PROFILE_LOADING_WITH_VTUNE
|
||||
#include "C:\Program Files\Intel\Vtune\Analyzer\Include\VTuneApi.h"
|
||||
#pragma comment(lib,"C:\\Program Files\\Intel\\Vtune\\Analyzer\\Lib\\VTuneApi.lib")
|
||||
#endif
|
||||
|
||||
static const char* kAutoBackupFolder = "_autobackup";
|
||||
static const char* kHoldFolder = "$tmp_hold"; // conform to the ignored file types $tmp[0-9]*_ regex
|
||||
static const char* kSaveBackupFolder = "_savebackup";
|
||||
@@ -408,9 +399,6 @@ void CCryEditDoc::Load(TDocMultiArchive& arrXmlAr, const QString& szFilename)
|
||||
|
||||
int t0 = GetTickCount();
|
||||
|
||||
#ifdef PROFILE_LOADING_WITH_VTUNE
|
||||
VTResume();
|
||||
#endif
|
||||
// Load level-specific audio data.
|
||||
AZStd::string levelFileName{ fileName.toUtf8().constData() };
|
||||
AZStd::to_lower(levelFileName.begin(), levelFileName.end());
|
||||
@@ -484,10 +472,6 @@ void CCryEditDoc::Load(TDocMultiArchive& arrXmlAr, const QString& szFilename)
|
||||
|
||||
CSurfaceTypeValidator().Validate();
|
||||
|
||||
#ifdef PROFILE_LOADING_WITH_VTUNE
|
||||
VTPause();
|
||||
#endif
|
||||
|
||||
LogLoadTime(GetTickCount() - t0);
|
||||
// Loaded with success, remove event from log file
|
||||
GetIEditor()->GetSettingsManager()->UnregisterEvent(loadEvent);
|
||||
|
||||
@@ -739,24 +739,6 @@ public:
|
||||
#undef GetUserName
|
||||
#endif
|
||||
|
||||
|
||||
struct IProfilingSystem
|
||||
{
|
||||
// <interfuscator:shuffle>
|
||||
virtual ~IProfilingSystem() {}
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// VTune Profiling interface.
|
||||
|
||||
// Summary:
|
||||
// Resumes vtune data collection.
|
||||
virtual void VTuneResume() = 0;
|
||||
// Summary:
|
||||
// Pauses vtune data collection.
|
||||
virtual void VTunePause() = 0;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// </interfuscator:shuffle>
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Description:
|
||||
@@ -851,7 +833,6 @@ struct ISystem
|
||||
virtual IMovieSystem* GetIMovieSystem() = 0;
|
||||
virtual ::IConsole* GetIConsole() = 0;
|
||||
virtual IRemoteConsole* GetIRemoteConsole() = 0;
|
||||
virtual IProfilingSystem* GetIProfilingSystem() = 0;
|
||||
virtual ISystemEventDispatcher* GetISystemEventDispatcher() = 0;
|
||||
|
||||
virtual ITimer* GetITimer() = 0;
|
||||
|
||||
@@ -76,8 +76,6 @@ public:
|
||||
::IConsole * ());
|
||||
MOCK_METHOD0(GetIRemoteConsole,
|
||||
IRemoteConsole * ());
|
||||
MOCK_METHOD0(GetIProfilingSystem,
|
||||
IProfilingSystem * ());
|
||||
MOCK_METHOD0(GetISystemEventDispatcher,
|
||||
ISystemEventDispatcher * ());
|
||||
MOCK_METHOD0(GetITimer,
|
||||
|
||||
@@ -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