m_zone_stack.push(name);
}
+void Profiler::AddCounter(std::string name, uint64_t amt)
+{
+ if (!m_counters.count(name))
+ m_counters[name] = amt;
+ else
+ m_counters[name] += amt;
+}
+
void Profiler::EndZone()
{
std::string name = m_zone_stack.top();
it.second.tics_frame = 0;
it.second.calls_frame = 0;
}
+
+ for (auto& it : m_counters)
+ {
+ if (m_enabled)
+ {
+ printf("perf_counter\t\"%s\"\t%lu\n", it.first.c_str(), it.second);
+ }
+ it.second = 0;
+ }
}