OGRE 2.1
Object-Oriented Graphics Rendering Engine
|
Simple profiler that will produce a CSV file for offline analysis once dumpProfileResults is called. More...
#include <OgreOfflineProfiler.h>
Public Member Functions | |
OfflineProfiler () | |
~OfflineProfiler () | |
void | dumpProfileResults (const String &fullPathPerFrame, const String &fullPathAccum) |
Dumps CSV data into two CSV files. | |
bool | isPaused (void) const |
Returns true if sampling is paused. | |
void | profileBegin (const char *name, ProfileSampleFlags::ProfileSampleFlags flags) |
void | profileEnd (void) |
void | reset (void) |
Destroys all collected samples and starts over. | |
void | setDumpPathsOnShutdown (const String &fullPathPerFrame, const String &fullPathAccum) |
Ogre will call dumpProfileResults for your on shutdown if you set these paths. | |
void | setPaused (bool bPaused) |
Pauses collection of samples. | |
Simple profiler that will produce a CSV file for offline analysis once dumpProfileResults is called.
Ogre::OfflineProfiler::OfflineProfiler | ( | ) |
Ogre::OfflineProfiler::~OfflineProfiler | ( | ) |
void Ogre::OfflineProfiler::dumpProfileResults | ( | const String & | fullPathPerFrame, |
const String & | fullPathAccum | ||
) |
Dumps CSV data into two CSV files.
fullPathPerFrame | Full path to csv without extension to generate where to dump the per-frame CSV data. Empty string to skip it. Note that the CSV extension will be appended, and the actual filename my vary as there will be one file per thread that was collected. |
fullPathAccum | Full path to csv without extension to generate where to dump the per-frame CSV data. Empty string to skip it. Note that the CSV extension will be appended, and the actual filename my vary as there will be one file per thread that was collected. |
Returns true if sampling is paused.
Note that some worker threads may still be collecting samples even if this returns true (and likewise, they may take a bit of time to resume again)
void Ogre::OfflineProfiler::profileBegin | ( | const char * | name, |
ProfileSampleFlags::ProfileSampleFlags | flags | ||
) |
Destroys all collected samples and starts over.
Worker threads will honour this request as soon as they see it (which is the next time they call profileBegin).
void Ogre::OfflineProfiler::setDumpPathsOnShutdown | ( | const String & | fullPathPerFrame, |
const String & | fullPathAccum | ||
) |
Ogre will call dumpProfileResults for your on shutdown if you set these paths.
fullPathPerFrame | Full path to csv without extension to generate where to dump the per-frame CSV data. Empty string to skip it. Note that the CSV extension will be appended, and the actual filename my vary as there will be one file per thread that was collected. |
fullPathAccum | Full path to csv without extension to generate where to dump the per-frame CSV data. Empty string to skip it. Note that the CSV extension will be appended, and the actual filename my vary as there will be one file per thread that was collected. |
Pauses collection of samples.
Note that other threads may be in the middle of a collection (i.e. they've called profileBegin but haven't yet called profileEnd). Threads will pause after their collection ends (i.e. only after they end up calling profileEnd).
Likewise, if you resume sampling, a thread that already called profileBegin while it was paused, thus it will resume sampling in its next profileBegin call.
TL;DR: It is thread safe, but do not assume pause is immediate (i.e. worker threads may still add a new sample after calling setPaused( true ))
bPaused | True to pause. False to resume. |