OLD | NEW |
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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 // Read a pagemap state from the current pagemap_fd offset. | 189 // Read a pagemap state from the current pagemap_fd offset. |
190 // It returns true if succeeded. Otherwise, it returns false. | 190 // It returns true if succeeded. Otherwise, it returns false. |
191 static bool ReadProcPagemap(int pagemap_fd, PageState* state); | 191 static bool ReadProcPagemap(int pagemap_fd, PageState* state); |
192 | 192 |
193 // Returns the number of resident (including swapped) bytes of the memory | 193 // Returns the number of resident (including swapped) bytes of the memory |
194 // region starting at |first_address| and ending at |last_address| inclusive. | 194 // region starting at |first_address| and ending at |last_address| inclusive. |
195 static size_t GetCommittedSize(int pagemap_fd, | 195 static size_t GetCommittedSize(int pagemap_fd, |
196 uint64 first_address, | 196 uint64 first_address, |
197 uint64 last_address); | 197 uint64 last_address); |
198 | 198 |
199 // Write re-formatted /proc/self/maps into a file which has |filename_prefix| | 199 // Write re-formatted /proc/self/maps into a file with using |buffer| of |
200 // with using |buffer| of size |buffer_size|. | 200 // size |buffer_size|. |
| 201 // If |count| is zero, the filename will be "|filename_prefix|.<pid>.maps". |
| 202 // Otherwise, "|filename_prefix|.<pid>.|count|.maps". |
201 static void WriteMapsToFile(const char* filename_prefix, | 203 static void WriteMapsToFile(const char* filename_prefix, |
| 204 unsigned count, |
202 int buffer_size, | 205 int buffer_size, |
203 char buffer[]); | 206 char buffer[]); |
204 | 207 |
205 // Compute the global statistics from /proc/self/maps and |pagemap_fd|, and | 208 // Compute the global statistics from /proc/self/maps and |pagemap_fd|, and |
206 // store the statistics in |stats|. | 209 // store the statistics in |stats|. |
207 static void SnapshotGlobalStatsWithoutMalloc(int pagemap_fd, | 210 static void SnapshotGlobalStatsWithoutMalloc(int pagemap_fd, |
208 GlobalStats* stats, | 211 GlobalStats* stats, |
209 MMapListEntry* mmap_list, | 212 MMapListEntry* mmap_list, |
210 int mmap_list_length); | 213 int mmap_list_length); |
211 | 214 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 int mmap_list_length_; | 300 int mmap_list_length_; |
298 int num_mmap_allocations_; | 301 int num_mmap_allocations_; |
299 #endif // DEEP_HEAP_PROFILE | 302 #endif // DEEP_HEAP_PROFILE |
300 | 303 |
301 HeapProfileTable* heap_profile_; | 304 HeapProfileTable* heap_profile_; |
302 | 305 |
303 DISALLOW_COPY_AND_ASSIGN(DeepHeapProfile); | 306 DISALLOW_COPY_AND_ASSIGN(DeepHeapProfile); |
304 }; | 307 }; |
305 | 308 |
306 #endif // BASE_DEEP_HEAP_PROFILE_H_ | 309 #endif // BASE_DEEP_HEAP_PROFILE_H_ |
OLD | NEW |