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

Side by Side Diff: runtime/vm/os_linux.cc

Issue 2250793004: Observatory: Report peak process memory usage. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: sync Created 4 years, 4 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 | « runtime/vm/os_android.cc ('k') | runtime/vm/os_macos.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 #include "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_OS_LINUX) 6 #if defined(TARGET_OS_LINUX)
7 7
8 #include "vm/os.h" 8 #include "vm/os.h"
9 9
10 #include <errno.h> // NOLINT 10 #include <errno.h> // NOLINT
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 bool OS::AllowStackFrameIteratorFromAnotherThread() { 253 bool OS::AllowStackFrameIteratorFromAnotherThread() {
254 return false; 254 return false;
255 } 255 }
256 256
257 257
258 int OS::NumberOfAvailableProcessors() { 258 int OS::NumberOfAvailableProcessors() {
259 return sysconf(_SC_NPROCESSORS_ONLN); 259 return sysconf(_SC_NPROCESSORS_ONLN);
260 } 260 }
261 261
262 262
263 uintptr_t OS::MaxRSS() {
264 struct rusage usage;
265 usage.ru_maxrss = 0;
266 int r = getrusage(RUSAGE_SELF, &usage);
267 ASSERT(r == 0);
268 return usage.ru_maxrss * KB;
269 }
270
271
263 void OS::Sleep(int64_t millis) { 272 void OS::Sleep(int64_t millis) {
264 int64_t micros = millis * kMicrosecondsPerMillisecond; 273 int64_t micros = millis * kMicrosecondsPerMillisecond;
265 SleepMicros(micros); 274 SleepMicros(micros);
266 } 275 }
267 276
268 277
269 void OS::SleepMicros(int64_t micros) { 278 void OS::SleepMicros(int64_t micros) {
270 struct timespec req; // requested. 279 struct timespec req; // requested.
271 struct timespec rem; // remainder. 280 struct timespec rem; // remainder.
272 int64_t seconds = micros / kMicrosecondsPerSecond; 281 int64_t seconds = micros / kMicrosecondsPerSecond;
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 } 434 }
426 435
427 436
428 void OS::Exit(int code) { 437 void OS::Exit(int code) {
429 exit(code); 438 exit(code);
430 } 439 }
431 440
432 } // namespace dart 441 } // namespace dart
433 442
434 #endif // defined(TARGET_OS_LINUX) 443 #endif // defined(TARGET_OS_LINUX)
OLDNEW
« no previous file with comments | « runtime/vm/os_android.cc ('k') | runtime/vm/os_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698