| 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/code_observers.h" | 9 #include "vm/code_observers.h" |
| 10 #include "vm/globals.h" | 10 #include "vm/globals.h" |
| 11 #include "vm/tags.h" | 11 #include "vm/tags.h" |
| 12 #include "vm/thread.h" | 12 #include "vm/thread.h" |
| 13 #include "vm/thread_interrupter.h" | 13 #include "vm/thread_interrupter.h" |
| 14 | 14 |
| 15 namespace dart { | 15 namespace dart { |
| 16 | 16 |
| 17 // Forward declarations. | 17 // Forward declarations. |
| 18 class JSONArray; | 18 class JSONArray; |
| 19 class JSONStream; | 19 class JSONStream; |
| 20 class ProfilerCodeRegionTable; | 20 class ProfilerCodeRegionTable; |
| 21 class Sample; | 21 class Sample; |
| 22 class SampleBuffer; | 22 class SampleBuffer; |
| 23 | 23 |
| 24 // Profiler | 24 // Profiler |
| 25 class Profiler : public AllStatic { | 25 class Profiler : public AllStatic { |
| 26 public: | 26 public: |
| 27 enum TagOrder { |
| 28 kNoTags, |
| 29 kUser, |
| 30 kUserVM, |
| 31 kVM, |
| 32 kVMUser |
| 33 }; |
| 34 |
| 27 static void InitOnce(); | 35 static void InitOnce(); |
| 28 static void Shutdown(); | 36 static void Shutdown(); |
| 29 | 37 |
| 30 static void SetSampleDepth(intptr_t depth); | 38 static void SetSampleDepth(intptr_t depth); |
| 31 static void SetSamplePeriod(intptr_t period); | 39 static void SetSamplePeriod(intptr_t period); |
| 32 | 40 |
| 33 static void InitProfilingForIsolate(Isolate* isolate, | 41 static void InitProfilingForIsolate(Isolate* isolate, |
| 34 bool shared_buffer = true); | 42 bool shared_buffer = true); |
| 35 static void ShutdownProfilingForIsolate(Isolate* isolate); | 43 static void ShutdownProfilingForIsolate(Isolate* isolate); |
| 36 | 44 |
| 37 static void BeginExecution(Isolate* isolate); | 45 static void BeginExecution(Isolate* isolate); |
| 38 static void EndExecution(Isolate* isolate); | 46 static void EndExecution(Isolate* isolate); |
| 39 | 47 |
| 40 static void PrintToJSONStream(Isolate* isolate, JSONStream* stream, | 48 static void PrintToJSONStream(Isolate* isolate, JSONStream* stream, |
| 41 bool full, bool use_tags); | 49 bool full, TagOrder tag_order); |
| 42 static void WriteProfile(Isolate* isolate); | 50 static void WriteProfile(Isolate* isolate); |
| 43 | 51 |
| 44 static SampleBuffer* sample_buffer() { | 52 static SampleBuffer* sample_buffer() { |
| 45 return sample_buffer_; | 53 return sample_buffer_; |
| 46 } | 54 } |
| 47 | 55 |
| 48 private: | 56 private: |
| 49 static bool initialized_; | 57 static bool initialized_; |
| 50 static Monitor* monitor_; | 58 static Monitor* monitor_; |
| 51 | 59 |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 intptr_t capacity_; | 234 intptr_t capacity_; |
| 227 uintptr_t cursor_; | 235 uintptr_t cursor_; |
| 228 | 236 |
| 229 DISALLOW_COPY_AND_ASSIGN(SampleBuffer); | 237 DISALLOW_COPY_AND_ASSIGN(SampleBuffer); |
| 230 }; | 238 }; |
| 231 | 239 |
| 232 | 240 |
| 233 } // namespace dart | 241 } // namespace dart |
| 234 | 242 |
| 235 #endif // VM_PROFILER_H_ | 243 #endif // VM_PROFILER_H_ |
| OLD | NEW |