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

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

Issue 2052803002: Alternative heap dumping scheme. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: New stackFrames format Created 4 years, 3 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_STACK_FRAME_DEDUPLICATOR_H_ 5 #ifndef BASE_TRACE_EVENT_HEAP_PROFILER_STACK_FRAME_DEDUPLICATOR_H_
6 #define BASE_TRACE_EVENT_HEAP_PROFILER_STACK_FRAME_DEDUPLICATOR_H_ 6 #define BASE_TRACE_EVENT_HEAP_PROFILER_STACK_FRAME_DEDUPLICATOR_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 24 matching lines...) Expand all
35 ~FrameNode(); 35 ~FrameNode();
36 36
37 StackFrame frame; 37 StackFrame frame;
38 38
39 // The index of the parent stack frame in |frames_|, or -1 if there is no 39 // The index of the parent stack frame in |frames_|, or -1 if there is no
40 // parent frame (when it is at the bottom of the call stack). 40 // parent frame (when it is at the bottom of the call stack).
41 int parent_frame_index; 41 int parent_frame_index;
42 42
43 // Indices into |frames_| of frames called from the current frame. 43 // Indices into |frames_| of frames called from the current frame.
44 std::map<StackFrame, int> children; 44 std::map<StackFrame, int> children;
45
46 // Whether index of this node was ever returned from Insert().
47 bool indexed;
45 }; 48 };
46 49
47 using ConstIterator = std::vector<FrameNode>::const_iterator; 50 using ConstIterator = std::vector<FrameNode>::const_iterator;
48 51
49 StackFrameDeduplicator(); 52 StackFrameDeduplicator();
50 ~StackFrameDeduplicator() override; 53 ~StackFrameDeduplicator() override;
51 54
52 // Inserts a backtrace where |beginFrame| is a pointer to the bottom frame 55 // Inserts a backtrace where |beginFrame| is a pointer to the bottom frame
53 // (e.g. main) and |endFrame| is a pointer past the top frame (most recently 56 // (e.g. main) and |endFrame| is a pointer past the top frame (most recently
54 // called function), and returns the index of its leaf node in |frames_|. 57 // called function), and returns the index of its leaf node in |frames_|.
(...skipping 15 matching lines...) Expand all
70 std::map<StackFrame, int> roots_; 73 std::map<StackFrame, int> roots_;
71 std::vector<FrameNode> frames_; 74 std::vector<FrameNode> frames_;
72 75
73 DISALLOW_COPY_AND_ASSIGN(StackFrameDeduplicator); 76 DISALLOW_COPY_AND_ASSIGN(StackFrameDeduplicator);
74 }; 77 };
75 78
76 } // namespace trace_event 79 } // namespace trace_event
77 } // namespace base 80 } // namespace base
78 81
79 #endif // BASE_TRACE_EVENT_HEAP_PROFILER_STACK_FRAME_DEDUPLICATOR_H_ 82 #endif // BASE_TRACE_EVENT_HEAP_PROFILER_STACK_FRAME_DEDUPLICATOR_H_
OLDNEW
« no previous file with comments | « base/trace_event/heap_profiler_heap_dump_writer.cc ('k') | base/trace_event/heap_profiler_stack_frame_deduplicator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698