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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // following: | 46 // following: |
47 // * Accessing TLS -- Because on Windows the callback will be running in a | 47 // * Accessing TLS -- Because on Windows the callback will be running in a |
48 // different thread. | 48 // different thread. |
49 // * Allocating memory -- Because this takes locks which may already be | 49 // * Allocating memory -- Because this takes locks which may already be |
50 // held, resulting in a dead lock. | 50 // held, resulting in a dead lock. |
51 // * Taking a lock -- See above. | 51 // * Taking a lock -- See above. |
52 static void SampleThread(Thread* thread, | 52 static void SampleThread(Thread* thread, |
53 const InterruptedThreadState& state); | 53 const InterruptedThreadState& state); |
54 | 54 |
55 private: | 55 private: |
| 56 // Does not walk the thread's stack. |
| 57 static void SampleThreadSingleFrame(Thread* thread, uintptr_t pc); |
56 static bool initialized_; | 58 static bool initialized_; |
57 | 59 |
58 static SampleBuffer* sample_buffer_; | 60 static SampleBuffer* sample_buffer_; |
59 | 61 |
60 friend class Thread; | 62 friend class Thread; |
61 }; | 63 }; |
62 | 64 |
63 | 65 |
64 class SampleVisitor : public ValueObject { | 66 class SampleVisitor : public ValueObject { |
65 public: | 67 public: |
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 private: | 653 private: |
652 ZoneGrowableArray<ProcessedSample*> samples_; | 654 ZoneGrowableArray<ProcessedSample*> samples_; |
653 CodeLookupTable* code_lookup_table_; | 655 CodeLookupTable* code_lookup_table_; |
654 | 656 |
655 DISALLOW_COPY_AND_ASSIGN(ProcessedSampleBuffer); | 657 DISALLOW_COPY_AND_ASSIGN(ProcessedSampleBuffer); |
656 }; | 658 }; |
657 | 659 |
658 } // namespace dart | 660 } // namespace dart |
659 | 661 |
660 #endif // VM_PROFILER_H_ | 662 #endif // VM_PROFILER_H_ |
OLD | NEW |