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

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

Issue 2892273003: Produce more useful stack traces for heap profiling. (Closed)
Patch Set: Comments from dskiba. 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
« no previous file with comments | « no previous file | base/trace_event/heap_profiler_allocation_context_tracker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_ALLOCATION_CONTEXT_H_ 5 #ifndef BASE_TRACE_EVENT_HEAP_PROFILER_ALLOCATION_CONTEXT_H_
6 #define BASE_TRACE_EVENT_HEAP_PROFILER_ALLOCATION_CONTEXT_H_ 6 #define BASE_TRACE_EVENT_HEAP_PROFILER_ALLOCATION_CONTEXT_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 const void* value; 62 const void* value;
63 }; 63 };
64 64
65 bool BASE_EXPORT operator < (const StackFrame& lhs, const StackFrame& rhs); 65 bool BASE_EXPORT operator < (const StackFrame& lhs, const StackFrame& rhs);
66 bool BASE_EXPORT operator == (const StackFrame& lhs, const StackFrame& rhs); 66 bool BASE_EXPORT operator == (const StackFrame& lhs, const StackFrame& rhs);
67 bool BASE_EXPORT operator != (const StackFrame& lhs, const StackFrame& rhs); 67 bool BASE_EXPORT operator != (const StackFrame& lhs, const StackFrame& rhs);
68 68
69 struct BASE_EXPORT Backtrace { 69 struct BASE_EXPORT Backtrace {
70 Backtrace(); 70 Backtrace();
71 71
72 // If the stack is higher than what can be stored here, the bottom frames 72 // If the stack is higher than what can be stored here, the top frames
73 // (the ones closer to main()) are stored. Depth of 12 is enough for most 73 // (the ones further from main()) are stored. Depth of 12 is enough for most
74 // pseudo traces (see above), but not for native traces, where we need more. 74 // pseudo traces (see above), but not for native traces, where we need more.
75 enum { kMaxFrameCount = 48 }; 75 enum { kMaxFrameCount = 48 };
76 StackFrame frames[kMaxFrameCount]; 76 StackFrame frames[kMaxFrameCount];
77 size_t frame_count; 77 size_t frame_count;
78 }; 78 };
79 79
80 bool BASE_EXPORT operator==(const Backtrace& lhs, const Backtrace& rhs); 80 bool BASE_EXPORT operator==(const Backtrace& lhs, const Backtrace& rhs);
81 bool BASE_EXPORT operator!=(const Backtrace& lhs, const Backtrace& rhs); 81 bool BASE_EXPORT operator!=(const Backtrace& lhs, const Backtrace& rhs);
82 82
83 // The |AllocationContext| is context metadata that is kept for every allocation 83 // The |AllocationContext| is context metadata that is kept for every allocation
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 }; 123 };
124 124
125 template <> 125 template <>
126 struct BASE_EXPORT hash<base::trace_event::AllocationContext> { 126 struct BASE_EXPORT hash<base::trace_event::AllocationContext> {
127 size_t operator()(const base::trace_event::AllocationContext& context) const; 127 size_t operator()(const base::trace_event::AllocationContext& context) const;
128 }; 128 };
129 129
130 } // namespace std 130 } // namespace std
131 131
132 #endif // BASE_TRACE_EVENT_HEAP_PROFILER_ALLOCATION_CONTEXT_H_ 132 #endif // BASE_TRACE_EVENT_HEAP_PROFILER_ALLOCATION_CONTEXT_H_
OLDNEW
« no previous file with comments | « no previous file | base/trace_event/heap_profiler_allocation_context_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698