HOPS
HOPS class reference
Classes | Namespaces | Macros | Enumerations
MHO_Profiler.hh File Reference
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <mutex>
#include <string>
#include <thread>
#include <vector>
#include "MHO_SelfName.hh"
#include "MHO_Timer.hh"

Go to the source code of this file.

Classes

struct  hops::MHO_ProfileEvent
 Class MHO_ProfileEvent. More...
 
class  hops::MHO_Profiler
 Class MHO_Profiler - uses the singleton pattern. More...
 

Namespaces

 hops
 

Macros

#define HOPS_USE_PROFILER
 
#define PROFILE_INFO_LEN   128
 
#define profiler_start()
 
#define profiler_stop()
 

Enumerations

enum  hops::MHO_ProfilerFlag : int { hops::pStartFlag = 1 , hops::pStopFlag = 2 }
 

Class Documentation

◆ hops::MHO_ProfileEvent

struct hops::MHO_ProfileEvent
Class Members
char fFilename[PROFILE_INFO_LEN]
int fFlag
char fFuncname[PROFILE_INFO_LEN]
int fLineNumber
uint64_t fThreadID
double fTime

Macro Definition Documentation

◆ HOPS_USE_PROFILER

#define HOPS_USE_PROFILER

◆ PROFILE_INFO_LEN

#define PROFILE_INFO_LEN   128

◆ profiler_start

#define profiler_start ( )
Value:
do \
{ \
MHO_Profiler::GetInstance().Lock(); \
MHO_Profiler::GetInstance().AddEntry(pStart, std::hash< std::thread::id >{}(std::this_thread::get_id()), \
std::string(sn::file_basename(__FILE__)), __LINE__, \
std::string(__PRETTY_FUNCTION__)); \
MHO_Profiler::GetInstance().Unlock(); \
} \
while(0)
constexpr const char * file_basename(const char *str)
Returns the base name (file name without path) from a given string.
Definition: MHO_SelfName.hh:54

◆ profiler_stop

#define profiler_stop ( )
Value:
do \
{ \
MHO_Profiler::GetInstance().Lock(); \
MHO_Profiler::GetInstance().AddEntry(pStop, std::hash< std::thread::id >{}(std::this_thread::get_id()), \
std::string(sn::file_basename(__FILE__)), __LINE__, \
std::string(__PRETTY_FUNCTION__)); \
MHO_Profiler::GetInstance().Unlock(); \
} \
while(0)