2021-05-17 15:28:50 -04:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#include "PlatformEventsModule.h"
|
|
|
|
|
#include "Analyzers/PlatformEventTraceAnalysis.h"
|
|
|
|
|
#include "AnalysisServicePrivate.h"
|
|
|
|
|
#include "Model/ContextSwitchesPrivate.h"
|
|
|
|
|
#include "Model/StackSamplesPrivate.h"
|
|
|
|
|
|
|
|
|
|
namespace TraceServices
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
static const FName PlatformEventsModuleName("TraceModule_PlatformEvents");
|
|
|
|
|
|
|
|
|
|
void FPlatformEventsModule::GetModuleInfo(FModuleInfo& OutModuleInfo)
|
|
|
|
|
{
|
|
|
|
|
OutModuleInfo.Name = PlatformEventsModuleName;
|
|
|
|
|
OutModuleInfo.DisplayName = TEXT("PlatformEvents");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void FPlatformEventsModule::OnAnalysisBegin(IAnalysisSession& InSession)
|
|
|
|
|
{
|
|
|
|
|
FAnalysisSession& Session = static_cast<FAnalysisSession&>(InSession);
|
|
|
|
|
|
2021-07-26 08:14:49 -04:00
|
|
|
FContextSwitchesProvider* ContextSwitchesProvider = new FContextSwitchesProvider(Session);
|
|
|
|
|
FStackSamplesProvider* StackSamplesProvider = new FStackSamplesProvider(Session);
|
2021-05-17 15:28:50 -04:00
|
|
|
|
2021-07-26 08:14:49 -04:00
|
|
|
Session.AddProvider(FContextSwitchesProvider::ProviderName, ContextSwitchesProvider);
|
|
|
|
|
Session.AddProvider(FStackSamplesProvider::ProviderName, StackSamplesProvider);
|
|
|
|
|
Session.AddAnalyzer(new FPlatformEventTraceAnalyzer(Session, *ContextSwitchesProvider, *StackSamplesProvider));
|
2021-05-17 15:28:50 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace TraceServices
|