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

Unified Diff: runtime/bin/thread_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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/run_vm_tests_fuchsia.cc ('k') | runtime/vm/os_fuchsia.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/thread_fuchsia.cc
diff --git a/runtime/bin/thread_fuchsia.cc b/runtime/bin/thread_fuchsia.cc
index fa5397ff131e138c50e7436be8be23242c9d1bf5..0e3408e7b68a390bdb5f9783cf0809575617276a 100644
--- a/runtime/bin/thread_fuchsia.cc
+++ b/runtime/bin/thread_fuchsia.cc
@@ -8,9 +8,11 @@
#include "bin/thread.h"
#include "bin/thread_fuchsia.h"
-#include <errno.h> // NOLINT
-#include <sys/resource.h> // NOLINT
-#include <sys/time.h> // NOLINT
+#include <errno.h> // NOLINT
+#include <magenta/syscalls.h> // NOLINT
+#include <magenta/types.h> // NOLINT
+#include <sys/resource.h> // NOLINT
+#include <sys/time.h> // NOLINT
#include "platform/assert.h"
#include "platform/utils.h"
@@ -166,7 +168,9 @@ bool Thread::Compare(ThreadId a, ThreadId b) {
void Thread::GetThreadCpuUsage(ThreadId thread_id, int64_t* cpu_usage) {
rmacnak 2017/01/06 18:34:24 bin::Thread::GetThreadCpuUsage is unused. We shoul
zra 2017/01/07 22:45:17 Done.
- UNIMPLEMENTED();
+ ASSERT(thread_id == GetCurrentThreadId());
+ ASSERT(cpu_usage != NULL);
+ *cpu_usage = mx_time_get(MX_CLOCK_THREAD) / kNanosecondsPerMicrosecond;
}
« no previous file with comments | « runtime/bin/run_vm_tests_fuchsia.cc ('k') | runtime/vm/os_fuchsia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698