class ProfilerCPU

Provides various performance measuring methods.

Public

Constructors

ProfilerCPU

ProfilerCPU()

Methods

~ProfilerCPU

~ProfilerCPU() noexcept

BeginThread

void BeginThread(const char *name)

Registers a new thread we will be doing sampling in.

This needs to be called before any beginSample*


endSample* calls are made in that thread.

name
Name that will allow you to more easily identify the thread.

EndThread

void EndThread()

Ends sampling for the current thread.

No beginSample*


endSample* calls after this point.

BeginSample

void BeginSample(const char *name)

Begins sample measurement.

Must be followed by endSample().

name
Unique name for the sample you can later use to find the sampling data.

EndSample

void EndSample(const char *name)

Ends sample measurement.

name
Unique name for the sample.

BeginSamplePrecise

void BeginSamplePrecise(const char *name)

Begins precise sample measurement.

Must be followed by endSamplePrecise().

name
Unique name for the sample you can later use to find the sampling data.

EndSamplePrecise

void EndSamplePrecise(const char *name)

Ends precise sample measurement.

name
Unique name for the sample.

Reset

void Reset()

Clears all sampling data, and ends any unfinished sampling blocks.

GenerateReport

CPUProfilerReport GenerateReport()

Generates a report from all previously sampled data.

staticInstance

static T &Instance()

Returns a reference to the module instance.

Module has to have been started up first otherwise an exception will be thrown.

staticInstancePtr

static T *InstancePtr()

Returns a pointer to the module instance.

Module has to have been started up first otherwise an exception will be thrown.

staticShutDown

static void ShutDown()

Shuts down this module and frees any resources it is using.

staticIsStarted

static bool IsStarted()

Query if the module has been started.

Protected

Methods

~Module<T>

virtual ~Module<T>() = default

OnStartUp

virtual void OnStartUp()

Override if you want your module to be notified once it has been constructed and started.

OnShutDown

virtual void OnShutDown()

Override if you want your module to be notified just before it is deleted.

staticInstanceInternal

static T *&InstanceInternal()

Returns a singleton instance of this module.

staticIsDestroyed

static bool &IsDestroyed()

Checks has the Module been shut down.

staticIsStartedUp

static bool &IsStartedUp()

Checks has the Module been started up.

Private

Methods

EstimateTimerOverhead

void EstimateTimerOverhead()

Calculates overhead that the timing and sampling methods themselves introduce so we might get more accurate measurements when creating reports.

Fields

mBasicTimerOverhead

double mBasicTimerOverhead

mPreciseTimerOverhead

u64 mPreciseTimerOverhead

mBasicSamplingOverheadMs

double mBasicSamplingOverheadMs

mPreciseSamplingOverheadMs

double mPreciseSamplingOverheadMs

mBasicSamplingOverheadCycles

u64 mBasicSamplingOverheadCycles

mPreciseSamplingOverheadCycles

u64 mPreciseSamplingOverheadCycles

mActiveThreads

ProfilerVector<ThreadInfo *> mActiveThreads

mThreadSync

Mutex mThreadSync