Disabled Profiler if STATS is not enabled (so Editor can compile also when ENABLE_STATNAMEDEVENTS is on).

#jira UE-140874
#fyi Brandon.Schaefer
#preflight 6201451e6773a3612898bddb
#rb none

[CL 18886574 by ionut matasaru in ue5-main branch]
This commit is contained in:
ionut matasaru
2022-02-07 11:35:37 -05:00
parent d2f594bb15
commit 1502e84e56
47 changed files with 229 additions and 11 deletions
@@ -1,6 +1,9 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#include "ProfilerCommands.h"
#if STATS
#include "Misc/Paths.h"
#include "Framework/MultiBox/MultiBoxBuilder.h"
#include "EditorStyleSet.h"
@@ -354,3 +357,5 @@ bool FProfilerActionManager::OpenSettings_CanExecute() const
}
#undef LOCTEXT_NAMESPACE
#endif // STATS
@@ -3,6 +3,9 @@
#pragma once
#include "CoreMinimal.h"
#if STATS
#include "Misc/Guid.h"
#include "Framework/Commands/UIAction.h"
#include "Framework/Commands/Commands.h"
@@ -222,3 +225,5 @@ protected:
/** Reference to the global instance of the profiler manager. */
class FProfilerManager* This;
};
#endif // STATS
@@ -2,6 +2,7 @@
#include "ProfilerDataProvider.h"
#if STATS
/*-----------------------------------------------------------------------------
IDataProvider
@@ -167,3 +168,5 @@ const SIZE_T FArrayDataProvider::GetMemoryUsage() const
MemoryUsage += ChildrenIndicesMemoryUsage;
return MemoryUsage;
}
#endif // STATS
@@ -3,6 +3,9 @@
#pragma once
#include "CoreMinimal.h"
#if STATS
#include "ProfilerCommon.h"
#include "ProfilerSample.h"
@@ -267,3 +270,5 @@ protected:
uint64 ChildrenIndicesMemoryUsage;
};
#endif // STATS
@@ -1,6 +1,9 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#include "ProfilerDataSource.h"
#if STATS
#include "Containers/MapBuilder.h"
#include "ProfilerStream.h"
#include "ProfilerDataProvider.h"
@@ -566,3 +569,5 @@ FString EEventGraphTypes::ToDescription( const EEventGraphTypes::Type EventGraph
}
#undef LOCTEXT_NAMESPACE
#endif // STATS
@@ -3,14 +3,15 @@
#pragma once
#include "CoreMinimal.h"
#if STATS
#include "HAL/ThreadSingleton.h"
#include "Containers/ChunkedArray.h"
#include "Misc/Guid.h"
#include "ProfilerCommon.h"
#include "ProfilerSample.h"
#if STATS
class FEventGraphData;
class FEventGraphSample;
class FProfilerAggregatedStat;
@@ -2267,4 +2268,4 @@ protected:
//}//namespace FEventGraphSample
#endif // STATS
#endif // STATS
@@ -2,6 +2,8 @@
#include "ProfilerFPSAnalyzer.h"
#if STATS
void FFPSAnalyzer::Reset()
{
@@ -89,3 +91,5 @@ int32 FFPSAnalyzer::GetCount(float InMinVal, float InMaxVal)
return Histogram[Index].Count;
}
#endif // STATS
@@ -3,6 +3,9 @@
#pragma once
#include "CoreMinimal.h"
#if STATS
#include "ProfilerSample.h"
@@ -77,3 +80,5 @@ public:
int32 MaxVal;
int32 MinVal;
};
#endif // STATS
@@ -1,6 +1,9 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#include "ProfilerManager.h"
#if STATS
#include "Modules/ModuleManager.h"
#include "IProfilerClientModule.h"
#include "Stats/StatsFile.h"
@@ -690,3 +693,5 @@ void FProfilerManager::SetViewMode( EProfilerViewMode NewViewMode )
}
#undef LOCTEXT_NAMESPACE
#endif // STATS
@@ -3,6 +3,9 @@
#pragma once
#include "CoreMinimal.h"
#if STATS
#include "Misc/Guid.h"
#include "Framework/Commands/UICommandList.h"
#include "Misc/ConfigCacheIni.h"
@@ -519,3 +522,5 @@ protected:
/** True, if the profiler has at least one fully processed capture file. */
bool bHasCaptureFileFullyProcessed;
};
#endif // STATS
@@ -50,6 +50,7 @@ IMPLEMENT_MODULE( FProfilerModule, Profiler );
TSharedRef<SWidget> FProfilerModule::CreateProfilerWindow( const TSharedRef<ISessionManager>& InSessionManager, const TSharedRef<SDockTab>& ConstructUnderMajorTab )
{
#if STATS
FProfilerManager::Initialize( InSessionManager );
TSharedRef<SProfilerWindow> ProfilerWindow = SNew( SProfilerWindow );
FProfilerManager::Get()->AssignProfilerWindow( ProfilerWindow );
@@ -57,20 +58,27 @@ TSharedRef<SWidget> FProfilerModule::CreateProfilerWindow( const TSharedRef<ISes
ConstructUnderMajorTab->SetOnTabClosed( SDockTab::FOnTabClosedCallback::CreateRaw( this, &FProfilerModule::Shutdown ) );
return ProfilerWindow;
#else
return SNew(SBox);
#endif // STATS
}
void FProfilerModule::ShutdownModule()
{
#if STATS
if (FProfilerManager::Get().IsValid())
{
FProfilerManager::Get()->Shutdown();
}
#endif // STATS
}
void FProfilerModule::Shutdown( TSharedRef<SDockTab> TabBeingClosed )
{
#if STATS
FProfilerManager::Get()->Shutdown();
TabBeingClosed->SetOnTabClosed( SDockTab::FOnTabClosedCallback() );
#endif // STATS
}
/*-----------------------------------------------------------------------------
@@ -79,6 +87,7 @@ void FProfilerModule::Shutdown( TSharedRef<SDockTab> TabBeingClosed )
void FProfilerModule::StatsMemoryDumpCommand( const TCHAR* Filename )
{
#if STATS
TUniquePtr<FRawStatsMemoryProfiler> Instance( FStatsReader<FRawStatsMemoryProfiler>::Create( Filename ) );
if (Instance)
{
@@ -142,6 +151,7 @@ void FProfilerModule::StatsMemoryDumpCommand( const TCHAR* Filename )
#endif // UE_BUILD_DEBUG
}
}
#endif // STATS
}
@@ -151,13 +161,13 @@ void FProfilerModule::StatsMemoryDumpCommand( const TCHAR* Filename )
FRawStatsMemoryProfiler* FProfilerModule::OpenRawStatsForMemoryProfiling( const TCHAR* Filename )
{
#if STATS
FRawStatsMemoryProfiler* Instance = FStatsReader<FRawStatsMemoryProfiler>::Create( Filename );
if (Instance)
{
Instance->ReadAndProcessAsynchronously();
}
return Instance;
#endif // STATS
return nullptr;
}
@@ -1,6 +1,9 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#include "ProfilerRawStatsForMemory.h"
#if STATS
#include "Stats/StatsMisc.h"
#include "ProfilingDebugging/DiagnosticTable.h"
@@ -884,3 +887,5 @@ void FRawStatsMemoryProfiler::CompareSnapshotsHumanReadable( const FName BeginSn
out_Result.ValueSort( FCombinedAllocationInfoSizeGreater() );
}
}
#endif // STATS
@@ -3,6 +3,9 @@
#pragma once
#include "CoreMinimal.h"
#if STATS
#include "Stats/StatsFile.h"
@@ -383,3 +386,4 @@ protected:
int32 LastSequenceTagForNamedMarker;
};
#endif // STATS
@@ -1,6 +1,9 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#include "ProfilerRawStatsForThreadView.h"
#if STATS
#include "HAL/FileManager.h"
#include "Serialization/MemoryReader.h"
#include "ProfilerDataProvider.h"
@@ -547,3 +550,5 @@ void FRawProfilerSession::ProcessStatPacketArray( const FStatPacketArray& StatPa
out_ProfilerFrame.SortChildren();
}
#endif // STATS
@@ -3,6 +3,9 @@
#pragma once
#include "CoreMinimal.h"
#if STATS
#include "Stats/StatsFile.h"
#include "ProfilerStream.h"
#include "ProfilerSession.h"
@@ -50,3 +53,5 @@ public:
*/
void ProcessStatPacketArray(const FStatPacketArray& PacketArray, FProfilerFrame& out_ProfilerFrame, int32 FrameIndex);
};
#endif // STATS
@@ -2,6 +2,7 @@
#include "ProfilerSample.h"
#if STATS
#define LOCTEXT_NAMESPACE "ProfilerSample"
@@ -58,3 +59,5 @@ void FProfilerSample::FixupChildrenOrdering(const TMap<uint32,uint32>& ChildrenO
#undef LOCTEXT_NAMESPACE
#endif // STATS
@@ -3,10 +3,12 @@
#pragma once
#include "CoreMinimal.h"
#if STATS
#include "Containers/ChunkedArray.h"
#include "Stats/Stats.h"
#if STATS
/*-----------------------------------------------------------------------------
Type definitions
@@ -1,6 +1,9 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#include "ProfilerSession.h"
#if STATS
#include "ProfilerFPSAnalyzer.h"
#include "ProfilerDataProvider.h"
@@ -985,3 +988,5 @@ void FProfilerAggregatedStat::Aggregate(const FProfilerSample& Sample, const TSh
_ValueOneFrame += TypedValue;
}
#endif // STATS
@@ -3,6 +3,9 @@
#pragma once
#include "CoreMinimal.h"
#if STATS
#include "Containers/LockFreeList.h"
#include "Misc/Guid.h"
#include "Async/TaskGraphInterfaces.h"
@@ -15,7 +18,6 @@
#include "Stats/StatsData.h"
#include "ProfilerStream.h"
#if STATS
class FFPSAnalyzer;
class FProfilerGroup;
@@ -1119,4 +1121,4 @@ public:
TSharedRef<FFPSAnalyzer> FPSAnalyzer;
};
#endif // STATS
#endif // STATS
@@ -2,6 +2,7 @@
#include "ProfilerStream.h"
#if STATS
/*-----------------------------------------------------------------------------
FProfilerUIStream
@@ -169,3 +170,5 @@ void FProfilerUIStream::CombineOrSet( FProfilerUIStackNode* ParentUIStackNode, c
}
}
}
#endif // STATS

Some files were not shown because too many files have changed in this diff Show More