EyeAI
Loading...
Searching...
No Matches
Profiling.hpp File Reference
#include <chrono>
#include <concurrentqueue.h>
#include <string_view>
Include dependency graph for Profiling.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ProfileScope
 A RAII object to start and stop a profile scope of a ProfilingFrame. More...
 
struct  ProfileScopeRecord
 
class  ProfilingFrame
 collection of profile records from different threads (lock-free thread-safe) More...
 

Macros

#define FUNCTION_NAME()
 
#define COMBINE(x, y)
 
#define COMBINE2(x, y)
 
#define PROFILE_SCOPE(name, profiling_frame)
 
#define PROFILE_DEPTH_SCOPE(name)
 
#define PROFILE_CAMERA_SCOPE(name)
 
#define PROFILE_OBJECT_SCOPE(name)
 
#define PROFILE_AUDIO_SCOPE(name)
 
#define PROFILE_FUNCTION(profiling_frame)
 
#define PROFILE_DEPTH_FUNCTION()
 
#define PROFILE_CAMERA_FUNCTION()
 
#define PROFILE_OBJECT_FUNCTION()
 
#define PROFILE_AUDIO_FUNCTION()
 

Typedefs

using profile_clock = std::chrono::high_resolution_clock
 

Functions

ProfilingFrameget_depth_profiling_frame ()
 
void set_last_depth_profiling_frame_formatted (std::string &&formatted)
 
std::string get_last_depth_profiling_frame_formatted ()
 
ProfilingFrameget_camera_profiling_frame ()
 
void set_last_camera_profiling_frame_formatted (std::string &&formatted)
 
std::string get_last_camera_profiling_frame_formatted ()
 
ProfilingFrameget_object_profiling_frame ()
 
void set_last_object_profiling_frame_formatted (std::string &&formatted)
 
std::string get_last_object_profiling_frame_formatted ()
 
ProfilingFrameget_audio_profiling_frame ()
 
void set_last_audio_profiling_frame_formatted (std::string &&formatted)
 
std::string get_last_audio_profiling_frame_formatted ()
 

Macro Definition Documentation

◆ COMBINE

#define COMBINE ( x,
y )
Value:
x##y

◆ COMBINE2

#define COMBINE2 ( x,
y )
Value:
COMBINE(x, y)
#define COMBINE(x, y)
Definition Profiling.hpp:93

◆ FUNCTION_NAME

#define FUNCTION_NAME ( )
Value:
(static_cast<const char*>(__func__))

◆ PROFILE_AUDIO_FUNCTION

#define PROFILE_AUDIO_FUNCTION ( )
Value:
#define PROFILE_FUNCTION(profiling_frame)
Definition Profiling.hpp:151
ProfilingFrame & get_audio_profiling_frame()
Definition Profiling.cpp:140

◆ PROFILE_AUDIO_SCOPE

#define PROFILE_AUDIO_SCOPE ( name)
Value:
#define PROFILE_SCOPE(name, profiling_frame)
Definition Profiling.hpp:134

◆ PROFILE_CAMERA_FUNCTION

#define PROFILE_CAMERA_FUNCTION ( )
Value:
ProfilingFrame & get_camera_profiling_frame()
Definition Profiling.cpp:124

◆ PROFILE_CAMERA_SCOPE

#define PROFILE_CAMERA_SCOPE ( name)

◆ PROFILE_DEPTH_FUNCTION

#define PROFILE_DEPTH_FUNCTION ( )
Value:
ProfilingFrame & get_depth_profiling_frame()
Definition Profiling.cpp:122

◆ PROFILE_DEPTH_SCOPE

#define PROFILE_DEPTH_SCOPE ( name)

◆ PROFILE_FUNCTION

#define PROFILE_FUNCTION ( profiling_frame)
Value:
const ProfileScope COMBINE2(__profile_scope_, __LINE__)( \
FUNCTION_NAME(), profiling_frame \
);
#define COMBINE2(x, y)
Definition Profiling.hpp:94
A RAII object to start and stop a profile scope of a ProfilingFrame.
Definition Profiling.hpp:14

◆ PROFILE_OBJECT_FUNCTION

#define PROFILE_OBJECT_FUNCTION ( )
Value:
ProfilingFrame & get_object_profiling_frame()
Definition Profiling.cpp:132

◆ PROFILE_OBJECT_SCOPE

#define PROFILE_OBJECT_SCOPE ( name)

◆ PROFILE_SCOPE

#define PROFILE_SCOPE ( name,
profiling_frame )
Value:
const ProfileScope COMBINE2(__profile_scope_, __LINE__)( \
name, profiling_frame \
);

Typedef Documentation

◆ profile_clock

using profile_clock = std::chrono::high_resolution_clock

Function Documentation

◆ get_audio_profiling_frame()

ProfilingFrame & get_audio_profiling_frame ( )

◆ get_camera_profiling_frame()

ProfilingFrame & get_camera_profiling_frame ( )

◆ get_depth_profiling_frame()

ProfilingFrame & get_depth_profiling_frame ( )

These four functions return global static variables (needed since NativeLib is loaded as a shared library, so a simple static variable does not work). Both ProfilingFrame's are thread-safe

◆ get_last_audio_profiling_frame_formatted()

std::string get_last_audio_profiling_frame_formatted ( )

◆ get_last_camera_profiling_frame_formatted()

std::string get_last_camera_profiling_frame_formatted ( )

◆ get_last_depth_profiling_frame_formatted()

std::string get_last_depth_profiling_frame_formatted ( )

◆ get_last_object_profiling_frame_formatted()

std::string get_last_object_profiling_frame_formatted ( )

◆ get_object_profiling_frame()

ProfilingFrame & get_object_profiling_frame ( )

◆ set_last_audio_profiling_frame_formatted()

void set_last_audio_profiling_frame_formatted ( std::string && formatted)

◆ set_last_camera_profiling_frame_formatted()

void set_last_camera_profiling_frame_formatted ( std::string && formatted)

◆ set_last_depth_profiling_frame_formatted()

void set_last_depth_profiling_frame_formatted ( std::string && formatted)

◆ set_last_object_profiling_frame_formatted()

void set_last_object_profiling_frame_formatted ( std::string && formatted)