Functions | |
void | uprofile::start (const char *filepath, unsigned long long maxCapSize=0) |
Start profiling to periodically record monitored events to a file. More... | |
void | uprofile::stop () |
Stop all monitorings. More... | |
void | uprofile::addGPUMonitor (IGPUMonitor *monitor) |
Inject a GPUMonitor object that will be responsible for monitoring GPU metrics (usage and memory) More... | |
void | uprofile::removeGPUMonitor () |
Destroy injected GPUMonitor object. | |
void | uprofile::setTimestampUnit (TimestampUnit tsUnit) |
Change the timestamp unit to record profiling metrics. More... | |
void | uprofile::timeBegin (const std::string &title) |
Start monitoring the execution time of the given event. More... | |
void | uprofile::timeEnd (const std::string &title) |
Stop monitoring the execution time of the given event. More... | |
void | uprofile::startProcessMemoryMonitoring (int period) |
Start monitoring of the memory used by the process. More... | |
void | uprofile::startSystemMemoryMonitoring (int period) |
Start monitoring of the global memory used on the system. More... | |
void | uprofile::startCPUUsageMonitoring (int period) |
Start monitoring of the usage percentage of each CPU. More... | |
void | uprofile::startGPUUsageMonitoring (int period) |
Start monitoring of the usage of the GPU. More... | |
void | uprofile::startGPUMemoryMonitoring (int period) |
Start monitoring of the usage of the GPU memory. More... | |
void | uprofile::getProcessMemory (int &rss, int &shared) |
memory used by the current process | |
void | uprofile::getSystemMemory (int &totalMem, int &availableMem, int &freeMem) |
dump global system memory | |
std::vector< float > | uprofile::getInstantCpuUsage () |
get usage of all cpu cores More... | |
void uprofile::addGPUMonitor | ( | IGPUMonitor * | monitor | ) |
Inject a GPUMonitor object that will be responsible for monitoring GPU metrics (usage and memory)
monitor | custom GPUMonitor object |
Note: uprofile takes ownership of the passed object.
std::vector<float> uprofile::getInstantCpuUsage | ( | ) |
get usage of all cpu cores
void uprofile::setTimestampUnit | ( | TimestampUnit | tsUnit | ) |
Change the timestamp unit to record profiling metrics.
It should be called before calling start() method.
Note: default value is EPOCH_TIME
void uprofile::start | ( | const char * | filepath, |
unsigned long long | maxCapSize = 0 |
||
) |
Start profiling to periodically record monitored events to a file.
filepath | file path where events will be saved |
maxCapSize | maximum file size in bytes |
By default, the file is unbounded.
If you have some storage constraints, set maxCapSize parameter for generating two rotating files (<file>_0.<ext> and <file>_1.<ext>) Each file will have a maximum size of maxCapSize/2 (In this mode, more recent events will override older events)
void uprofile::startCPUUsageMonitoring | ( | int | period | ) |
Start monitoring of the usage percentage of each CPU.
period | period between two cpu usage dump (in ms) |
void uprofile::startGPUMemoryMonitoring | ( | int | period | ) |
Start monitoring of the usage of the GPU memory.
period | period between two gpu usage dump (in ms) |
void uprofile::startGPUUsageMonitoring | ( | int | period | ) |
Start monitoring of the usage of the GPU.
period | period between two gpu usage dump (in ms) |
void uprofile::startProcessMemoryMonitoring | ( | int | period | ) |
Start monitoring of the memory used by the process.
period | period between two memory dump (in ms) |
void uprofile::startSystemMemoryMonitoring | ( | int | period | ) |
Start monitoring of the global memory used on the system.
period | period between two memory dump (in ms) |
void uprofile::stop | ( | ) |
Stop all monitorings.
Note: stopping profiler without prior call to start() has no effect
void uprofile::timeBegin | ( | const std::string & | title | ) |
Start monitoring the execution time of the given event.
title | event key |
void uprofile::timeEnd | ( | const std::string & | title | ) |
Stop monitoring the execution time of the given event.
The library computes the duration for the given event and saves it into the report file.
If no timeBegin() has been called with the given title, the call is ignored.