Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2401)

Unified Diff: base/trace_event/trace_event_memory_overhead.cc

Issue 1265393007: Reland of [tracing] Fix, simplify and speed up accounting of TraceEvent memory overhead (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/trace_event/trace_event_memory_overhead.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/trace_event_memory_overhead.cc
diff --git a/base/trace_event/trace_event_memory_overhead.cc b/base/trace_event/trace_event_memory_overhead.cc
index 2b4ed35e74b3bc9c763df5a1143cb61156838efa..b685d7183f2e4a2411cc212ed3b3987780dee85f 100644
--- a/base/trace_event/trace_event_memory_overhead.cc
+++ b/base/trace_event/trace_event_memory_overhead.cc
@@ -122,6 +122,13 @@
Add("TraceEventMemoryOverhead", estimated_size);
}
+size_t TraceEventMemoryOverhead::GetCount(const char* object_type) const {
+ const auto& it = allocated_objects_.find(object_type);
+ if (it == allocated_objects_.end())
+ return 0u;
+ return it->second.count;
+}
+
void TraceEventMemoryOverhead::Update(const TraceEventMemoryOverhead& other) {
for (const auto& it : other.allocated_objects_) {
AddOrCreateInternal(it.first, it.second.count,
« no previous file with comments | « base/trace_event/trace_event_memory_overhead.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698