3#ifndef EVENGINE_COMMON_PROFILE_H
4#define EVENGINE_COMMON_PROFILE_H
37 const char*
name =
nullptr;
39 uint32_t threadId = 0;
57 int minDepth = 0x7fffffff;
69 static void setEnabled(
bool on);
82 static void zoneBegin(
const char*
name,
const char* module =
nullptr);
84 static void zoneEnd();
91 static double frameMark();
94 static bool hasFrame();
96 static const std::vector<ZoneSample>& lastFrame();
105 [[nodiscard]]
static std::vector<ZoneSample> hotspots(std::size_t
limit,
double minSelfMs);
107 static std::string textReport();
113 static uint32_t moduleId(
const char* module);
122 static std::vector<ThreadBuffer*>& threads();
124 static Frame& lastFrameStorage();
125 static bool& hasFrameFlag();
136 Profiler::zoneBegin(
name, module);
146#define EV_PROFILE_CAT_I(a, b) a##b
147#define EV_PROFILE_CAT(a, b) EV_PROFILE_CAT_I(a, b)
150#define EV_PROFILE_ZONE_FUNC() \
151 ::eve::prof::ZoneScope EV_PROFILE_CAT(ev_zone_, __LINE__)(__func__)
154#define EV_PROFILE_ZONE(name) \
155 ::eve::prof::ZoneScope EV_PROFILE_CAT(ev_zone_, __LINE__)(name)
158#define EV_PROFILE_MODULE(module, name) \
159 ::eve::prof::ZoneScope EV_PROFILE_CAT(ev_zone_, __LINE__)(name, module)
#define EVENGINE_API_FOUNDATION_INLINE
仅供"只有内联成员"的类型使用的组宏:拥有者 dllexport,消费方不导入。
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
const ColourScope * parent
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