Files
UnrealEngineUWP/Engine/Source/Developer/TraceServices/Private/Modules/MemoryModule.cpp
ionut matasaru 8691beb48e [Insights]
- Fixed the Allocations Analysis to process the updated alloc trace events.
  - Added timelines in the Allocations Provider with variation for several stats based on 1ms sample:
      * MinTotalAllocatedMemory
      * MaxTotalAllocatedMemory
      * MinLiveAllocationCount
      * MaxLiveAllocationCount
      * AllocEventCount
      * FreeEventCount
  - Added graph tracks and graph series for all above timelines in Memory Insights.

#rb Catalin.Dragoiu
#jira UECORE-635

[CL 14853556 by ionut matasaru in ue5-main branch]
2020-12-04 07:02:31 -04:00

41 lines
1.3 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "MemoryModule.h"
#include "Analyzers/AllocationsAnalysis.h"
#include "Analyzers/CallstacksAnalysis.h"
#include "Analyzers/MemoryAnalysis.h"
#include "Model/AllocationsProvider.h"
#include "Model/CallstacksProvider.h"
#include "TraceServices/Model/AnalysisSession.h"
namespace TraceServices
{
static const FName MemoryModuleName("TraceModule_Memory");
void FMemoryModule::GetModuleInfo(FModuleInfo& OutModuleInfo)
{
OutModuleInfo.Name = MemoryModuleName;
OutModuleInfo.DisplayName = TEXT("Memory");
}
void FMemoryModule::OnAnalysisBegin(IAnalysisSession& Session)
{
FAllocationsProvider* AllocationsProvider = new FAllocationsProvider(Session.GetLinearAllocator());
Session.AddProvider(AllocationsProvider->GetName(), AllocationsProvider);
Session.AddAnalyzer(new FAllocationsAnalyzer(Session, *AllocationsProvider));
FCallstacksProvider* CallstacksProvider = new FCallstacksProvider(Session);
Session.AddProvider(CallstacksProvider->GetName(), CallstacksProvider);
Session.AddAnalyzer(new FCallstacksAnalyzer(Session, CallstacksProvider));
Session.AddAnalyzer(new FMemoryAnalyzer(Session));
}
void FMemoryModule::GetLoggers(TArray<const TCHAR *>& OutLoggers)
{
OutLoggers.Add(TEXT("Memory"));
}
} // namespace TraceServices