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

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

Issue 2613283002: Fuchsia: Use new call to get thread CPU time (Closed)
Patch Set: Small fix Created 3 years, 11 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
« runtime/bin/thread_fuchsia.cc ('K') | « runtime/bin/thread_fuchsia.cc ('k') | no next file » | 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(TARGET_OS_FUCHSIA) 6 #if defined(TARGET_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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 93
94 int64_t OS::GetCurrentMonotonicMicros() { 94 int64_t OS::GetCurrentMonotonicMicros() {
95 int64_t ticks = GetCurrentMonotonicTicks(); 95 int64_t ticks = GetCurrentMonotonicTicks();
96 ASSERT(GetCurrentMonotonicFrequency() == kNanosecondsPerSecond); 96 ASSERT(GetCurrentMonotonicFrequency() == kNanosecondsPerSecond);
97 return ticks / kNanosecondsPerMicrosecond; 97 return ticks / kNanosecondsPerMicrosecond;
98 } 98 }
99 99
100 100
101 int64_t OS::GetCurrentThreadCPUMicros() { 101 int64_t OS::GetCurrentThreadCPUMicros() {
102 UNIMPLEMENTED(); 102 return mx_time_get(MX_CLOCK_THREAD) / kNanosecondsPerMicrosecond;
103 return 0;
104 } 103 }
105 104
106 105
107 // TODO(5411554): May need to hoist these architecture dependent code 106 // TODO(5411554): May need to hoist these architecture dependent code
108 // into a architecture specific file e.g: os_ia32_fuchsia.cc 107 // into a architecture specific file e.g: os_ia32_fuchsia.cc
109 intptr_t OS::ActivationFrameAlignment() { 108 intptr_t OS::ActivationFrameAlignment() {
110 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) || \ 109 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) || \
111 defined(TARGET_ARCH_ARM64) 110 defined(TARGET_ARCH_ARM64)
112 const int kMinimumAlignment = 16; 111 const int kMinimumAlignment = 16;
113 #elif defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_DBC) 112 #elif defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_DBC)
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 } 305 }
307 306
308 307
309 void OS::Exit(int code) { 308 void OS::Exit(int code) {
310 UNIMPLEMENTED(); 309 UNIMPLEMENTED();
311 } 310 }
312 311
313 } // namespace dart 312 } // namespace dart
314 313
315 #endif // defined(TARGET_OS_FUCHSIA) 314 #endif // defined(TARGET_OS_FUCHSIA)
OLDNEW
« runtime/bin/thread_fuchsia.cc ('K') | « runtime/bin/thread_fuchsia.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698