| 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_heap_dump_writer.h" | 5 #include "base/trace_event/heap_profiler_heap_dump_writer.h" |
| 6 | 6 |
| 7 #include <stdint.h> |
| 8 |
| 7 #include <algorithm> | 9 #include <algorithm> |
| 8 #include <iterator> | 10 #include <iterator> |
| 9 #include <tuple> | 11 #include <tuple> |
| 10 #include <utility> | 12 #include <utility> |
| 11 #include <vector> | 13 #include <vector> |
| 12 | 14 |
| 13 #include "base/format_macros.h" | 15 #include "base/format_macros.h" |
| 14 #include "base/logging.h" | 16 #include "base/logging.h" |
| 17 #include "base/macros.h" |
| 15 #include "base/strings/stringprintf.h" | 18 #include "base/strings/stringprintf.h" |
| 16 #include "base/trace_event/heap_profiler_stack_frame_deduplicator.h" | 19 #include "base/trace_event/heap_profiler_stack_frame_deduplicator.h" |
| 17 #include "base/trace_event/heap_profiler_type_name_deduplicator.h" | 20 #include "base/trace_event/heap_profiler_type_name_deduplicator.h" |
| 18 #include "base/trace_event/trace_event_argument.h" | 21 #include "base/trace_event/trace_event_argument.h" |
| 19 | 22 |
| 20 // Most of what the |HeapDumpWriter| does is aggregating detailed information | 23 // Most of what the |HeapDumpWriter| does is aggregating detailed information |
| 21 // about the heap and deciding what to dump. The Input to this process is a list | 24 // about the heap and deciding what to dump. The Input to this process is a list |
| 22 // of |AllocationContext|s and size pairs. | 25 // of |AllocationContext|s and size pairs. |
| 23 // | 26 // |
| 24 // The pairs are grouped into |Bucket|s. A bucket is a group of (context, size) | 27 // The pairs are grouped into |Bucket|s. A bucket is a group of (context, size) |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 const hash_map<AllocationContext, size_t>& bytes_by_size, | 291 const hash_map<AllocationContext, size_t>& bytes_by_size, |
| 289 StackFrameDeduplicator* stack_frame_deduplicator, | 292 StackFrameDeduplicator* stack_frame_deduplicator, |
| 290 TypeNameDeduplicator* type_name_deduplicator) { | 293 TypeNameDeduplicator* type_name_deduplicator) { |
| 291 internal::HeapDumpWriter writer(stack_frame_deduplicator, | 294 internal::HeapDumpWriter writer(stack_frame_deduplicator, |
| 292 type_name_deduplicator); | 295 type_name_deduplicator); |
| 293 return Serialize(writer.Summarize(bytes_by_size)); | 296 return Serialize(writer.Summarize(bytes_by_size)); |
| 294 } | 297 } |
| 295 | 298 |
| 296 } // namespace trace_event | 299 } // namespace trace_event |
| 297 } // namespace base | 300 } // namespace base |
| OLD | NEW |