2020-06-23 18:40:00 -04:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#include "MemoryModule.h"
|
2020-09-24 00:43:27 -04:00
|
|
|
#include "Analyzers/AllocationsAnalysis.h"
|
2020-10-27 09:55:35 -04:00
|
|
|
#include "Analyzers/CallstacksAnalysis.h"
|
2020-06-23 18:40:00 -04:00
|
|
|
#include "Analyzers/MemoryAnalysis.h"
|
2021-01-06 05:44:12 -04:00
|
|
|
#include "Analyzers/ModuleAnalysis.h"
|
2020-09-24 00:43:27 -04:00
|
|
|
#include "Model/AllocationsProvider.h"
|
2020-10-27 09:55:35 -04:00
|
|
|
#include "Model/CallstacksProvider.h"
|
2022-05-05 06:14:08 -04:00
|
|
|
#include "Model/MetadataProvider.h"
|
2020-06-23 18:40:00 -04:00
|
|
|
#include "TraceServices/Model/AnalysisSession.h"
|
|
|
|
|
|
2020-11-25 12:48:47 -04:00
|
|
|
namespace TraceServices
|
2020-09-24 00:43:27 -04:00
|
|
|
{
|
2020-11-25 12:48:47 -04:00
|
|
|
|
2020-06-23 18:40:00 -04:00
|
|
|
static const FName MemoryModuleName("TraceModule_Memory");
|
|
|
|
|
|
|
|
|
|
void FMemoryModule::GetModuleInfo(FModuleInfo& OutModuleInfo)
|
|
|
|
|
{
|
|
|
|
|
OutModuleInfo.Name = MemoryModuleName;
|
|
|
|
|
OutModuleInfo.DisplayName = TEXT("Memory");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FMemoryModule::OnAnalysisBegin(IAnalysisSession& Session)
|
|
|
|
|
{
|
[Insights]
- TraceServices: Changed ReadNetProfilerProvider, ReadMemoryProvider, ReadDiagnosticsProvider to return a pointer to the respective provider (instead of a reference). Can return nullptr. The UI should not assume the provider exists.
- TraceServices: Added GetNetProfilerProviderName, GetMemoryProviderName, GetDiagnosticsProviderName, GetAllocationsProviderName to return name of respective provider.
- TraceServices: Added ReadModuleProvider + GetModuleProviderName, ReadCallstacksProvider + GetCallstacksProviderName to access respective providers.
- TraceServices: Added a default empty implementation to IModule for GenerateReports, GetLoggers and GetCommandLineArgument.
- TraceServices: Changed FAnalysisService::StartAnalysis to not create default providers for Memory (LLM Stats), NetProfiler and Diagnostics, but to allow the respective modules (FMemoryModule, FNetProfilerModule, FDiagnosticsModule) to create the providers.
- TraceInsights: Fixed UI code to check if the Memory, NetProfiler and Diagnostics provider are available.
#rb Catalin.Dragoiu, Johan.Berg
[CL 16967698 by ionut matasaru in ue5-main branch]
2021-07-27 08:18:31 -04:00
|
|
|
// LLM Tag Stats
|
|
|
|
|
FMemoryProvider* MemoryProvider = new FMemoryProvider(Session);
|
|
|
|
|
Session.AddProvider(GetMemoryProviderName(), MemoryProvider);
|
|
|
|
|
Session.AddAnalyzer(new FMemoryAnalyzer(Session, MemoryProvider));
|
2020-09-24 00:43:27 -04:00
|
|
|
|
[Insights]
- TraceServices: Changed ReadNetProfilerProvider, ReadMemoryProvider, ReadDiagnosticsProvider to return a pointer to the respective provider (instead of a reference). Can return nullptr. The UI should not assume the provider exists.
- TraceServices: Added GetNetProfilerProviderName, GetMemoryProviderName, GetDiagnosticsProviderName, GetAllocationsProviderName to return name of respective provider.
- TraceServices: Added ReadModuleProvider + GetModuleProviderName, ReadCallstacksProvider + GetCallstacksProviderName to access respective providers.
- TraceServices: Added a default empty implementation to IModule for GenerateReports, GetLoggers and GetCommandLineArgument.
- TraceServices: Changed FAnalysisService::StartAnalysis to not create default providers for Memory (LLM Stats), NetProfiler and Diagnostics, but to allow the respective modules (FMemoryModule, FNetProfilerModule, FDiagnosticsModule) to create the providers.
- TraceInsights: Fixed UI code to check if the Memory, NetProfiler and Diagnostics provider are available.
#rb Catalin.Dragoiu, Johan.Berg
[CL 16967698 by ionut matasaru in ue5-main branch]
2021-07-27 08:18:31 -04:00
|
|
|
// Module
|
2021-01-06 05:44:12 -04:00
|
|
|
Session.AddAnalyzer(new FModuleAnalyzer(Session));
|
[Insights]
- TraceServices: Changed ReadNetProfilerProvider, ReadMemoryProvider, ReadDiagnosticsProvider to return a pointer to the respective provider (instead of a reference). Can return nullptr. The UI should not assume the provider exists.
- TraceServices: Added GetNetProfilerProviderName, GetMemoryProviderName, GetDiagnosticsProviderName, GetAllocationsProviderName to return name of respective provider.
- TraceServices: Added ReadModuleProvider + GetModuleProviderName, ReadCallstacksProvider + GetCallstacksProviderName to access respective providers.
- TraceServices: Added a default empty implementation to IModule for GenerateReports, GetLoggers and GetCommandLineArgument.
- TraceServices: Changed FAnalysisService::StartAnalysis to not create default providers for Memory (LLM Stats), NetProfiler and Diagnostics, but to allow the respective modules (FMemoryModule, FNetProfilerModule, FDiagnosticsModule) to create the providers.
- TraceInsights: Fixed UI code to check if the Memory, NetProfiler and Diagnostics provider are available.
#rb Catalin.Dragoiu, Johan.Berg
[CL 16967698 by ionut matasaru in ue5-main branch]
2021-07-27 08:18:31 -04:00
|
|
|
|
|
|
|
|
// Callstack
|
2020-10-27 09:55:35 -04:00
|
|
|
FCallstacksProvider* CallstacksProvider = new FCallstacksProvider(Session);
|
[Insights]
- TraceServices: Changed ReadNetProfilerProvider, ReadMemoryProvider, ReadDiagnosticsProvider to return a pointer to the respective provider (instead of a reference). Can return nullptr. The UI should not assume the provider exists.
- TraceServices: Added GetNetProfilerProviderName, GetMemoryProviderName, GetDiagnosticsProviderName, GetAllocationsProviderName to return name of respective provider.
- TraceServices: Added ReadModuleProvider + GetModuleProviderName, ReadCallstacksProvider + GetCallstacksProviderName to access respective providers.
- TraceServices: Added a default empty implementation to IModule for GenerateReports, GetLoggers and GetCommandLineArgument.
- TraceServices: Changed FAnalysisService::StartAnalysis to not create default providers for Memory (LLM Stats), NetProfiler and Diagnostics, but to allow the respective modules (FMemoryModule, FNetProfilerModule, FDiagnosticsModule) to create the providers.
- TraceInsights: Fixed UI code to check if the Memory, NetProfiler and Diagnostics provider are available.
#rb Catalin.Dragoiu, Johan.Berg
[CL 16967698 by ionut matasaru in ue5-main branch]
2021-07-27 08:18:31 -04:00
|
|
|
Session.AddProvider(GetCallstacksProviderName(), CallstacksProvider);
|
2020-10-27 09:55:35 -04:00
|
|
|
Session.AddAnalyzer(new FCallstacksAnalyzer(Session, CallstacksProvider));
|
|
|
|
|
|
2022-05-05 06:14:08 -04:00
|
|
|
// Metadata
|
|
|
|
|
FMetadataProvider* MetadataProvider = new FMetadataProvider(Session);
|
|
|
|
|
Session.AddProvider(GetMetadataProviderName(), MetadataProvider);
|
|
|
|
|
|
[Insights]
- TraceServices: Changed ReadNetProfilerProvider, ReadMemoryProvider, ReadDiagnosticsProvider to return a pointer to the respective provider (instead of a reference). Can return nullptr. The UI should not assume the provider exists.
- TraceServices: Added GetNetProfilerProviderName, GetMemoryProviderName, GetDiagnosticsProviderName, GetAllocationsProviderName to return name of respective provider.
- TraceServices: Added ReadModuleProvider + GetModuleProviderName, ReadCallstacksProvider + GetCallstacksProviderName to access respective providers.
- TraceServices: Added a default empty implementation to IModule for GenerateReports, GetLoggers and GetCommandLineArgument.
- TraceServices: Changed FAnalysisService::StartAnalysis to not create default providers for Memory (LLM Stats), NetProfiler and Diagnostics, but to allow the respective modules (FMemoryModule, FNetProfilerModule, FDiagnosticsModule) to create the providers.
- TraceInsights: Fixed UI code to check if the Memory, NetProfiler and Diagnostics provider are available.
#rb Catalin.Dragoiu, Johan.Berg
[CL 16967698 by ionut matasaru in ue5-main branch]
2021-07-27 08:18:31 -04:00
|
|
|
// Allocations
|
2022-05-05 06:14:08 -04:00
|
|
|
FAllocationsProvider* AllocationsProvider = new FAllocationsProvider(Session, *MetadataProvider);
|
[Insights]
- TraceServices: Changed ReadNetProfilerProvider, ReadMemoryProvider, ReadDiagnosticsProvider to return a pointer to the respective provider (instead of a reference). Can return nullptr. The UI should not assume the provider exists.
- TraceServices: Added GetNetProfilerProviderName, GetMemoryProviderName, GetDiagnosticsProviderName, GetAllocationsProviderName to return name of respective provider.
- TraceServices: Added ReadModuleProvider + GetModuleProviderName, ReadCallstacksProvider + GetCallstacksProviderName to access respective providers.
- TraceServices: Added a default empty implementation to IModule for GenerateReports, GetLoggers and GetCommandLineArgument.
- TraceServices: Changed FAnalysisService::StartAnalysis to not create default providers for Memory (LLM Stats), NetProfiler and Diagnostics, but to allow the respective modules (FMemoryModule, FNetProfilerModule, FDiagnosticsModule) to create the providers.
- TraceInsights: Fixed UI code to check if the Memory, NetProfiler and Diagnostics provider are available.
#rb Catalin.Dragoiu, Johan.Berg
[CL 16967698 by ionut matasaru in ue5-main branch]
2021-07-27 08:18:31 -04:00
|
|
|
Session.AddProvider(GetAllocationsProviderName(), AllocationsProvider);
|
2022-05-05 06:14:08 -04:00
|
|
|
Session.AddAnalyzer(new FAllocationsAnalyzer(Session, *AllocationsProvider, *MetadataProvider));
|
2020-06-23 18:40:00 -04:00
|
|
|
}
|
|
|
|
|
|
[Insights]
- TraceServices: Changed ReadNetProfilerProvider, ReadMemoryProvider, ReadDiagnosticsProvider to return a pointer to the respective provider (instead of a reference). Can return nullptr. The UI should not assume the provider exists.
- TraceServices: Added GetNetProfilerProviderName, GetMemoryProviderName, GetDiagnosticsProviderName, GetAllocationsProviderName to return name of respective provider.
- TraceServices: Added ReadModuleProvider + GetModuleProviderName, ReadCallstacksProvider + GetCallstacksProviderName to access respective providers.
- TraceServices: Added a default empty implementation to IModule for GenerateReports, GetLoggers and GetCommandLineArgument.
- TraceServices: Changed FAnalysisService::StartAnalysis to not create default providers for Memory (LLM Stats), NetProfiler and Diagnostics, but to allow the respective modules (FMemoryModule, FNetProfilerModule, FDiagnosticsModule) to create the providers.
- TraceInsights: Fixed UI code to check if the Memory, NetProfiler and Diagnostics provider are available.
#rb Catalin.Dragoiu, Johan.Berg
[CL 16967698 by ionut matasaru in ue5-main branch]
2021-07-27 08:18:31 -04:00
|
|
|
void FMemoryModule::GetLoggers(TArray<const TCHAR*>& OutLoggers)
|
2020-06-23 18:40:00 -04:00
|
|
|
{
|
|
|
|
|
OutLoggers.Add(TEXT("Memory"));
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-13 05:29:37 -04:00
|
|
|
} // namespace TraceServices
|