Files
UnrealEngineUWP/Engine/Source/Developer/TraceServices/Private/Model/Diagnostics.cpp
ionut matasaru a8f0b00b77 [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

44 lines
982 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "TraceServices/Model/Diagnostics.h"
#include "Model/DiagnosticsPrivate.h"
namespace TraceServices
{
FDiagnosticsProvider::FDiagnosticsProvider(IAnalysisSession& InSession)
: Session(InSession)
{
}
void FDiagnosticsProvider::SetSessionInfo(const FSessionInfo& InSessionInfo)
{
Session.WriteAccessCheck();
SessionInfo = InSessionInfo;
bIsSessionInfoAvailable = true;
}
bool FDiagnosticsProvider::IsSessionInfoAvailable() const
{
Session.ReadAccessCheck();
return bIsSessionInfoAvailable;
}
const FSessionInfo& FDiagnosticsProvider::GetSessionInfo() const
{
Session.ReadAccessCheck();
return SessionInfo;
}
FName GetDiagnosticsProviderName()
{
static FName Name(TEXT("DiagnosticsProvider"));
return Name;
}
const IDiagnosticsProvider* ReadDiagnosticsProvider(const IAnalysisSession& Session)
{
return Session.ReadProvider<IDiagnosticsProvider>(GetDiagnosticsProviderName());
}
} // namespace TraceServices