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

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

Issue 2996803002: Add current rss and embedder name to Observatory (Closed)
Patch Set: Rebase and Merge Created 3 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_linux.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 #include "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(HOST_OS_FUCHSIA) 6 #if defined(HOST_OS_FUCHSIA)
7 7
8 #include "vm/os.h" 8 #include "vm/os.h"
9 9
10 #include <errno.h> 10 #include <errno.h>
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 ASSERT(Utils::IsPowerOfTwo(alignment)); 129 ASSERT(Utils::IsPowerOfTwo(alignment));
130 ASSERT(alignment >= kMinimumAlignment); 130 ASSERT(alignment >= kMinimumAlignment);
131 ASSERT(alignment <= OS::kMaxPreferredCodeAlignment); 131 ASSERT(alignment <= OS::kMaxPreferredCodeAlignment);
132 return alignment; 132 return alignment;
133 } 133 }
134 134
135 int OS::NumberOfAvailableProcessors() { 135 int OS::NumberOfAvailableProcessors() {
136 return sysconf(_SC_NPROCESSORS_CONF); 136 return sysconf(_SC_NPROCESSORS_CONF);
137 } 137 }
138 138
139 uintptr_t OS::MaxRSS() {
140 mx_info_task_stats_t task_stats;
141 mx_handle_t process = mx_process_self();
142 mx_status_t status = mx_object_get_info(
143 process, MX_INFO_TASK_STATS, &task_stats, sizeof(task_stats), NULL, NULL);
144 return (status == MX_OK)
145 ? (task_stats.mem_private_bytes + task_stats.mem_shared_bytes)
146 : 0;
147 }
148
149 void OS::Sleep(int64_t millis) { 139 void OS::Sleep(int64_t millis) {
150 SleepMicros(millis * kMicrosecondsPerMillisecond); 140 SleepMicros(millis * kMicrosecondsPerMillisecond);
151 } 141 }
152 142
153 void OS::SleepMicros(int64_t micros) { 143 void OS::SleepMicros(int64_t micros) {
154 mx_nanosleep(mx_deadline_after(micros * kNanosecondsPerMicrosecond)); 144 mx_nanosleep(mx_deadline_after(micros * kNanosecondsPerMicrosecond));
155 } 145 }
156 146
157 void OS::DebugBreak() { 147 void OS::DebugBreak() {
158 UNIMPLEMENTED(); 148 UNIMPLEMENTED();
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 abort(); 267 abort();
278 } 268 }
279 269
280 void OS::Exit(int code) { 270 void OS::Exit(int code) {
281 UNIMPLEMENTED(); 271 UNIMPLEMENTED();
282 } 272 }
283 273
284 } // namespace dart 274 } // namespace dart
285 275
286 #endif // defined(HOST_OS_FUCHSIA) 276 #endif // defined(HOST_OS_FUCHSIA)
OLDNEW
« no previous file with comments | « runtime/vm/os_android.cc ('k') | runtime/vm/os_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698