5#include "HAL/LowLevelMemTracker.h"
6#include "Stats/Stats.h"
10
11
12 #define DECLARE_LLM_MEMORY_STAT(CounterName,StatId,GroupId)
13 DECLARE_STAT(CounterName,StatId,GroupId,EStatDataType::ST_int64, EStatFlags::None, FPlatformMemory::MCR_PhysicalLLM);
14 static DEFINE_STAT(StatId)
15 #define DECLARE_LLM_MEMORY_STAT_EXTERN(CounterName,StatId,GroupId, API)
16 DECLARE_STAT(CounterName,StatId,GroupId,EStatDataType::ST_int64, EStatFlags::None, FPlatformMemory::MCR_PhysicalLLM);
17 extern API DEFINE_STAT(StatId);
19 DECLARE_STATS_GROUP(TEXT(
"LLM FULL"), STATGROUP_LLMFULL, STATCAT_Advanced);
20 DECLARE_STATS_GROUP(TEXT(
"LLM Platform"), STATGROUP_LLMPlatform, STATCAT_Advanced);
21 DECLARE_STATS_GROUP(TEXT(
"LLM Summary"), STATGROUP_LLM, STATCAT_Advanced);
22 DECLARE_STATS_GROUP(TEXT(
"LLM Overhead"), STATGROUP_LLMOverhead, STATCAT_Advanced);
23 DECLARE_STATS_GROUP(TEXT(
"LLM Assets"), STATGROUP_LLMAssets, STATCAT_Advanced);
26
27
28 DECLARE_LLM_MEMORY_STAT_EXTERN(TEXT(
"Engine"), STAT_EngineSummaryLLM, STATGROUP_LLM, );
29 DECLARE_LLM_MEMORY_STAT_EXTERN(TEXT(
"Project"), STAT_ProjectSummaryLLM, STATGROUP_LLM, );
30 DECLARE_LLM_MEMORY_STAT_EXTERN(TEXT(
"Networking"), STAT_NetworkingSummaryLLM, STATGROUP_LLM, );
31 DECLARE_LLM_MEMORY_STAT_EXTERN(TEXT(
"Audio"), STAT_AudioSummaryLLM, STATGROUP_LLM, );
32 DECLARE_LLM_MEMORY_STAT_EXTERN(TEXT(
"Total"), STAT_TrackedTotalSummaryLLM, STATGROUP_LLM, );
33 DECLARE_LLM_MEMORY_STAT_EXTERN(TEXT(
"Meshes"), STAT_MeshesSummaryLLM, STATGROUP_LLM, );
34 DECLARE_LLM_MEMORY_STAT_EXTERN(TEXT(
"Physics"), STAT_PhysicsSummaryLLM, STATGROUP_LLM, );
35 DECLARE_LLM_MEMORY_STAT_EXTERN(TEXT(
"PhysX"), STAT_PhysXSummaryLLM, STATGROUP_LLM, );
36 DECLARE_LLM_MEMORY_STAT_EXTERN(TEXT(
"Chaos"), STAT_ChaosSummaryLLM, STATGROUP_LLM, );
37 DECLARE_LLM_MEMORY_STAT_EXTERN(TEXT(
"UObject"), STAT_UObjectSummaryLLM, STATGROUP_LLM, );
38 DECLARE_LLM_MEMORY_STAT_EXTERN(TEXT(
"Animation"), STAT_AnimationSummaryLLM, STATGROUP_LLM, );
39 DECLARE_LLM_MEMORY_STAT_EXTERN(TEXT(
"StaticMesh"), STAT_StaticMeshSummaryLLM, STATGROUP_LLM, );
40 DECLARE_LLM_MEMORY_STAT_EXTERN(TEXT(
"Materials"), STAT_MaterialsSummaryLLM, STATGROUP_LLM, );
41 DECLARE_LLM_MEMORY_STAT_EXTERN(TEXT(
"Particles"), STAT_ParticlesSummaryLLM, STATGROUP_LLM, );
42 DECLARE_LLM_MEMORY_STAT_EXTERN(TEXT(
"Niagara"), STAT_NiagaraSummaryLLM, STATGROUP_LLM, );
43 DECLARE_LLM_MEMORY_STAT_EXTERN(TEXT(
"UI"), STAT_UISummaryLLM, STATGROUP_LLM, );
44 DECLARE_LLM_MEMORY_STAT_EXTERN(TEXT(
"Navigation"), STAT_NavigationSummaryLLM, STATGROUP_LLM, );
45 DECLARE_LLM_MEMORY_STAT_EXTERN(TEXT(
"Textures"), STAT_TexturesSummaryLLM, STATGROUP_LLM, );
46 DECLARE_LLM_MEMORY_STAT_EXTERN(TEXT(
"MediaStreaming"), STAT_MediaStreamingSummaryLLM, STATGROUP_LLM, );
49 #define DECLARE_LLM_MEMORY_STAT(CounterName,StatId,GroupId)
50 #define DECLARE_LLM_MEMORY_STAT_EXTERN(CounterName,StatId,GroupId, API)
55
56
58#define LLM_SCOPED_TAG_WITH_STAT(Stat, Tracker) FLLMScope SCOPE_NAME(GET_STATFNAME(Stat), true , ELLMTagSet::None, Tracker);
59#define LLM_SCOPED_TAG_WITH_STAT_IN_SET(Stat, Set, Tracker) FLLMScope SCOPE_NAME(GET_STATFNAME(Stat), true , Set, Tracker);
60#define LLM_SCOPED_TAG_WITH_STAT_NAME(StatName, Tracker) FLLMScope SCOPE_NAME(StatName, true , ELLMTagSet::None, Tracker);
61#define LLM_SCOPED_TAG_WITH_STAT_NAME_IN_SET(StatName, Set, Tracker) FLLMScope SCOPE_NAME(StatName, true , Set, Tracker);
62#define LLM_SCOPED_SINGLE_PLATFORM_STAT_TAG(Stat) DECLARE_LLM_MEMORY_STAT(TEXT(#Stat), Stat, STATGROUP_LLMPlatform); LLM_SCOPED_TAG_WITH_STAT(Stat, ELLMTracker::Platform);
63#define LLM_SCOPED_SINGLE_PLATFORM_STAT_TAG_IN_SET(Stat, Set) DECLARE_LLM_MEMORY_STAT(TEXT(#Stat), Stat, STATGROUP_LLMPlatform); LLM_SCOPED_TAG_WITH_STAT_IN_SET(Stat, Set, ELLMTracker::Platform);
64#define LLM_SCOPED_SINGLE_STAT_TAG(Stat) DECLARE_LLM_MEMORY_STAT(TEXT(#Stat), Stat, STATGROUP_LLMFULL); LLM_SCOPED_TAG_WITH_STAT(Stat, ELLMTracker::Default);
65#define LLM_SCOPED_SINGLE_STAT_TAG_IN_SET(Stat, Set) DECLARE_LLM_MEMORY_STAT(TEXT(#Stat), Stat, STATGROUP_LLMFULL); LLM_SCOPED_TAG_WITH_STAT_IN_SET(Stat, Set, ELLMTracker::Default);
66#define LLM_SCOPED_PAUSE_TRACKING_WITH_STAT_AND_AMOUNT(Stat, Amount, Tracker) FLLMPauseScope SCOPE_NAME(GET_STATFNAME(Stat), true , Amount, Tracker, ELLMAllocType::None);
67#define LLM_SCOPED_TAG_WITH_OBJECT_IN_SET(Object, Set) FLLMScope SCOPE_NAME(FLowLevelMemTracker::Get().IsTagSetActive(Set) ? Object->GetOutermost()->GetFName() : NAME_None, (Set == ELLMTagSet::None) , Set, ELLMTracker::Default);
71#if LLM_ALLOW_ASSETS_TAGS
73#define LLM_PUSH_STATS_FOR_ASSET_TAGS()
75#define LLM_PUSH_STATS_FOR_ASSET_TAGS()
79#define LLM_SCOPED_TAG_WITH_STAT(...)
80#define LLM_SCOPED_TAG_WITH_STAT_IN_SET(...)
81#define LLM_SCOPED_TAG_WITH_STAT_NAME(...)
82#define LLM_SCOPED_TAG_WITH_STAT_NAME_IN_SET(...)
83#define LLM_SCOPED_SINGLE_PLATFORM_STAT_TAG(...)
84#define LLM_SCOPED_SINGLE_PLATFORM_STAT_TAG_IN_SET(...)
85#define LLM_SCOPED_SINGLE_STAT_TAG(...)
86#define LLM_SCOPED_SINGLE_STAT_TAG_IN_SET(...)
87#define LLM_SCOPED_PAUSE_TRACKING_WITH_STAT_AND_AMOUNT(...)
88#define LLM_SCOPED_TAG_WITH_OBJECT_IN_SET(...)
89#define LLM_PUSH_STATS_FOR_ASSET_TAGS()
#define ENABLE_LOW_LEVEL_MEM_TRACKER