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/address_sanitizer.h" | 5 #include "platform/address_sanitizer.h" |
6 #include "platform/memory_sanitizer.h" | 6 #include "platform/memory_sanitizer.h" |
7 #include "platform/utils.h" | 7 #include "platform/utils.h" |
8 | 8 |
9 #include "vm/allocation.h" | 9 #include "vm/allocation.h" |
10 #include "vm/atomic.h" | 10 #include "vm/atomic.h" |
11 #include "vm/code_patcher.h" | 11 #include "vm/code_patcher.h" |
12 #include "vm/debugger.h" | 12 #include "vm/debugger.h" |
13 #include "vm/instructions.h" | 13 #include "vm/instructions.h" |
14 #include "vm/isolate.h" | 14 #include "vm/isolate.h" |
15 #include "vm/json_stream.h" | 15 #include "vm/json_stream.h" |
16 #include "vm/lockers.h" | 16 #include "vm/lockers.h" |
17 #include "vm/message_handler.h" | 17 #include "vm/message_handler.h" |
18 #include "vm/native_symbol.h" | 18 #include "vm/native_symbol.h" |
19 #include "vm/object.h" | 19 #include "vm/object.h" |
20 #include "vm/os.h" | 20 #include "vm/os.h" |
21 #include "vm/profiler.h" | 21 #include "vm/profiler.h" |
22 #include "vm/reusable_handles.h" | 22 #include "vm/reusable_handles.h" |
23 #include "vm/signal_handler.h" | 23 #include "vm/signal_handler.h" |
24 #include "vm/simulator.h" | 24 #include "vm/simulator.h" |
25 #include "vm/stack_frame.h" | 25 #include "vm/stack_frame.h" |
26 | 26 |
27 namespace dart { | 27 namespace dart { |
28 | 28 |
29 static const intptr_t kSampleSize = 8; | 29 static const intptr_t kSampleSize = 8; |
30 static const intptr_t kMaxSamplesPerTick = 4; | |
30 | 31 |
31 DECLARE_FLAG(bool, trace_profiler); | 32 DECLARE_FLAG(bool, trace_profiler); |
32 DEFINE_FLAG(bool, trace_profiled_isolates, false, "Trace profiled isolates."); | 33 DEFINE_FLAG(bool, trace_profiled_isolates, false, "Trace profiled isolates."); |
33 | 34 |
34 #if defined(TARGET_OS_ANDROID) || defined(TARGET_ARCH_ARM64) || \ | 35 #if defined(TARGET_OS_ANDROID) || defined(TARGET_ARCH_ARM64) || \ |
35 defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_MIPS) | 36 defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_MIPS) |
36 DEFINE_FLAG(int, profile_period, 10000, | 37 DEFINE_FLAG(int, profile_period, 10000, |
37 "Time between profiler samples in microseconds. Minimum 50."); | 38 "Time between profiler samples in microseconds. Minimum 50."); |
38 #else | 39 #else |
39 DEFINE_FLAG(int, profile_period, 1000, | 40 DEFINE_FLAG(int, profile_period, 1000, |
40 "Time between profiler samples in microseconds. Minimum 50."); | 41 "Time between profiler samples in microseconds. Minimum 50."); |
41 #endif | 42 #endif |
42 DEFINE_FLAG(int, max_profile_depth, kSampleSize, | 43 DEFINE_FLAG(int, max_profile_depth, kSampleSize * kMaxSamplesPerTick, |
srdjan
2016/03/22 16:59:56
Do you assert somewhere that it does not go over 2
Cutch
2016/03/22 22:18:29
Yes, see SetSampleDepth which ensures it is in ran
| |
43 "Maximum number stack frames walked. Minimum 1. Maximum 255."); | 44 "Maximum number stack frames walked. Minimum 1. Maximum 255."); |
44 #if defined(USING_SIMULATOR) | 45 #if defined(USING_SIMULATOR) |
45 DEFINE_FLAG(bool, profile_vm, true, | 46 DEFINE_FLAG(bool, profile_vm, true, |
46 "Always collect native stack traces."); | 47 "Always collect native stack traces."); |
47 #else | 48 #else |
48 DEFINE_FLAG(bool, profile_vm, false, | 49 DEFINE_FLAG(bool, profile_vm, false, |
49 "Always collect native stack traces."); | 50 "Always collect native stack traces."); |
50 #endif | 51 #endif |
51 | 52 |
52 #ifndef PRODUCT | 53 #ifndef PRODUCT |
(...skipping 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1396 | 1397 |
1397 | 1398 |
1398 ProcessedSampleBuffer::ProcessedSampleBuffer() | 1399 ProcessedSampleBuffer::ProcessedSampleBuffer() |
1399 : code_lookup_table_(new CodeLookupTable(Thread::Current())) { | 1400 : code_lookup_table_(new CodeLookupTable(Thread::Current())) { |
1400 ASSERT(code_lookup_table_ != NULL); | 1401 ASSERT(code_lookup_table_ != NULL); |
1401 } | 1402 } |
1402 | 1403 |
1403 #endif // !PRODUCT | 1404 #endif // !PRODUCT |
1404 | 1405 |
1405 } // namespace dart | 1406 } // namespace dart |
OLD | NEW |