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

Side by Side Diff: third_party/tcmalloc/chromium/src/deep-heap-profile.h

Issue 14823009: Add the reason in heap profiler dumps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 7 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // --- 5 // ---
6 // Author: Sainbayar Sukhbaatar 6 // Author: Sainbayar Sukhbaatar
7 // Dai Mikurube 7 // Dai Mikurube
8 // 8 //
9 // This file contains a class DeepHeapProfile and its public function 9 // This file contains a class DeepHeapProfile and its public function
10 // DeepHeapProfile::FillOrderedProfile() which works as an alternative of 10 // DeepHeapProfile::FillOrderedProfile() which works as an alternative of
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 DeepHeapProfile(HeapProfileTable* heap_profile, const char* prefix); 76 DeepHeapProfile(HeapProfileTable* heap_profile, const char* prefix);
77 ~DeepHeapProfile(); 77 ~DeepHeapProfile();
78 78
79 // Fills deep profile dump into |raw_buffer| of |buffer_size|, and return the 79 // Fills deep profile dump into |raw_buffer| of |buffer_size|, and return the
80 // actual size occupied by the dump in |raw_buffer|. It works as an 80 // actual size occupied by the dump in |raw_buffer|. It works as an
81 // alternative of HeapProfileTable::FillOrderedProfile. |raw_buffer| is not 81 // alternative of HeapProfileTable::FillOrderedProfile. |raw_buffer| is not
82 // terminated by zero. 82 // terminated by zero.
83 // 83 //
84 // In addition, a list of buckets is dumped into a ".buckets" file in 84 // In addition, a list of buckets is dumped into a ".buckets" file in
85 // descending order of allocated bytes. 85 // descending order of allocated bytes.
86 int FillOrderedProfile(char raw_buffer[], int buffer_size); 86 int FillOrderedProfile(char raw_buffer[],
Alexander Potapenko 2013/05/27 08:54:44 The style guide suggests to put the input paramete
Dai Mikurube (NOT FULLTIME) 2013/05/27 10:08:24 Thanks, sounds reasonable. Done.
87 int buffer_size,
88 const char* reason);
87 89
88 private: 90 private:
89 #ifdef USE_DEEP_HEAP_PROFILE 91 #ifdef USE_DEEP_HEAP_PROFILE
90 typedef HeapProfileTable::Stats Stats; 92 typedef HeapProfileTable::Stats Stats;
91 typedef HeapProfileTable::Bucket Bucket; 93 typedef HeapProfileTable::Bucket Bucket;
92 typedef HeapProfileTable::AllocValue AllocValue; 94 typedef HeapProfileTable::AllocValue AllocValue;
93 typedef HeapProfileTable::AllocationMap AllocationMap; 95 typedef HeapProfileTable::AllocationMap AllocationMap;
94 96
95 enum MapsRegionType { 97 enum MapsRegionType {
96 // Bytes of memory which were not recognized with /proc/<pid>/maps. 98 // Bytes of memory which were not recognized with /proc/<pid>/maps.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 size_(size), 130 size_(size),
129 cursor_(0) { 131 cursor_(0) {
130 } 132 }
131 133
132 int Size(); 134 int Size();
133 int FilledBytes(); 135 int FilledBytes();
134 void Clear(); 136 void Clear();
135 void Write(RawFD fd); 137 void Write(RawFD fd);
136 138
137 bool AppendChar(char v); 139 bool AppendChar(char v);
138 bool AppendString(const char* v, int d); 140 bool AppendString(const char* v, int d);
Alexander Potapenko 2013/05/27 08:54:44 While here, can you please choose more informative
Dai Mikurube (NOT FULLTIME) 2013/05/27 10:08:24 Done.
139 bool AppendInt(int v, int d, bool leading_zero); 141 bool AppendInt(int v, int d, bool leading_zero);
140 bool AppendLong(long v, int d); 142 bool AppendLong(long v, int d);
141 bool AppendUnsignedLong(unsigned long v, int d); 143 bool AppendUnsignedLong(unsigned long v, int d);
142 bool AppendInt64(int64 v, int d); 144 bool AppendInt64(int64 v, int d);
143 bool AppendPtr(uint64 v, int d); 145 bool AppendPtr(uint64 v, int d);
144 146
145 private: 147 private:
146 bool ForwardCursor(int appended); 148 bool ForwardCursor(int appended);
147 149
148 char *buffer_; 150 char *buffer_;
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 311
310 DeepBucketTable deep_table_; 312 DeepBucketTable deep_table_;
311 #endif // USE_DEEP_HEAP_PROFILE 313 #endif // USE_DEEP_HEAP_PROFILE
312 314
313 HeapProfileTable* heap_profile_; 315 HeapProfileTable* heap_profile_;
314 316
315 DISALLOW_COPY_AND_ASSIGN(DeepHeapProfile); 317 DISALLOW_COPY_AND_ASSIGN(DeepHeapProfile);
316 }; 318 };
317 319
318 #endif // BASE_DEEP_HEAP_PROFILE_H_ 320 #endif // BASE_DEEP_HEAP_PROFILE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698