X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fprofiler.h;h=ffffae915b5d79af7dddc41cce822a39f48ff11c;hp=a20b8d847bc14f2ac107129ab377bd1a95974393;hb=b716ae547424e4e4bbda86781a151c31e3a64e67;hpb=a8297c3461718f2d9afc7a2f8ca620d320ac5f97 diff --git a/src/profiler.h b/src/profiler.h index a20b8d8..ffffae9 100644 --- a/src/profiler.h +++ b/src/profiler.h @@ -1,6 +1,7 @@ #ifndef _PROFILER_H #define _PROFILER_H +#include #include #include #include @@ -12,12 +13,16 @@ namespace IPDF class Profiler { public: - Profiler() {} + Profiler() : m_enabled(false) {} void BeginZone(std::string name); void EndZone(); void EndFrame(); + + void Enable(bool enabled) { m_enabled = enabled; } + + void AddCounter(std::string name, uint64_t amt); private: struct ProfileZone { @@ -30,7 +35,9 @@ namespace IPDF }; std::map m_zones; + std::map m_counters; std::stack m_zone_stack; + bool m_enabled; }; extern Profiler g_profiler;