Index: runtime/platform/thread_macos.cc |
diff --git a/runtime/platform/thread_macos.cc b/runtime/platform/thread_macos.cc |
index 8d4445d15c5e4baee3347e7d1a33fa60b6b1f3df..c4167d43c4cacb843ef653195cb4e4fe25db18e5 100644 |
--- a/runtime/platform/thread_macos.cc |
+++ b/runtime/platform/thread_macos.cc |
@@ -145,17 +145,22 @@ ThreadId Thread::GetCurrentThreadId() { |
void Thread::GetThreadCpuUsage(ThreadId thread_id, int64_t* cpu_usage) { |
ASSERT(thread_id == GetCurrentThreadId()); |
ASSERT(cpu_usage != NULL); |
- mach_msg_type_number_t count = THREAD_BASIC_INFO_COUNT; |
- thread_basic_info_data_t info_data; |
- thread_basic_info_t info = &info_data; |
- mach_port_t thread_port = mach_thread_self(); |
- kern_return_t r = thread_info(thread_port, THREAD_BASIC_INFO, |
- (thread_info_t)info, &count); |
- mach_port_deallocate(mach_task_self(), thread_port); |
- if (r == KERN_SUCCESS) { |
- *cpu_usage = (info->user_time.seconds * kMicrosecondsPerSecond) + |
- info->user_time.microseconds; |
- return; |
+ // TODO(johnmccutchan): Enable this after fixing issue with macos directory |
+ // watcher. |
+ const bool get_cpu_usage = false; |
+ if (get_cpu_usage) { |
+ mach_msg_type_number_t count = THREAD_BASIC_INFO_COUNT; |
+ thread_basic_info_data_t info_data; |
+ thread_basic_info_t info = &info_data; |
+ mach_port_t thread_port = mach_thread_self(); |
+ kern_return_t r = thread_info(thread_port, THREAD_BASIC_INFO, |
+ (thread_info_t)info, &count); |
+ mach_port_deallocate(mach_task_self(), thread_port); |
+ if (r == KERN_SUCCESS) { |
+ *cpu_usage = (info->user_time.seconds * kMicrosecondsPerSecond) + |
+ info->user_time.microseconds; |
+ return; |
+ } |
} |
*cpu_usage = 0; |
} |