Chromium Code Reviews| Index: runtime/vm/profiler.cc |
| diff --git a/runtime/vm/profiler.cc b/runtime/vm/profiler.cc |
| index 2545385532d77673de052c50ee76e814637eb9d1..95ec408115f1d6691a7a1f9eb81ae64533ee0999 100644 |
| --- a/runtime/vm/profiler.cc |
| +++ b/runtime/vm/profiler.cc |
| @@ -36,7 +36,7 @@ DEFINE_FLAG(int, profile_depth, 8, |
| "Maximum number stack frames walked. Minimum 1. Maximum 255."); |
| DEFINE_FLAG(bool, profile_verify_stack_walk, false, |
| "Verify instruction addresses while walking the stack."); |
| -DEFINE_FLAG(bool, profile_native_stack, true, |
| +DEFINE_FLAG(bool, profile_native_stack, false, |
| "Use native stack in profiler."); |
| bool Profiler::initialized_ = false; |
| @@ -1634,12 +1634,6 @@ class ProfilerDartStackWalker : public ValueObject { |
| ASSERT(sample_ != NULL); |
| } |
| - ProfilerDartStackWalker(Sample* sample, uword pc, uword fp, uword sp) |
| - : sample_(sample), |
| - frame_iterator_(fp, sp, pc) { |
| - ASSERT(sample_ != NULL); |
| - } |
| - |
| ProfilerDartStackWalker(Sample* sample, uword fp) |
| : sample_(sample), |
| frame_iterator_(fp) { |
| @@ -1844,26 +1838,27 @@ void Profiler::RecordSampleInterruptCallback( |
| sample->set_user_tag(isolate->user_tag()); |
| sample->set_sp(state.sp); |
| sample->set_fp(state.fp); |
| + |
| + uword stack_lower = 0; |
| + uword stack_upper = 0; |
| + isolate->GetStackBounds(&stack_lower, &stack_upper); |
| + if ((stack_lower == 0) || (stack_upper == 0)) { |
| + stack_lower = 0; |
| + stack_upper = 0; |
| + } |
| if (FLAG_profile_native_stack) { |
| // Collect native and Dart frames. |
| - uword stack_lower = 0; |
| - uword stack_upper = 0; |
| - isolate->GetStackBounds(&stack_lower, &stack_upper); |
| - if ((stack_lower == 0) || (stack_upper == 0)) { |
| - stack_lower = 0; |
| - stack_upper = 0; |
| - } |
| ProfilerNativeStackWalker stackWalker(sample, stack_lower, stack_upper, |
| state.pc, state.fp, state.sp); |
| stackWalker.walk(isolate->heap()); |
| - } else { |
| - if ((isolate->top_exit_frame_info() != 0) && |
| - (isolate->stub_code() != NULL)) { |
| + } else if (isolate->stub_code() != NULL) { |
| + if (isolate->top_exit_frame_info() != 0) { |
| ProfilerDartStackWalker stackWalker(sample); |
| stackWalker.walk(); |
| } else { |
| - // TODO(johnmccutchan): Support collecting only Dart frames with |
| - // ProfilerNativeStackWalker. |
| + ProfilerNativeStackWalker stackWalker(sample, stack_lower, stack_upper, |
| + state.pc, state.fp, state.sp); |
| + stackWalker.walk(isolate->heap()); |
| } |
| } |
|
siva
2014/06/19 20:22:17
Should there be an UNREACHEABLE() here, i.e you do
Cutch
2014/06/23 17:30:12
We want to collect samples during isolate start up
|
| } |