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 #ifndef RUNTIME_VM_PROFILER_H_ | 5 #ifndef RUNTIME_VM_PROFILER_H_ |
6 #define RUNTIME_VM_PROFILER_H_ | 6 #define RUNTIME_VM_PROFILER_H_ |
7 | 7 |
8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 #include "vm/bitfield.h" | 9 #include "vm/bitfield.h" |
10 #include "vm/code_observers.h" | 10 #include "vm/code_observers.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
47 // Count of failed checks: | 47 // Count of failed checks: |
48 int64_t failure_native_allocation_sample; | 48 int64_t failure_native_allocation_sample; |
49 }; | 49 }; |
50 | 50 |
51 class Profiler : public AllStatic { | 51 class Profiler : public AllStatic { |
52 public: | 52 public: |
53 static void InitOnce(); | 53 static void InitOnce(); |
54 static void InitAllocationSampleBuffer(); | 54 static void InitAllocationSampleBuffer(); |
55 static void Shutdown(); | 55 static void Shutdown(); |
56 | 56 |
57 #if !defined(PRODUCT) | |
58 static void EnsureEnabled() { | |
zra
2017/07/31 15:03:11
It looks like this is only used for tests, so thin
rmacnak
2017/07/31 21:12:13
Done.
| |
59 if (!FLAG_profiler) { | |
60 FLAG_profiler = true; | |
61 Profiler::InitOnce(); | |
62 } | |
63 } | |
64 #endif | |
65 | |
57 static void SetSampleDepth(intptr_t depth); | 66 static void SetSampleDepth(intptr_t depth); |
58 static void SetSamplePeriod(intptr_t period); | 67 static void SetSamplePeriod(intptr_t period); |
59 | 68 |
60 static SampleBuffer* sample_buffer() { return sample_buffer_; } | 69 static SampleBuffer* sample_buffer() { return sample_buffer_; } |
61 static AllocationSampleBuffer* allocation_sample_buffer() { | 70 static AllocationSampleBuffer* allocation_sample_buffer() { |
62 return allocation_sample_buffer_; | 71 return allocation_sample_buffer_; |
63 } | 72 } |
64 | 73 |
65 static void DumpStackTrace(void* context); | 74 static void DumpStackTrace(void* context); |
66 static void DumpStackTrace(bool for_crash = true); | 75 static void DumpStackTrace(bool for_crash = true); |
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
695 private: | 704 private: |
696 ZoneGrowableArray<ProcessedSample*> samples_; | 705 ZoneGrowableArray<ProcessedSample*> samples_; |
697 CodeLookupTable* code_lookup_table_; | 706 CodeLookupTable* code_lookup_table_; |
698 | 707 |
699 DISALLOW_COPY_AND_ASSIGN(ProcessedSampleBuffer); | 708 DISALLOW_COPY_AND_ASSIGN(ProcessedSampleBuffer); |
700 }; | 709 }; |
701 | 710 |
702 } // namespace dart | 711 } // namespace dart |
703 | 712 |
704 #endif // RUNTIME_VM_PROFILER_H_ | 713 #endif // RUNTIME_VM_PROFILER_H_ |
OLD | NEW |