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

Side by Side Diff: base/trace_event/heap_profiler_stack_frame_deduplicator.cc

Issue 2857543002: tracing: Simplify TraceEventMemoryOverhead, use an enum insted of a map (Closed)
Patch Set: Fix compiler issues + omit empty values Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/trace_event/heap_profiler_stack_frame_deduplicator.h" 5 #include "base/trace_event/heap_profiler_stack_frame_deduplicator.h"
6 6
7 #include <inttypes.h> 7 #include <inttypes.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 out->append(","); 116 out->append(",");
117 } 117 }
118 118
119 out->append("}"); // End the |stackFrames| dictionary. 119 out->append("}"); // End the |stackFrames| dictionary.
120 } 120 }
121 121
122 void StackFrameDeduplicator::EstimateTraceMemoryOverhead( 122 void StackFrameDeduplicator::EstimateTraceMemoryOverhead(
123 TraceEventMemoryOverhead* overhead) { 123 TraceEventMemoryOverhead* overhead) {
124 size_t memory_usage = 124 size_t memory_usage =
125 EstimateMemoryUsage(frames_) + EstimateMemoryUsage(roots_); 125 EstimateMemoryUsage(frames_) + EstimateMemoryUsage(roots_);
126 overhead->Add("StackFrameDeduplicator", 126 overhead->Add(TraceEventMemoryOverhead::kHeapProfilerStackFrameDeduplicator,
127 sizeof(StackFrameDeduplicator) + memory_usage); 127 sizeof(StackFrameDeduplicator) + memory_usage);
128 } 128 }
129 129
130 } // namespace trace_event 130 } // namespace trace_event
131 } // namespace base 131 } // namespace base
OLDNEW
« no previous file with comments | « base/trace_event/heap_profiler_allocation_register.cc ('k') | base/trace_event/heap_profiler_type_name_deduplicator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698