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

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

Issue 65983005: Post landing fixes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/profiler.cc ('k') | runtime/vm/signal_handler.h » ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 "platform/globals.h" 5 #include "platform/globals.h"
6 #if defined(TARGET_OS_MACOS) 6 #if defined(TARGET_OS_MACOS)
7 7
8 #include "vm/isolate.h" 8 #include "vm/isolate.h"
9 #include "vm/json_stream.h" 9 #include "vm/json_stream.h"
10 #include "vm/profiler.h" 10 #include "vm/profiler.h"
(...skipping 10 matching lines...) Expand all
21 uintptr_t stack_lower, 21 uintptr_t stack_lower,
22 uintptr_t stack_upper) { 22 uintptr_t stack_upper) {
23 SampleBuffer* sample_buffer = profiler_data->sample_buffer(); 23 SampleBuffer* sample_buffer = profiler_data->sample_buffer();
24 Sample* sample = sample_buffer->ReserveSample(); 24 Sample* sample = sample_buffer->ReserveSample();
25 ASSERT(sample != NULL); 25 ASSERT(sample != NULL);
26 sample->timestamp = OS::GetCurrentTimeMicros(); 26 sample->timestamp = OS::GetCurrentTimeMicros();
27 // TODO(johnmccutchan): Make real use of vm_tags and runtime_tags. 27 // TODO(johnmccutchan): Make real use of vm_tags and runtime_tags.
28 // Issue # 14777 28 // Issue # 14777
29 sample->vm_tags = Sample::kExecuting; 29 sample->vm_tags = Sample::kExecuting;
30 sample->runtime_tags = 0; 30 sample->runtime_tags = 0;
31 int64_t cpu_usage; 31 int64_t cpu_usage = 0;
32 Thread::GetThreadCpuUsage(profiler_data->thread_id(), &cpu_usage); 32 // TODO(johnmccutchan): Thread::GetThreadCpuUsage on MacOS.
33 sample->cpu_usage = profiler_data->ComputeDeltaAndSetCpuUsage(cpu_usage); 33 sample->cpu_usage = profiler_data->ComputeDeltaAndSetCpuUsage(cpu_usage);
34 ProfilerSampleStackWalker stackWalker(sample, stack_lower, stack_upper, 34 ProfilerSampleStackWalker stackWalker(sample, stack_lower, stack_upper,
35 pc, fp, sp); 35 pc, fp, sp);
36 stackWalker.walk(); 36 stackWalker.walk();
37 } 37 }
38 38
39 39
40 static void ProfileSignalAction(int signal, siginfo_t* info, void* context_) { 40 static void ProfileSignalAction(int signal, siginfo_t* info, void* context_) {
41 if (signal != SIGPROF) { 41 if (signal != SIGPROF) {
42 return; 42 return;
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 int64_t current_time = OS::GetCurrentTimeMicros(); 126 int64_t current_time = OS::GetCurrentTimeMicros();
127 int64_t next_sample = SampleAndRescheduleIsolates(current_time); 127 int64_t next_sample = SampleAndRescheduleIsolates(current_time);
128 lock.WaitMicros(next_sample); 128 lock.WaitMicros(next_sample);
129 } 129 }
130 } 130 }
131 131
132 132
133 } // namespace dart 133 } // namespace dart
134 134
135 #endif // defined(TARGET_OS_MACOS) 135 #endif // defined(TARGET_OS_MACOS)
OLDNEW
« no previous file with comments | « runtime/vm/profiler.cc ('k') | runtime/vm/signal_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698