DayZ 1.24
Loading...
Searching...
No Matches
EnProfiler.c
Go to the documentation of this file.
1
19
38
54
57
60
73{
103 static proto void Enable(bool enable, bool immediate = false, bool sessionReset = true);
104
114 static proto int IsEnabled();
115
124 static bool IsEnabledD()
125 {
126 return (IsEnabled() & EnProfilerEnabledFlags.DIAG);
127 }
128
138 static bool IsEnabledP()
139 {
140 return (IsEnabled() & EnProfilerEnabledFlags.SCRP);
141 }
142
152 static bool IsEnabledC()
153 {
154 return (IsEnabled() & EnProfilerEnabledFlags.SCRC);
155 }
156
172 static proto void SortData();
173
193 static proto void ResetSession(bool fullReset = false);
194
195
200
222 static proto int SetFlags(int flags, bool sessionReset = true);
223
237 static proto int GetFlags();
238
257 static proto bool IsFlagsSet(int flags);
258
275 static proto int AddFlags(int flags, bool sessionReset = true);
276
293 static proto int RemoveFlags(int flags, bool sessionReset = true);
294
310 static proto int ClearFlags(bool sessionReset = true);
311
313
314
319
331 static proto void SetModule(EnProfilerModule module, bool sessionReset = true);
332
342
352 static proto owned string ModuleToName(EnProfilerModule module);
353
376 static proto bool NameToModule(string moduleName, out EnProfilerModule module);
377
379
380
395 static proto void SetInterval(int interval, bool sessionReset = true);
396
405 static proto int GetInterval();
406
407
423 static proto void SetTimeResolution(int resolution);
424
433 static proto int GetTimeResolution();
434
435
458 static proto void EnableAverage(bool enable);
459
468 static proto bool IsAverage();
469
470
478 static proto void Dump();
479
480
485
494 static proto int GetGameFrame();
495
505 static proto int GetSessionFrame();
506
516 static proto int GetTotalFrames();
517
527 static proto int GetProfiledSessionFrames();
528
538 static proto int GetProfiledFrames();
539
541
542
549
566 static proto void GetTimePerClass(notnull out array<ref EnProfilerTimeClassPair> outArr, int count = int.MAX);
567
578 static proto void GetAllocationsPerClass(notnull out array<ref EnProfilerCountClassPair> outArr, int count = int.MAX);
579
590 static proto void GetInstancesPerClass(notnull out array<ref EnProfilerCountClassPair> outArr, int count = int.MAX);
591
602 static proto void GetTimePerFunc(notnull out array<ref EnProfilerTimeFuncPair> outArr, int count = int.MAX);
603
614 static proto void GetCountPerFunc(notnull out array<ref EnProfilerCountFuncPair> outArr, int count = int.MAX);
615
617
618
623
643 static proto float GetTimeOfClass(typename clss, bool immediate = false);
644
655 static proto int GetAllocationsOfClass(typename clss, bool immediate = false);
656
667 static proto int GetInstancesOfClass(typename clss, bool immediate = false);
668
680 static proto float GetTimeOfFunc(string funct, typename clss, bool immediate = false);
681
692 static proto float GetTimeOfFuncG(string funct, bool immediate, bool immediate = false);
693
705 static proto int GetCountOfFunc(string funct, typename clss, bool immediate = false);
706
717 static proto int GetCountOfFuncG(string funct, bool immediate = false);
718
720
721
726
736 {
737 // I only care if it is actually profiling right now, so C
738 bool wasEnabled = IsEnabledC();
739
740 if (!wasEnabled)
741 {
742 // I want the data, and I want it now, so immediate
743 Enable(true, true);
744 }
745
746 return wasEnabled;
747 }
748
750};
751
const int MAX
Definition EnConvert.c:27
Set of methods for accessing script profiling data.
Definition EnProfiler.c:73
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto int GetTimeResolution()
Get the currently set time resolution.
static proto void EnableAverage(bool enable)
Enable/disable returning calculated averages.
static proto EnProfilerModule GetModule()
Get the currently profiled module.
static proto int GetInterval()
Get the currently set interval.
static proto void GetTimePerFunc(notnull out array< ref EnProfilerTimeFuncPair > outArr, int count=int.MAX)
Obtain [SD] for Time Per Function.
Param2< int, string > EnProfilerCountFuncPair
Definition EnProfiler.c:59
Param2< float, string > EnProfilerTimeFuncPair
Definition EnProfiler.c:58
static proto int GetProfiledSessionFrames()
Get the total amount of frames profiled in this profiling session.
Param2< int, typename > EnProfilerCountClassPair
Definition EnProfiler.c:56
EnProfilerEnabledFlags
There are 3 states which can be toggled that governs whether script profiling is enabled or not.
Definition EnProfiler.c:44
static proto int GetAllocationsOfClass(typename clss, bool immediate=false)
Obtain [SD] or [PD] regarding the allocations of a specific class.
static proto float GetTimeOfClass(typename clss, bool immediate=false)
Obtain [SD] or [PD] regarding the time a specific class consumed.
static proto int GetCountOfFunc(string funct, typename clss, bool immediate=false)
Obtain [SD] or [PD] regarding the amount of times a specific function was called.
static proto int GetFlags()
Get the currently used flags across the API.
static proto int ClearFlags(bool sessionReset=true)
Remove all flags from the currently used set of EnProfilerFlags across the API.
static proto float GetTimeOfFunc(string funct, typename clss, bool immediate=false)
Obtain [SD] or [PD] regarding the time consumed by a specific function.
static proto void SetTimeResolution(int resolution)
Set the resolution of the fetched Time data.
static proto void GetCountPerFunc(notnull out array< ref EnProfilerCountFuncPair > outArr, int count=int.MAX)
Obtain [SD] for Count Per Function.
static proto void SortData()
The internal sorting that happens at the end of the frame (so it is NOT necessary to call this manual...
static proto void SetModule(EnProfilerModule module, bool sessionReset=true)
Set the module to be profiled.
static proto void GetInstancesPerClass(notnull out array< ref EnProfilerCountClassPair > outArr, int count=int.MAX)
Obtain [SD] for Instances Per Class.
static proto owned string ModuleToName(EnProfilerModule module)
Helper to convert EnProfilerModule to string.
static proto int GetTotalFrames()
Get the total amount of frames across all profiling session.
static proto void ResetSession(bool fullReset=false)
Perform [SR], clearing SessionFrame, ProfiledSessionFrames, [SD] and [PD] (except for [CI])
static proto bool IsAverage()
Check if returning of average data is enabled.
static proto int GetProfiledFrames()
Get the total amount of frames profiled across all profiling session.
Param2< float, typename > EnProfilerTimeClassPair
Definition EnProfiler.c:55
static bool IsEnabledP()
Return if script profiling is enabled through EnProfiler.
Definition EnProfiler.c:138
static proto void GetAllocationsPerClass(notnull out array< ref EnProfilerCountClassPair > outArr, int count=int.MAX)
Obtain [SD] for Allocations Per Class.
static bool IsEnabledC()
Return if script profiling is actually turned on inside of the script context.
Definition EnProfiler.c:152
static proto int GetInstancesOfClass(typename clss, bool immediate=false)
Obtain [SD] or [PD] regarding the [CI] of a specific class.
static proto int GetGameFrame()
Get the total amount of frames passed.
static proto float GetTimeOfFuncG(string funct, bool immediate, bool immediate=false)
Obtain [SD] or [PD] regarding the time consumed by a specific global function.
EnProfilerFlags
Flags that influences the behaviour of the EnProfiler API, applied through ...Flags functions.
Definition EnProfiler.c:9
static proto void GetTimePerClass(notnull out array< ref EnProfilerTimeClassPair > outArr, int count=int.MAX)
Obtain [SD] for Time Per Class.
static proto int SetFlags(int flags, bool sessionReset=true)
Override the currently used set of EnProfilerFlags across the API.
static proto void Enable(bool enable, bool immediate=false, bool sessionReset=true)
Enable the gathering of script profiling data.
EnProfilerModule
Current base scripted modules.
Definition EnProfiler.c:22
static proto bool NameToModule(string moduleName, out EnProfilerModule module)
Convert string to EnProfilerModule.
static bool RequestImmediateData()
Helper method to ascertain the profiler will record [PD] right after this call.
Definition EnProfiler.c:735
static proto void Dump()
Print out [SD] to script log.
static proto bool IsFlagsSet(int flags)
Check if the flags are set.
static proto int GetSessionFrame()
Get the total amount of frames in this profiling session.
static proto int RemoveFlags(int flags, bool sessionReset=true)
Remove flags from the currently used set of EnProfilerFlags across the API.
static bool IsEnabledD()
Return if script profiling is enabled through [DM].
Definition EnProfiler.c:124
static proto void SetInterval(int interval, bool sessionReset=true)
Set the interval for the [SD] to update.
static proto int IsEnabled()
Return if script profiling is enabled.
static proto int GetCountOfFuncG(string funct, bool immediate=false)
Obtain [SD] or [PD] regarding the amount of times a specific function was called.
static proto int AddFlags(int flags, bool sessionReset=true)
Add flags to the currently used set of EnProfilerFlags across the API.
@ DIAG
Script profiling UI is enabled in WIN+ALT debug menu, when this is true, it will override SCRP.
Definition EnProfiler.c:48
@ SCRP
It has been set to being always enabled through EnProfiler (SCRipt Profiler)
Definition EnProfiler.c:50
@ NONE
No flags.
Definition EnProfiler.c:11
@ SCRC
Whether profiling is currently truly happening (SCRipt Context)
Definition EnProfiler.c:52
@ RECURSIVE
Whether to profile child modules.
Definition EnProfiler.c:15
@ RESET
When present, will reset [PD] on sorting, otherwise will accumulate on top of it.
Definition EnProfiler.c:13
@ ALL
All flags enabled.
Definition EnProfiler.c:17
@ ERROR
Can be returned from some methods.
Definition EnProfiler.c:36
@ WORLD
4_World
Definition EnProfiler.c:30
@ CORE
1_Core
Definition EnProfiler.c:24
@ GAMELIB
2_GameLib
Definition EnProfiler.c:26
@ MISSION_CUSTOM
init.c
Definition EnProfiler.c:34
@ GAME
3_Game
Definition EnProfiler.c:28
@ MISSION
5_Mission
Definition EnProfiler.c:32