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 class Profiler : public AllStatic { | 47 class Profiler : public AllStatic { |
48 public: | 48 public: |
49 static void InitOnce(); | 49 static void InitOnce(); |
50 static void Shutdown(); | 50 static void Shutdown(); |
51 | 51 |
52 static void SetSampleDepth(intptr_t depth); | 52 static void SetSampleDepth(intptr_t depth); |
53 static void SetSamplePeriod(intptr_t period); | 53 static void SetSamplePeriod(intptr_t period); |
54 | 54 |
55 static SampleBuffer* sample_buffer() { return sample_buffer_; } | 55 static SampleBuffer* sample_buffer() { return sample_buffer_; } |
56 | 56 |
57 static void DumpStackTrace(); | 57 static void DumpStackTrace(bool native_stack_trace = true); |
58 | 58 |
59 static void SampleAllocation(Thread* thread, intptr_t cid); | 59 static void SampleAllocation(Thread* thread, intptr_t cid); |
60 | 60 |
61 // SampleThread is called from inside the signal handler and hence it is very | 61 // SampleThread is called from inside the signal handler and hence it is very |
62 // critical that the implementation of SampleThread does not do any of the | 62 // critical that the implementation of SampleThread does not do any of the |
63 // following: | 63 // following: |
64 // * Accessing TLS -- Because on Windows the callback will be running in a | 64 // * Accessing TLS -- Because on Windows the callback will be running in a |
65 // different thread. | 65 // different thread. |
66 // * Allocating memory -- Because this takes locks which may already be | 66 // * Allocating memory -- Because this takes locks which may already be |
67 // held, resulting in a dead lock. | 67 // held, resulting in a dead lock. |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 private: | 606 private: |
607 ZoneGrowableArray<ProcessedSample*> samples_; | 607 ZoneGrowableArray<ProcessedSample*> samples_; |
608 CodeLookupTable* code_lookup_table_; | 608 CodeLookupTable* code_lookup_table_; |
609 | 609 |
610 DISALLOW_COPY_AND_ASSIGN(ProcessedSampleBuffer); | 610 DISALLOW_COPY_AND_ASSIGN(ProcessedSampleBuffer); |
611 }; | 611 }; |
612 | 612 |
613 } // namespace dart | 613 } // namespace dart |
614 | 614 |
615 #endif // RUNTIME_VM_PROFILER_H_ | 615 #endif // RUNTIME_VM_PROFILER_H_ |
OLD | NEW |