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

Side by Side Diff: base/trace_event/process_memory_dump.cc

Issue 2884353004: fuchsia: base_unittests (mostly) compiling (Closed)
Patch Set: rebase 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 | « base/trace_event/memory_allocator_dump_unittest.cc ('k') | third_party/libxml/BUILD.gn » ('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 #include "base/trace_event/process_memory_dump.h" 5 #include "base/trace_event/process_memory_dump.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 for (size_t i = 0; i < page_count; i++) { 109 for (size_t i = 0; i < page_count; i++) {
110 vec[i].VirtualAddress = 110 vec[i].VirtualAddress =
111 reinterpret_cast<void*>(chunk_start + i * page_size); 111 reinterpret_cast<void*>(chunk_start + i * page_size);
112 } 112 }
113 DWORD vec_size = static_cast<DWORD>( 113 DWORD vec_size = static_cast<DWORD>(
114 page_count * sizeof(PSAPI_WORKING_SET_EX_INFORMATION)); 114 page_count * sizeof(PSAPI_WORKING_SET_EX_INFORMATION));
115 failure = !QueryWorkingSetEx(GetCurrentProcess(), vec.get(), vec_size); 115 failure = !QueryWorkingSetEx(GetCurrentProcess(), vec.get(), vec_size);
116 116
117 for (size_t i = 0; i < page_count; i++) 117 for (size_t i = 0; i < page_count; i++)
118 resident_page_count += vec[i].VirtualAttributes.Valid; 118 resident_page_count += vec[i].VirtualAttributes.Valid;
119 #elif defined(OS_FUCHSIA)
120 // TODO(fuchsia): Port, see https://crbug.com/706592.
121 ALLOW_UNUSED_LOCAL(chunk_start);
122 ALLOW_UNUSED_LOCAL(page_count);
119 #elif defined(OS_POSIX) 123 #elif defined(OS_POSIX)
120 int error_counter = 0; 124 int error_counter = 0;
121 int result = 0; 125 int result = 0;
122 // HANDLE_EINTR tries for 100 times. So following the same pattern. 126 // HANDLE_EINTR tries for 100 times. So following the same pattern.
123 do { 127 do {
124 result = 128 result =
125 #if defined(OS_AIX) 129 #if defined(OS_AIX)
126 mincore(reinterpret_cast<char*>(chunk_start), chunk_size, 130 mincore(reinterpret_cast<char*>(chunk_start), chunk_size,
127 reinterpret_cast<char*>(vec.get())); 131 reinterpret_cast<char*>(vec.get()));
128 #else 132 #else
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 378
375 MemoryAllocatorDump* ProcessMemoryDump::GetBlackHoleMad() { 379 MemoryAllocatorDump* ProcessMemoryDump::GetBlackHoleMad() {
376 DCHECK(is_black_hole_non_fatal_for_testing_); 380 DCHECK(is_black_hole_non_fatal_for_testing_);
377 if (!black_hole_mad_) 381 if (!black_hole_mad_)
378 black_hole_mad_.reset(new MemoryAllocatorDump("discarded", this)); 382 black_hole_mad_.reset(new MemoryAllocatorDump("discarded", this));
379 return black_hole_mad_.get(); 383 return black_hole_mad_.get();
380 } 384 }
381 385
382 } // namespace trace_event 386 } // namespace trace_event
383 } // namespace base 387 } // namespace base
OLDNEW
« no previous file with comments | « base/trace_event/memory_allocator_dump_unittest.cc ('k') | third_party/libxml/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698