| 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 VM_PROFILER_H_ | 5 #ifndef VM_PROFILER_H_ |
| 6 #define VM_PROFILER_H_ | 6 #define 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 21 matching lines...) Expand all Loading... |
| 32 static void InitOnce(); | 32 static void InitOnce(); |
| 33 static void Shutdown(); | 33 static void Shutdown(); |
| 34 | 34 |
| 35 static void SetSampleDepth(intptr_t depth); | 35 static void SetSampleDepth(intptr_t depth); |
| 36 static void SetSamplePeriod(intptr_t period); | 36 static void SetSamplePeriod(intptr_t period); |
| 37 | 37 |
| 38 static SampleBuffer* sample_buffer() { | 38 static SampleBuffer* sample_buffer() { |
| 39 return sample_buffer_; | 39 return sample_buffer_; |
| 40 } | 40 } |
| 41 | 41 |
| 42 static void DumpStackTrace(bool native_stack_trace = true); |
| 43 |
| 42 static void SampleAllocation(Thread* thread, intptr_t cid); | 44 static void SampleAllocation(Thread* thread, intptr_t cid); |
| 43 | 45 |
| 44 // SampleThread is called from inside the signal handler and hence it is very | 46 // SampleThread is called from inside the signal handler and hence it is very |
| 45 // critical that the implementation of SampleThread does not do any of the | 47 // critical that the implementation of SampleThread does not do any of the |
| 46 // following: | 48 // following: |
| 47 // * Accessing TLS -- Because on Windows the callback will be running in a | 49 // * Accessing TLS -- Because on Windows the callback will be running in a |
| 48 // different thread. | 50 // different thread. |
| 49 // * Allocating memory -- Because this takes locks which may already be | 51 // * Allocating memory -- Because this takes locks which may already be |
| 50 // held, resulting in a dead lock. | 52 // held, resulting in a dead lock. |
| 51 // * Taking a lock -- See above. | 53 // * Taking a lock -- See above. |
| (...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 private: | 655 private: |
| 654 ZoneGrowableArray<ProcessedSample*> samples_; | 656 ZoneGrowableArray<ProcessedSample*> samples_; |
| 655 CodeLookupTable* code_lookup_table_; | 657 CodeLookupTable* code_lookup_table_; |
| 656 | 658 |
| 657 DISALLOW_COPY_AND_ASSIGN(ProcessedSampleBuffer); | 659 DISALLOW_COPY_AND_ASSIGN(ProcessedSampleBuffer); |
| 658 }; | 660 }; |
| 659 | 661 |
| 660 } // namespace dart | 662 } // namespace dart |
| 661 | 663 |
| 662 #endif // VM_PROFILER_H_ | 664 #endif // VM_PROFILER_H_ |
| OLD | NEW |