| OLD | NEW |
| 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/utils.h" | 5 #include "platform/utils.h" |
| 6 | 6 |
| 7 #include "vm/allocation.h" | 7 #include "vm/allocation.h" |
| 8 #include "vm/atomic.h" | 8 #include "vm/atomic.h" |
| 9 #include "vm/code_patcher.h" | 9 #include "vm/code_patcher.h" |
| 10 #include "vm/isolate.h" | 10 #include "vm/isolate.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #endif | 29 #endif |
| 30 DEFINE_FLAG(bool, trace_profiled_isolates, false, "Trace profiled isolates."); | 30 DEFINE_FLAG(bool, trace_profiled_isolates, false, "Trace profiled isolates."); |
| 31 DEFINE_FLAG(charp, profile_dir, NULL, | 31 DEFINE_FLAG(charp, profile_dir, NULL, |
| 32 "Enable writing profile data into specified directory."); | 32 "Enable writing profile data into specified directory."); |
| 33 DEFINE_FLAG(int, profile_period, 1000, | 33 DEFINE_FLAG(int, profile_period, 1000, |
| 34 "Time between profiler samples in microseconds. Minimum 50."); | 34 "Time between profiler samples in microseconds. Minimum 50."); |
| 35 DEFINE_FLAG(int, profile_depth, 8, | 35 DEFINE_FLAG(int, profile_depth, 8, |
| 36 "Maximum number stack frames walked. Minimum 1. Maximum 255."); | 36 "Maximum number stack frames walked. Minimum 1. Maximum 255."); |
| 37 DEFINE_FLAG(bool, profile_verify_stack_walk, false, | 37 DEFINE_FLAG(bool, profile_verify_stack_walk, false, |
| 38 "Verify instruction addresses while walking the stack."); | 38 "Verify instruction addresses while walking the stack."); |
| 39 DEFINE_FLAG(bool, profile_vm, true, | 39 DEFINE_FLAG(bool, profile_vm, false, |
| 40 "Always collect native stack traces."); | 40 "Always collect native stack traces."); |
| 41 | 41 |
| 42 bool Profiler::initialized_ = false; | 42 bool Profiler::initialized_ = false; |
| 43 SampleBuffer* Profiler::sample_buffer_ = NULL; | 43 SampleBuffer* Profiler::sample_buffer_ = NULL; |
| 44 | 44 |
| 45 void Profiler::InitOnce() { | 45 void Profiler::InitOnce() { |
| 46 // Place some sane restrictions on user controlled flags. | 46 // Place some sane restrictions on user controlled flags. |
| 47 SetSamplePeriod(FLAG_profile_period); | 47 SetSamplePeriod(FLAG_profile_period); |
| 48 SetSampleDepth(FLAG_profile_depth); | 48 SetSampleDepth(FLAG_profile_depth); |
| 49 Sample::InitOnce(); | 49 Sample::InitOnce(); |
| (...skipping 1847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1897 } else { | 1897 } else { |
| 1898 // Collect native and Dart frames. | 1898 // Collect native and Dart frames. |
| 1899 ProfilerNativeStackWalker stackWalker(sample, stack_lower, stack_upper, | 1899 ProfilerNativeStackWalker stackWalker(sample, stack_lower, stack_upper, |
| 1900 state.pc, state.fp, state.sp); | 1900 state.pc, state.fp, state.sp); |
| 1901 stackWalker.walk(isolate->heap()); | 1901 stackWalker.walk(isolate->heap()); |
| 1902 } | 1902 } |
| 1903 } | 1903 } |
| 1904 } | 1904 } |
| 1905 | 1905 |
| 1906 } // namespace dart | 1906 } // namespace dart |
| OLD | NEW |