Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
Profiler.h File Reference
#include <mutex>
#include <chrono>
#include <Jolt/Core/NonCopyable.h>
#include <Jolt/Core/TickCounter.h>
#include <Jolt/Core/UnorderedMap.h>
#include "Profiler.inl"

Go to the source code of this file.

Classes

class  Profiler
 Singleton class for managing profiling information. More...
 
class  ProfileSample
 
class  ProfileThread
 Collects all samples of a single thread. More...
 
class  ProfileMeasurement
 Create this class on the stack to start sampling timing information of a particular scope. More...
 

Macros

#define JPH_PROFILE_START(name)
 Start instrumenting program.
 
#define JPH_PROFILE_END()
 End instrumenting program.
 
#define JPH_PROFILE_THREAD_START(name)
 Start instrumenting a thread.
 
#define JPH_PROFILE_THREAD_END()
 End instrumenting a thread.
 
#define JPH_PROFILE_TAG2(line)
 Scope profiling measurement.
 
#define JPH_PROFILE_TAG(line)
 
#define JPH_PROFILE(...)
 
#define JPH_PROFILE_FUNCTION()
 Scope profiling for function.
 
#define JPH_PROFILE_NEXTFRAME()
 Update frame counter.
 
#define JPH_PROFILE_DUMP(...)
 Dump profiling info.
 

Macro Definition Documentation

◆ JPH_PROFILE

#define JPH_PROFILE ( ...)
Value:
ProfileMeasurement JPH_PROFILE_TAG(__LINE__)(__VA_ARGS__)
#define JPH_PROFILE_TAG(line)
Definition Profiler.h:267
Create this class on the stack to start sampling timing information of a particular scope.
Definition Profiler.h:229

◆ JPH_PROFILE_DUMP

#define JPH_PROFILE_DUMP ( ...)
Value:
void Dump(const string_view &inTag=string_view())
Definition Profiler.cpp:82
static Profiler * sInstance
Singleton instance.
Definition Profiler.h:117

Dump profiling info.

◆ JPH_PROFILE_END

#define JPH_PROFILE_END ( )
Value:
do { JPH_PROFILE_THREAD_END(); delete Profiler::sInstance; Profiler::sInstance = nullptr; } while (false)
#define JPH_PROFILE_THREAD_END()
End instrumenting a thread.
Definition Profiler.h:263

End instrumenting program.

◆ JPH_PROFILE_FUNCTION

#define JPH_PROFILE_FUNCTION ( )
Value:
JPH_PROFILE(JPH_FUNCTION_NAME)
#define JPH_PROFILE(...)
Definition Profiler.h:268

Scope profiling for function.

◆ JPH_PROFILE_NEXTFRAME

#define JPH_PROFILE_NEXTFRAME ( )
Value:
void NextFrame()
Increments the frame counter to provide statistics per frame.
Definition Profiler.cpp:66

Update frame counter.

◆ JPH_PROFILE_START

#define JPH_PROFILE_START ( name)
Value:
do { Profiler::sInstance = new Profiler; JPH_PROFILE_THREAD_START(name); } while (false)
#define JPH_PROFILE_THREAD_START(name)
Start instrumenting a thread.
Definition Profiler.h:260
Singleton class for managing profiling information.
Definition Profiler.h:96

Start instrumenting program.

◆ JPH_PROFILE_TAG

#define JPH_PROFILE_TAG ( line)
Value:
#define JPH_PROFILE_TAG2(line)
Scope profiling measurement.
Definition Profiler.h:266

◆ JPH_PROFILE_TAG2

#define JPH_PROFILE_TAG2 ( line)
Value:
profile##line

Scope profiling measurement.

◆ JPH_PROFILE_THREAD_END

#define JPH_PROFILE_THREAD_END ( )
Value:
do { delete ProfileThread::sGetInstance(); ProfileThread::sSetInstance(nullptr); } while (false)
static ProfileThread * sGetInstance()
Definition Profiler.h:220
static void sSetInstance(ProfileThread *inInstance)
Definition Profiler.h:219

End instrumenting a thread.

◆ JPH_PROFILE_THREAD_START

#define JPH_PROFILE_THREAD_START ( name)
Value:
do { if (Profiler::sInstance) ProfileThread::sSetInstance(new ProfileThread(name)); } while (false)
Collects all samples of a single thread.
Definition Profiler.h:201

Start instrumenting a thread.