3#ifndef EVENGINE_COMMON_PROFILE_H
4#define EVENGINE_COMMON_PROFILE_H
36 const char*
name =
nullptr;
38 uint32_t threadId = 0;
56 int minDepth = 0x7fffffff;
68 static void setEnabled(
bool on);
73 static void zoneBegin(
const char*
name,
const char* module =
nullptr);
75 static void zoneEnd();
82 static double frameMark();
85 static bool hasFrame();
87 static const std::vector<ZoneSample>& lastFrame();
89 static std::string textReport();
95 static uint32_t moduleId(
const char* module);
104 static std::vector<ThreadBuffer*>& threads();
106 static Frame& lastFrameStorage();
107 static bool& hasFrameFlag();
118 Profiler::zoneBegin(
name, module);
128#define EV_PROFILE_CAT_I(a, b) a##b
129#define EV_PROFILE_CAT(a, b) EV_PROFILE_CAT_I(a, b)
132#define EV_PROFILE_ZONE_FUNC() \
133 ::eve::prof::ZoneScope EV_PROFILE_CAT(ev_zone_, __LINE__)(__func__)
136#define EV_PROFILE_ZONE(name) \
137 ::eve::prof::ZoneScope EV_PROFILE_CAT(ev_zone_, __LINE__)(name)
140#define EV_PROFILE_MODULE(module, name) \
141 ::eve::prof::ZoneScope EV_PROFILE_CAT(ev_zone_, __LINE__)(name, module)
#define EVENGINE_API_FOUNDATION_INLINE
仅供"只有内联成员"的类型使用的组宏:拥有者 dllexport,消费方不导入。
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Global zone collector + per-frame aggregator.
RAII scoped zone (used via the EV_PROFILE_* macros).
ZoneScope(const char *name, const char *module=nullptr)
Zone scope.
ZoneScope(const ZoneScope &)=delete
ZoneScope & operator=(const ZoneScope &)=delete
One completed profiling zone (pre-order, parent-linked within a thread).
Per-module/per-zone aggregate of the last completed frame.
std::string std::string name