diff --git a/plugin-dev/Source/Sentry/Private/Desktop/CrashReporter/SentryCrashContext.cpp b/plugin-dev/Source/Sentry/Private/Desktop/CrashReporter/SentryCrashContext.cpp index e5b72ecc..855444f4 100644 --- a/plugin-dev/Source/Sentry/Private/Desktop/CrashReporter/SentryCrashContext.cpp +++ b/plugin-dev/Source/Sentry/Private/Desktop/CrashReporter/SentryCrashContext.cpp @@ -30,15 +30,10 @@ void FSentryCrashContext::Apply(TSharedPtr Scope) Scope->SetExtraValue("Crash GUID", SessionContext.CrashGUIDRoot); Scope->SetExtraValue("Executable Name", SessionContext.ExecutableName); Scope->SetExtraValue("Game Name", SessionContext.GameName); - Scope->SetExtraValue("CPU Brand", SessionContext.CPUBrand); - Scope->SetExtraValue("CPU Vendor", SessionContext.CPUVendor); - Scope->SetExtraValue("Number of Cores", FString::FromInt(SessionContext.NumberOfCores)); - Scope->SetExtraValue("Number of Cores including Hyperthreads", FString::FromInt(SessionContext.NumberOfCoresIncludingHyperthreads)); Scope->SetExtraValue("Process Id", FString::FromInt(SessionContext.ProcessId)); Scope->SetExtraValue("Seconds Since Start", FString::FromInt(SessionContext.SecondsSinceStart)); Scope->SetExtraValue("Command Line", SessionContext.CommandLine); Scope->SetExtraValue("Memory Stats Page Size", FString::FromInt(SessionContext.MemoryStats.PageSize)); - Scope->SetExtraValue("Memory Stats Total Physical GB", FString::FromInt(SessionContext.MemoryStats.TotalPhysicalGB)); Scope->SetExtraValue("Memory Stats Total Virtual", FString::Printf(TEXT("%lld"), SessionContext.MemoryStats.TotalVirtual)); if(Settings->SendDefaultPii) diff --git a/plugin-dev/Source/Sentry/Private/SentrySubsystem.cpp b/plugin-dev/Source/Sentry/Private/SentrySubsystem.cpp index 6a855386..412d53d7 100644 --- a/plugin-dev/Source/Sentry/Private/SentrySubsystem.cpp +++ b/plugin-dev/Source/Sentry/Private/SentrySubsystem.cpp @@ -93,6 +93,7 @@ void USentrySubsystem::Initialize() #if PLATFORM_WINDOWS || PLATFORM_LINUX || PLATFORM_MAC AddGpuContext(); + AddDeviceContext(); #endif PromoteTags(); @@ -306,6 +307,19 @@ void USentrySubsystem::AddGpuContext() SubsystemNativeImpl->SetContext(TEXT("gpu"), GpuContext); } +void USentrySubsystem::AddDeviceContext() +{ + const FPlatformMemoryConstants& MemoryConstants = FPlatformMemory::GetConstants(); + + TMap DeviceContext; + DeviceContext.Add(TEXT("cpu_description"), FPlatformMisc::GetCPUBrand()); + DeviceContext.Add(TEXT("number_of_cores"), FString::FromInt(FPlatformMisc::NumberOfCores())); + DeviceContext.Add(TEXT("number_of_cores_including_hyperthreads"), FString::FromInt(FPlatformMisc::NumberOfCoresIncludingHyperthreads())); + DeviceContext.Add(TEXT("physical_memory_size_gb"), FString::FromInt(MemoryConstants.TotalPhysicalGB)); + + SubsystemNativeImpl->SetContext(TEXT("device"), DeviceContext); +} + void USentrySubsystem::PromoteTags() { const USentrySettings* Settings = FSentryModule::Get().GetSettings(); diff --git a/plugin-dev/Source/Sentry/Public/SentrySubsystem.h b/plugin-dev/Source/Sentry/Public/SentrySubsystem.h index 1796b629..94824510 100644 --- a/plugin-dev/Source/Sentry/Public/SentrySubsystem.h +++ b/plugin-dev/Source/Sentry/Public/SentrySubsystem.h @@ -237,6 +237,9 @@ class SENTRY_API USentrySubsystem : public UGameInstanceSubsystem /** Adds GPU context data for all events captured by Sentry SDK. */ void AddGpuContext(); + /** Adds GPU context data for all events captured by Sentry SDK. */ + void AddDeviceContext(); + /** Promote specified values to tags for all events captured by Sentry SDK. */ void PromoteTags();