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

Side by Side Diff: runtime/bin/process_fuchsia.cc

Issue 2906943002: [Fuchsia] Calculate RSS using new task stat fields (Closed)
Patch Set: 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 | runtime/vm/os_fuchsia.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 (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #if !defined(DART_IO_DISABLED) 5 #if !defined(DART_IO_DISABLED)
6 6
7 #include "platform/globals.h" 7 #include "platform/globals.h"
8 #if defined(HOST_OS_FUCHSIA) 8 #if defined(HOST_OS_FUCHSIA)
9 9
10 #include "bin/process.h" 10 #include "bin/process.h"
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 int64_t Process::CurrentRSS() { 434 int64_t Process::CurrentRSS() {
435 mx_info_task_stats_t task_stats; 435 mx_info_task_stats_t task_stats;
436 mx_handle_t process = mx_process_self(); 436 mx_handle_t process = mx_process_self();
437 mx_status_t status = mx_object_get_info( 437 mx_status_t status = mx_object_get_info(
438 process, MX_INFO_TASK_STATS, &task_stats, sizeof(task_stats), NULL, NULL); 438 process, MX_INFO_TASK_STATS, &task_stats, sizeof(task_stats), NULL, NULL);
439 if (status != NO_ERROR) { 439 if (status != NO_ERROR) {
440 // TODO(zra): Translate this to a Unix errno. 440 // TODO(zra): Translate this to a Unix errno.
441 errno = status; 441 errno = status;
442 return -1; 442 return -1;
443 } 443 }
444 return task_stats.mem_committed_bytes; 444 return task_stats.mem_private_bytes + task_stats.mem_shared_bytes;
445 } 445 }
446 446
447 447
448 int64_t Process::MaxRSS() { 448 int64_t Process::MaxRSS() {
449 // There is currently no way to get the high watermark value on Fuchsia, so 449 // There is currently no way to get the high watermark value on Fuchsia, so
450 // just return the current RSS value. 450 // just return the current RSS value.
451 return CurrentRSS(); 451 return CurrentRSS();
452 } 452 }
453 453
454 454
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 836
837 void Process::ClearSignalHandler(intptr_t signal) { 837 void Process::ClearSignalHandler(intptr_t signal) {
838 } 838 }
839 839
840 } // namespace bin 840 } // namespace bin
841 } // namespace dart 841 } // namespace dart
842 842
843 #endif // defined(HOST_OS_FUCHSIA) 843 #endif // defined(HOST_OS_FUCHSIA)
844 844
845 #endif // !defined(DART_IO_DISABLED) 845 #endif // !defined(DART_IO_DISABLED)
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/os_fuchsia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698