| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |