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

Side by Side Diff: base/trace_event/heap_profiler_serialization_state.h

Issue 2650863003: [tracing] Switch to new heap dump format. (Closed)
Patch Set: Fix rebase damage 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 #ifndef BASE_TRACE_EVENT_HEAP_PROFILER_SERIALIZATION_STATE_H_ 5 #ifndef BASE_TRACE_EVENT_HEAP_PROFILER_SERIALIZATION_STATE_H_
6 #define BASE_TRACE_EVENT_HEAP_PROFILER_SERIALIZATION_STATE_H_ 6 #define BASE_TRACE_EVENT_HEAP_PROFILER_SERIALIZATION_STATE_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <set> 9 #include <set>
10 10
(...skipping 11 matching lines...) Expand all
22 : public RefCountedThreadSafe<HeapProfilerSerializationState> { 22 : public RefCountedThreadSafe<HeapProfilerSerializationState> {
23 public: 23 public:
24 HeapProfilerSerializationState(); 24 HeapProfilerSerializationState();
25 25
26 // Returns the stack frame deduplicator that should be used by memory dump 26 // Returns the stack frame deduplicator that should be used by memory dump
27 // providers when doing a heap dump. 27 // providers when doing a heap dump.
28 StackFrameDeduplicator* stack_frame_deduplicator() const { 28 StackFrameDeduplicator* stack_frame_deduplicator() const {
29 return stack_frame_deduplicator_.get(); 29 return stack_frame_deduplicator_.get();
30 } 30 }
31 31
32 void SetStackFrameDeduplicator(
33 std::unique_ptr<StackFrameDeduplicator> stack_frame_deduplicator);
34
35 // Returns the type name deduplicator that should be used by memory dump 32 // Returns the type name deduplicator that should be used by memory dump
36 // providers when doing a heap dump. 33 // providers when doing a heap dump.
37 TypeNameDeduplicator* type_name_deduplicator() const { 34 TypeNameDeduplicator* type_name_deduplicator() const {
38 return type_name_deduplicator_.get(); 35 return type_name_deduplicator_.get();
39 } 36 }
40 37
41 void SetTypeNameDeduplicator( 38 // Returns generic string deduplicator used by other deduplicators.
42 std::unique_ptr<TypeNameDeduplicator> type_name_deduplicator); 39 StringDeduplicator* string_deduplicator() const {
40 return string_deduplicator_.get();
41 }
42
43 void CreateDeduplicators();
43 44
44 void SetAllowedDumpModes( 45 void SetAllowedDumpModes(
45 std::set<MemoryDumpLevelOfDetail> allowed_dump_modes); 46 std::set<MemoryDumpLevelOfDetail> allowed_dump_modes);
46 47
47 bool IsDumpModeAllowed(MemoryDumpLevelOfDetail dump_mode) const; 48 bool IsDumpModeAllowed(MemoryDumpLevelOfDetail dump_mode) const;
48 49
49 void set_heap_profiler_breakdown_threshold_bytes(uint32_t value) { 50 void set_heap_profiler_breakdown_threshold_bytes(uint32_t value) {
50 heap_profiler_breakdown_threshold_bytes_ = value; 51 heap_profiler_breakdown_threshold_bytes_ = value;
51 } 52 }
52 53
53 uint32_t heap_profiler_breakdown_threshold_bytes() const { 54 uint32_t heap_profiler_breakdown_threshold_bytes() const {
54 return heap_profiler_breakdown_threshold_bytes_; 55 return heap_profiler_breakdown_threshold_bytes_;
55 } 56 }
56 57
57 private: 58 private:
58 friend class RefCountedThreadSafe<HeapProfilerSerializationState>; 59 friend class RefCountedThreadSafe<HeapProfilerSerializationState>;
59 ~HeapProfilerSerializationState(); 60 ~HeapProfilerSerializationState();
60 61
61 // Deduplicates backtraces in heap dumps so they can be written once when the 62 // Deduplicates backtraces in heap dumps so they can be written once when the
62 // trace is finalized. 63 // trace is finalized.
63 std::unique_ptr<StackFrameDeduplicator> stack_frame_deduplicator_; 64 std::unique_ptr<StackFrameDeduplicator> stack_frame_deduplicator_;
64 65
65 // Deduplicates type names in heap dumps so they can be written once when the 66 // Deduplicates type names in heap dumps so they can be written once when the
66 // trace is finalized. 67 // trace is finalized.
67 std::unique_ptr<TypeNameDeduplicator> type_name_deduplicator_; 68 std::unique_ptr<TypeNameDeduplicator> type_name_deduplicator_;
68 69
70 // Generic string deduplicator, used by other deduplicators; must be defined
71 // after ones that depend on it.
72 std::unique_ptr<StringDeduplicator> string_deduplicator_;
73
69 uint32_t heap_profiler_breakdown_threshold_bytes_; 74 uint32_t heap_profiler_breakdown_threshold_bytes_;
70 }; 75 };
71 76
72 } // namespace trace_event 77 } // namespace trace_event
73 } // namespace base 78 } // namespace base
74 79
75 #endif // BASE_TRACE_EVENT_HEAP_PROFILER_SERIALIZATION_STATE_H 80 #endif // BASE_TRACE_EVENT_HEAP_PROFILER_SERIALIZATION_STATE_H
OLDNEW
« no previous file with comments | « base/trace_event/heap_profiler_heap_dump_writer_unittest.cc ('k') | base/trace_event/heap_profiler_serialization_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698