20 #ifndef __mast__perflog_h__ 21 #define __mast__perflog_h__ 24 #include <sys/resource.h> 52 inline Event(
const std::string& nm):
60 _name_ref (e._name_ref),
61 _sys_time (e._sys_time),
62 _user_time (e._user_time)
67 inline const std::string&
name()
const {
return _name_ref;}
72 getrusage(RUSAGE_SELF, &r);
73 _sys_time = - (r.ru_stime.tv_sec + 1.e-6 * r.ru_stime.tv_usec);
74 _user_time = - (r.ru_utime.tv_sec + 1.e-6 * r.ru_utime.tv_usec);
80 getrusage(RUSAGE_SELF, &r);
81 _sys_time += r.ru_stime.tv_sec + 1.e-6 * r.ru_stime.tv_usec;
82 _user_time += r.ru_utime.tv_sec + 1.e-6 * r.ru_utime.tv_usec;
95 using map_type = std::map<std::string, MAST::Utility::PerformanceLogging::EventData>;
96 using stack_type = std::stack<MAST::Utility::PerformanceLogging::Event>;
113 "Empty event stack");
120 "Name provided must match as the last started event.");
124 it->second.sys += v.get_sys_time();
125 it->second.user += v.get_user_time();
152 #endif // __mast__perflog_h__
#define Assert1(cond, v1, msg)
#define Assert0(cond, msg)