DayZ 1.24
|
Classes | |
class | EnProfiler |
Set of methods for accessing script profiling data. More... | |
Enumerations | |
enum | EnProfilerFlags { NONE = 0 , RESET , RECURSIVE , ALL } |
Flags that influences the behaviour of the EnProfiler API, applied through ...Flags functions. More... | |
enum | EnProfilerModule { CORE , GAMELIB , GAME , WORLD , MISSION , MISSION_CUSTOM , ERROR } |
Current base scripted modules. More... | |
enum | EnProfilerEnabledFlags { NONE = 0 , DIAG , SCRP , SCRC } |
There are 3 states which can be toggled that governs whether script profiling is enabled or not. More... | |
Functions | |
static proto void | EnProfiler::Enable (bool enable, bool immediate=false, bool sessionReset=true) |
Enable the gathering of script profiling data. | |
static proto int | EnProfiler::IsEnabled () |
Return if script profiling is enabled. | |
static bool | EnProfiler::IsEnabledD () |
Return if script profiling is enabled through [DM]. | |
static bool | EnProfiler::IsEnabledP () |
Return if script profiling is enabled through EnProfiler. | |
static bool | EnProfiler::IsEnabledC () |
Return if script profiling is actually turned on inside of the script context. | |
static proto void | EnProfiler::SortData () |
The internal sorting that happens at the end of the frame (so it is NOT necessary to call this manually) to supply Get...Per... functions. | |
static proto void | EnProfiler::ResetSession (bool fullReset=false) |
Perform [SR], clearing SessionFrame, ProfiledSessionFrames, [SD] and [PD] (except for [CI]) | |
EnProfilerFlags | |
Set of functions to configure the currently active EnProfilerFlags | |
static proto int | EnProfiler::SetFlags (int flags, bool sessionReset=true) |
Override the currently used set of EnProfilerFlags across the API. | |
static proto int | EnProfiler::GetFlags () |
Get the currently used flags across the API. | |
static proto bool | EnProfiler::IsFlagsSet (int flags) |
Check if the flags are set. | |
static proto int | EnProfiler::AddFlags (int flags, bool sessionReset=true) |
Add flags to the currently used set of EnProfilerFlags across the API. | |
static proto int | EnProfiler::RemoveFlags (int flags, bool sessionReset=true) |
Remove flags from the currently used set of EnProfilerFlags across the API. | |
static proto int | EnProfiler::ClearFlags (bool sessionReset=true) |
Remove all flags from the currently used set of EnProfilerFlags across the API. | |
EnProfilerModule | |
Set of functions to configure the currently profiled EnProfilerModule | |
static proto void | EnProfiler::SetModule (EnProfilerModule module, bool sessionReset=true) |
Set the module to be profiled. | |
static proto EnProfilerModule | EnProfiler::GetModule () |
Get the currently profiled module. | |
static proto owned string | EnProfiler::ModuleToName (EnProfilerModule module) |
Helper to convert EnProfilerModule to string. | |
static proto bool | EnProfiler::NameToModule (string moduleName, out EnProfilerModule module) |
Convert string to EnProfilerModule. | |
static proto void | EnProfiler::SetInterval (int interval, bool sessionReset=true) |
Set the interval for the [SD] to update. | |
static proto int | EnProfiler::GetInterval () |
Get the currently set interval. | |
static proto void | EnProfiler::SetTimeResolution (int resolution) |
Set the resolution of the fetched Time data. | |
static proto int | EnProfiler::GetTimeResolution () |
Get the currently set time resolution. | |
static proto void | EnProfiler::EnableAverage (bool enable) |
Enable/disable returning calculated averages. | |
static proto bool | EnProfiler::IsAverage () |
Check if returning of average data is enabled. | |
static proto void | EnProfiler::Dump () |
Print out [SD] to script log. | |
Frame data | |
Set of functions to obtain information about frame counts | |
static proto int | EnProfiler::GetGameFrame () |
Get the total amount of frames passed. | |
static proto int | EnProfiler::GetSessionFrame () |
Get the total amount of frames in this profiling session. | |
static proto int | EnProfiler::GetTotalFrames () |
Get the total amount of frames across all profiling session. | |
static proto int | EnProfiler::GetProfiledSessionFrames () |
Get the total amount of frames profiled in this profiling session. | |
static proto int | EnProfiler::GetProfiledFrames () |
Get the total amount of frames profiled across all profiling session. | |
Specific data | |
Set of functions to obtain specific data | |
static proto float | EnProfiler::GetTimeOfClass (typename clss, bool immediate=false) |
Obtain [SD] or [PD] regarding the time a specific class consumed. | |
static proto int | EnProfiler::GetAllocationsOfClass (typename clss, bool immediate=false) |
Obtain [SD] or [PD] regarding the allocations of a specific class. | |
static proto int | EnProfiler::GetInstancesOfClass (typename clss, bool immediate=false) |
Obtain [SD] or [PD] regarding the [CI] of a specific class. | |
static proto float | EnProfiler::GetTimeOfFunc (string funct, typename clss, bool immediate=false) |
Obtain [SD] or [PD] regarding the time consumed by a specific function. | |
static proto float | EnProfiler::GetTimeOfFuncG (string funct, bool immediate, bool immediate=false) |
Obtain [SD] or [PD] regarding the time consumed by a specific global function. | |
static proto int | EnProfiler::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 | EnProfiler::GetCountOfFuncG (string funct, bool immediate=false) |
Obtain [SD] or [PD] regarding the amount of times a specific function was called. | |
Misc | |
Set of helper functions | |
static bool | EnProfiler::RequestImmediateData () |
Helper method to ascertain the profiler will record [PD] right after this call. | |
Definition at line 56 of file EnProfiler.c.
Definition at line 59 of file EnProfiler.c.
Definition at line 55 of file EnProfiler.c.
Definition at line 58 of file EnProfiler.c.
There are 3 states which can be toggled that governs whether script profiling is enabled or not.
Enumerator | |
---|---|
NONE | No flags. No automatic destroying. Flags to pass to ParticleSource.StopParticle. Plain Effect base. No flags, has value 0, so will count as false in conditions. No flags |
DIAG | Script profiling UI is enabled in WIN+ALT debug menu, when this is true, it will override SCRP. |
SCRP | It has been set to being always enabled through EnProfiler (SCRipt Profiler) |
SCRC | Whether profiling is currently truly happening (SCRipt Context) |
Definition at line 43 of file EnProfiler.c.
Flags that influences the behaviour of the EnProfiler API, applied through ...Flags functions.
Enumerator | |
---|---|
NONE | No flags. No automatic destroying. Flags to pass to ParticleSource.StopParticle. Plain Effect base. No flags, has value 0, so will count as false in conditions. No flags |
RESET | When present, will reset [PD] on sorting, otherwise will accumulate on top of it. |
RECURSIVE | Whether to profile child modules. |
ALL | All flags enabled. |
Definition at line 8 of file EnProfiler.c.
Current base scripted modules.
Enumerator | |
---|---|
CORE | 1_Core |
GAMELIB | 2_GameLib |
GAME | 3_Game |
WORLD | 4_World |
MISSION | 5_Mission |
MISSION_CUSTOM | init.c |
ERROR | Can be returned from some methods. |
Definition at line 21 of file EnProfiler.c.
Add flags to the currently used set of EnProfilerFlags across the API.
flags | int The combination of desired EnProfilerFlags to be added to the currently used set |
sessionReset | bool When set to false, no [SR] will trigger, regardless of situation |
int
The currently used set of EnProfilerFlags after the function callReferenced by EnProfilerTests::TestAddFlags().
Remove all flags from the currently used set of EnProfilerFlags across the API.
sessionReset | bool When set to false, no [SR] will trigger, regardless of situation |
int
The currently used set of EnProfilerFlags after the function callReferenced by EnProfilerTests::TestAddFlags(), and EnProfilerTests::TestClearFlags().
Print out [SD] to script log.
|
staticprivate |
Enable the gathering of script profiling data.
enable | bool Whether to enable or disable, if it was previously not enabled, it will cause [SR] |
immediate | bool When true will instantly start/stop profiling, otherwise it will apply it at the end of the frame (to have one stable point in time) |
sessionReset | bool When set to false, no [SR] will trigger, regardless of situation |
Referenced by EnProfiler::RequestImmediateData(), EnProfilerTests::TestClassCountData(), EnProfilerTests::TestClassTimeData(), EnProfilerTests::TestFuncCountData(), EnProfilerTests::TestFuncTimeData(), EnProfilerTests::TestModule(), EnProfilerTests::TestToggling(), EnProfilerTests::TestTogglingImmediate(), and EnProfilerTests::~EnProfilerTests().
Enable/disable returning calculated averages.
enable | bool Whether to enable or disable |
|
staticprivate |
Obtain [SD] or [PD] regarding the allocations of a specific class.
clss | typename Typename of desired class |
immediate | bool When true, it will pull from [SD], when false it will pull from [PD] |
int
Allocations of the specified classReferenced by EnProfilerTests::TestClassCountData().
|
staticprivate |
Obtain [SD] for Allocations Per Class.
outArr | array<ref EnProfilerCountClassPair> Array sorted by number of allocations of a class |
count | int The maximum amount of entries wanted |
|
staticprivate |
Obtain [SD] or [PD] regarding the amount of times a specific function was called.
funct | string Function name |
clss | typename Typename of class the function belongs to |
immediate | bool When true, it will pull from [SD], when false it will pull from [PD] |
int
Amount of calls to the specified function or -1 when function was not foundReferenced by EnProfilerTests::TestFuncCountData().
Obtain [SD] or [PD] regarding the amount of times a specific function was called.
funct | string Function name |
immediate | bool When true, it will pull from [SD], when false it will pull from [PD] |
int
Amount of calls to the specified function or -1 when function was not foundReferenced by EnProfilerTests::TestFuncCountData().
|
staticprivate |
Obtain [SD] for Count Per Function.
outArr | array<ref EnProfilerCountFuncPair> Array sorted by amount of times a function was called |
count | int The maximum amount of entries wanted |
Get the currently used flags across the API.
int
The currently used set of EnProfilerFlagsReferenced by EnProfilerTests::TestAddFlags(), EnProfilerTests::TestClearFlags(), EnProfilerTests::TestModule(), and EnProfilerTests::TestSetFlags().
Get the total amount of frames passed.
int
The total amount of frames passed
|
staticprivate |
Obtain [SD] or [PD] regarding the [CI] of a specific class.
clss | typename Typename of desired class |
immediate | bool When true, it will pull from [SD], when false it will pull from [PD] |
int
[CI] of the specified classReferenced by EnProfilerTests::TestClassCountData().
|
staticprivate |
Obtain [SD] for Instances Per Class.
outArr | array<ref EnProfilerCountClassPair> Array sorted by number of instances of a class |
count | int The maximum amount of entries wanted |
Get the currently set interval.
int
The currently set interval
|
staticprivate |
Get the currently profiled module.
EnProfilerModule
The currently profiled moduleReferenced by EnProfilerTests::TestModule().
Get the total amount of frames profiled across all profiling session.
int
The total amount of frames profiled across all profiling sessionGet the total amount of frames profiled in this profiling session.
int
The total amount of frames profiled in this profiling sessionGet the total amount of frames in this profiling session.
int
The total amount of frames in this profiling session
|
staticprivate |
Obtain [SD] or [PD] regarding the time a specific class consumed.
clss | typename Typename of desired class |
immediate | bool When true, it will pull from [SD], when false it will pull from [PD] |
float
Time consumed by the specified classReferenced by EnProfilerTests::TestClassTimeData().
|
staticprivate |
Obtain [SD] or [PD] regarding the time consumed by a specific function.
funct | string Function name |
clss | typename Typename of class the function belongs to |
immediate | bool When true, it will pull from [SD], when false it will pull from [PD] |
float
Time consumed by the specified function or -1 when function was not foundReferenced by EnProfilerTests::TestFuncTimeData(), and EnProfilerTests::TestModule().
|
staticprivate |
Obtain [SD] or [PD] regarding the time consumed by a specific global function.
funct | string Function name |
immediate | bool When true, it will pull from [SD], when false it will pull from [PD] |
float
Time consumed by the specified function or -1 when function was not found
|
staticprivate |
Obtain [SD] for Time Per Class.
outArr | array<ref EnProfilerTimeClassPair> Array sorted by time consumed by a class |
count | int The maximum amount of entries wanted |
Referenced by EnProfilerTests::TestModule().
|
staticprivate |
Obtain [SD] for Time Per Function.
outArr | array<ref EnProfilerTimeFuncPair> Array sorted by time consumed by a function |
count | int The maximum amount of entries wanted |
Referenced by EnProfilerTests::TestModule().
Get the currently set time resolution.
int
The currently set resolutionReferenced by EnProfilerTests::TestClassTimeData(), EnProfilerTests::TestFuncTimeData(), and EnProfilerTests::TestModule().
Get the total amount of frames across all profiling session.
int
The total amount of frames across all profiling sessionCheck if returning of average data is enabled.
bool
Whether returning of average data is enabledReturn if script profiling is enabled.
int
Flags regarding the current stateReferenced by EnProfiler::IsEnabledC(), EnProfiler::IsEnabledD(), and EnProfiler::IsEnabledP().
Return if script profiling is actually turned on inside of the script context.
bool
Whether script is being profiled as of this momentDefinition at line 152 of file EnProfiler.c.
References EnProfiler::IsEnabled().
Referenced by EnProfilerTests::EnProfilerTests(), EnProfiler::RequestImmediateData(), and EnProfilerTests::TestTogglingImmediate().
Return if script profiling is enabled through [DM].
bool
Whether script profiling is enabled through [DM]Definition at line 124 of file EnProfiler.c.
References EnProfiler::IsEnabled().
Return if script profiling is enabled through EnProfiler.
bool
Whether script profiling is enabled through script profilerDefinition at line 138 of file EnProfiler.c.
References EnProfiler::IsEnabled().
Referenced by EnProfilerTests::TestToggling().
Check if the flags are set.
flags | int The combination of EnProfilerFlags to check if present |
bool
If the flags are set
|
staticprivate |
Helper to convert EnProfilerModule to string.
module | EnProfilerModule The module to get the name of |
string
The name of the module
|
staticprivate |
Convert string to EnProfilerModule.
moduleName | string The name of the module |
module | EnProfilerModule The enum value of the module or EnProfilerModule.ERROR if not found |
bool
Whether the module was foundReferenced by EnProfilerTests::TestModule().
Remove flags from the currently used set of EnProfilerFlags across the API.
flags | int The combination of desired EnProfilerFlags to be added to the currently used set |
sessionReset | bool When set to false, no [SR] will trigger, regardless of situation |
int
The currently used set of EnProfilerFlags after the function callReferenced by EnProfilerTests::TestClearFlags(), and EnProfilerTests::TestModule().
Helper method to ascertain the profiler will record [PD] right after this call.
bool
Whether it was enabled before or notDefinition at line 735 of file EnProfiler.c.
References EnProfiler::Enable(), and EnProfiler::IsEnabledC().
Referenced by EnProfilerTests::TestClassCountData(), EnProfilerTests::TestClassTimeData(), EnProfilerTests::TestFuncCountData(), EnProfilerTests::TestFuncTimeData(), and EnProfilerTests::TestModule().
Perform [SR], clearing SessionFrame, ProfiledSessionFrames, [SD] and [PD] (except for [CI])
fullReset | bool Whether to clear [PD] of all modules, when false it will only clear the [PD] according to current settings |
Referenced by EnProfilerTests::TestModule().
Override the currently used set of EnProfilerFlags across the API.
flags | int The combination of desired EnProfilerFlags to override the currently used set |
sessionReset | bool When set to false, no [SR] will trigger, regardless of situation |
int
The currently used set of EnProfilerFlags after the function callReferenced by EnProfilerTests::TestAddFlags(), EnProfilerTests::TestClearFlags(), EnProfilerTests::TestModule(), and EnProfilerTests::TestSetFlags().
Set the interval for the [SD] to update.
interval | int Amount of frames to wait before [SD] is updated |
sessionReset | bool When set to false, no [SR] will trigger, regardless of situation |
|
staticprivate |
Set the module to be profiled.
module | EnProfilerModule The module to profile |
sessionReset | bool When set to false, no [SR] will trigger, regardless of situation |
Referenced by EnProfilerTests::TestModule().
Set the resolution of the fetched Time data.
resolution | int The nth resolution of a second |
Referenced by EnProfilerTests::TestClassTimeData(), EnProfilerTests::TestFuncTimeData(), and EnProfilerTests::TestModule().
The internal sorting that happens at the end of the frame (so it is NOT necessary to call this manually) to supply Get...Per... functions.
Referenced by EnProfilerTests::TestModule().