| 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 #ifndef BASE_TRACE_EVENT_HEAP_PROFILER_HEAP_DUMP_WRITER_H_ | 5 #ifndef BASE_TRACE_EVENT_HEAP_PROFILER_HEAP_DUMP_WRITER_H_ |
| 6 #define BASE_TRACE_EVENT_HEAP_PROFILER_HEAP_DUMP_WRITER_H_ | 6 #define BASE_TRACE_EVENT_HEAP_PROFILER_HEAP_DUMP_WRITER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <set> | 11 #include <set> |
| 12 #include <unordered_map> | 12 #include <unordered_map> |
| 13 | 13 |
| 14 #include "base/base_export.h" | 14 #include "base/base_export.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/trace_event/heap_profiler_allocation_context.h" | 16 #include "base/trace_event/heap_profiler_allocation_context.h" |
| 17 | 17 |
| 18 namespace base { | 18 namespace base { |
| 19 namespace trace_event { | 19 namespace trace_event { |
| 20 | 20 |
| 21 class MemoryDumpSessionState; | 21 class HeapProfilerSerializationState; |
| 22 class StackFrameDeduplicator; | 22 class StackFrameDeduplicator; |
| 23 class TracedValue; | 23 class TracedValue; |
| 24 class TypeNameDeduplicator; | 24 class TypeNameDeduplicator; |
| 25 | 25 |
| 26 // Aggregates |metrics_by_context|, recursively breaks down the heap, and | 26 // Aggregates |metrics_by_context|, recursively breaks down the heap, and |
| 27 // returns a traced value with an "entries" array that can be dumped in the | 27 // returns a traced value with an "entries" array that can be dumped in the |
| 28 // trace log, following the format described in https://goo.gl/KY7zVE. The | 28 // trace log, following the format described in https://goo.gl/KY7zVE. The |
| 29 // number of entries is kept reasonable because long tails are not included. | 29 // number of entries is kept reasonable because long tails are not included. |
| 30 BASE_EXPORT std::unique_ptr<TracedValue> ExportHeapDump( | 30 BASE_EXPORT std::unique_ptr<TracedValue> ExportHeapDump( |
| 31 const std::unordered_map<AllocationContext, AllocationMetrics>& | 31 const std::unordered_map<AllocationContext, AllocationMetrics>& |
| 32 metrics_by_context, | 32 metrics_by_context, |
| 33 const MemoryDumpSessionState& session_state); | 33 const HeapProfilerSerializationState& heap_profiler_serialization_state); |
| 34 | 34 |
| 35 namespace internal { | 35 namespace internal { |
| 36 | 36 |
| 37 namespace { | 37 namespace { |
| 38 struct Bucket; | 38 struct Bucket; |
| 39 } | 39 } |
| 40 | 40 |
| 41 // An entry in the "entries" array as described in https://goo.gl/KY7zVE. | 41 // An entry in the "entries" array as described in https://goo.gl/KY7zVE. |
| 42 struct BASE_EXPORT Entry { | 42 struct BASE_EXPORT Entry { |
| 43 size_t size; | 43 size_t size; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 uint32_t breakdown_threshold_bytes_; | 106 uint32_t breakdown_threshold_bytes_; |
| 107 | 107 |
| 108 DISALLOW_COPY_AND_ASSIGN(HeapDumpWriter); | 108 DISALLOW_COPY_AND_ASSIGN(HeapDumpWriter); |
| 109 }; | 109 }; |
| 110 | 110 |
| 111 } // namespace internal | 111 } // namespace internal |
| 112 } // namespace trace_event | 112 } // namespace trace_event |
| 113 } // namespace base | 113 } // namespace base |
| 114 | 114 |
| 115 #endif // BASE_TRACE_EVENT_HEAP_PROFILER_HEAP_DUMP_WRITER_H_ | 115 #endif // BASE_TRACE_EVENT_HEAP_PROFILER_HEAP_DUMP_WRITER_H_ |
| OLD | NEW |