Chromium Code Reviews| 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 | 9 |
| 10 #include "deep-heap-profile.h" | 10 #include "deep-heap-profile.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 120 #if defined(__linux__) | 120 #if defined(__linux__) |
| 121 | 121 |
| 122 void DeepHeapProfile::MemoryInfoGetterLinux::Initialize() { | 122 void DeepHeapProfile::MemoryInfoGetterLinux::Initialize() { |
| 123 char filename[100]; | 123 char filename[100]; |
| 124 snprintf(filename, sizeof(filename), "/proc/%d/pagemap", | 124 snprintf(filename, sizeof(filename), "/proc/%d/pagemap", |
| 125 static_cast<int>(getpid())); | 125 static_cast<int>(getpid())); |
| 126 pagemap_fd_ = open(filename, O_RDONLY); | 126 pagemap_fd_ = open(filename, O_RDONLY); |
| 127 RAW_CHECK(pagemap_fd_ != -1, "Failed to open /proc/self/pagemap"); | 127 RAW_CHECK(pagemap_fd_ != -1, "Failed to open /proc/self/pagemap"); |
| 128 | 128 |
| 129 if (pageframe_type_ == DUMP_PAGECOUNT) { | 129 if (pageframe_type_ == DUMP_PAGECOUNT) { |
| 130 snprintf(filename, sizeof(filename), "/proc/kpagecount", | 130 snprintf(filename, sizeof(filename), "/proc/kpagecount"); |
| 131 static_cast<int>(getpid())); | |
|
jar (doing other things)
2014/01/29 02:33:12
This looks like a bug. How about fixing it with a
Dai Mikurube (NOT FULLTIME)
2014/01/29 03:24:13
Ah, yes. It's my bug. Thanks for working on it, Sa
| |
| 132 kpagecount_fd_ = open(filename, O_RDONLY); | 131 kpagecount_fd_ = open(filename, O_RDONLY); |
| 133 if (kpagecount_fd_ == -1) | 132 if (kpagecount_fd_ == -1) |
| 134 RAW_LOG(0, "Failed to open /proc/kpagecount"); | 133 RAW_LOG(0, "Failed to open /proc/kpagecount"); |
| 135 } | 134 } |
| 136 } | 135 } |
| 137 | 136 |
| 138 size_t DeepHeapProfile::MemoryInfoGetterLinux::CommittedSize( | 137 size_t DeepHeapProfile::MemoryInfoGetterLinux::CommittedSize( |
| 139 uint64 first_address, | 138 uint64 first_address, |
| 140 uint64 last_address, | 139 uint64 last_address, |
| 141 DeepHeapProfile::TextBuffer* buffer) const { | 140 DeepHeapProfile::TextBuffer* buffer) const { |
| (...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1153 DeepHeapProfile::~DeepHeapProfile() { | 1152 DeepHeapProfile::~DeepHeapProfile() { |
| 1154 } | 1153 } |
| 1155 | 1154 |
| 1156 void DeepHeapProfile::DumpOrderedProfile(const char* reason, | 1155 void DeepHeapProfile::DumpOrderedProfile(const char* reason, |
| 1157 char raw_buffer[], | 1156 char raw_buffer[], |
| 1158 int buffer_size, | 1157 int buffer_size, |
| 1159 RawFD fd) { | 1158 RawFD fd) { |
| 1160 } | 1159 } |
| 1161 | 1160 |
| 1162 #endif // USE_DEEP_HEAP_PROFILE | 1161 #endif // USE_DEEP_HEAP_PROFILE |
| OLD | NEW |