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 16 matching lines...) Expand all Loading... |
27 #else | 27 #else |
28 DEFINE_FLAG(bool, profile, true, "Enable Sampling Profiler"); | 28 DEFINE_FLAG(bool, profile, true, "Enable Sampling Profiler"); |
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 #if defined(PROFILE_NATIVE_CODE) |
| 38 DEFINE_FLAG(bool, profile_vm, true, |
| 39 "Always collect native stack traces."); |
| 40 #else |
37 DEFINE_FLAG(bool, profile_vm, false, | 41 DEFINE_FLAG(bool, profile_vm, false, |
38 "Always collect native stack traces."); | 42 "Always collect native stack traces."); |
| 43 #endif |
39 | 44 |
40 bool Profiler::initialized_ = false; | 45 bool Profiler::initialized_ = false; |
41 SampleBuffer* Profiler::sample_buffer_ = NULL; | 46 SampleBuffer* Profiler::sample_buffer_ = NULL; |
42 | 47 |
43 void Profiler::InitOnce() { | 48 void Profiler::InitOnce() { |
44 // Place some sane restrictions on user controlled flags. | 49 // Place some sane restrictions on user controlled flags. |
45 SetSamplePeriod(FLAG_profile_period); | 50 SetSamplePeriod(FLAG_profile_period); |
46 SetSampleDepth(FLAG_profile_depth); | 51 SetSampleDepth(FLAG_profile_depth); |
47 Sample::InitOnce(); | 52 Sample::InitOnce(); |
48 if (!FLAG_profile) { | 53 if (!FLAG_profile) { |
(...skipping 2033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2082 stack_upper, | 2087 stack_upper, |
2083 state.pc, | 2088 state.pc, |
2084 state.fp, | 2089 state.fp, |
2085 state.sp); | 2090 state.sp); |
2086 stackWalker.walk(); | 2091 stackWalker.walk(); |
2087 } | 2092 } |
2088 } | 2093 } |
2089 } | 2094 } |
2090 | 2095 |
2091 } // namespace dart | 2096 } // namespace dart |
OLD | NEW |