| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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_SERVICE_H_ | 5 #ifndef VM_PROFILER_SERVICE_H_ |
| 6 #define VM_PROFILER_SERVICE_H_ | 6 #define VM_PROFILER_SERVICE_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" |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 return (kind == kExclusiveCode) || (kind == kInclusiveCode); | 293 return (kind == kExclusiveCode) || (kind == kInclusiveCode); |
| 294 } | 294 } |
| 295 | 295 |
| 296 static bool IsFunctionTrie(TrieKind kind) { | 296 static bool IsFunctionTrie(TrieKind kind) { |
| 297 return !IsCodeTrie(kind); | 297 return !IsCodeTrie(kind); |
| 298 } | 298 } |
| 299 | 299 |
| 300 explicit Profile(Isolate* isolate); | 300 explicit Profile(Isolate* isolate); |
| 301 | 301 |
| 302 // Build a filtered model using |filter| with the specified |tag_order|. | 302 // Build a filtered model using |filter| with the specified |tag_order|. |
| 303 void Build(SampleFilter* filter, TagOrder tag_order); | 303 void Build(SampleFilter* filter, TagOrder tag_order, intptr_t extra_tags = 0); |
| 304 | 304 |
| 305 // After building: | 305 // After building: |
| 306 int64_t min_time() const { return min_time_; } | 306 int64_t min_time() const { return min_time_; } |
| 307 int64_t max_time() const { return max_time_; } | 307 int64_t max_time() const { return max_time_; } |
| 308 int64_t GetTimeSpan() const { | 308 int64_t GetTimeSpan() const { |
| 309 return max_time() - min_time(); | 309 return max_time() - min_time(); |
| 310 } | 310 } |
| 311 intptr_t sample_count() const { return sample_count_; } | 311 intptr_t sample_count() const { return sample_count_; } |
| 312 | 312 |
| 313 ProfileFunction* GetFunction(intptr_t index); | 313 ProfileFunction* GetFunction(intptr_t index); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 private: | 364 private: |
| 365 Profile* profile_; | 365 Profile* profile_; |
| 366 ProfileTrieNode* parent_; | 366 ProfileTrieNode* parent_; |
| 367 ProfileTrieNode* current_; | 367 ProfileTrieNode* current_; |
| 368 bool code_trie_; | 368 bool code_trie_; |
| 369 }; | 369 }; |
| 370 | 370 |
| 371 | 371 |
| 372 class ProfilerService : public AllStatic { | 372 class ProfilerService : public AllStatic { |
| 373 public: | 373 public: |
| 374 enum { |
| 375 kCodeTransitionTagsBit = (1 << 0), |
| 376 }; |
| 377 |
| 374 static void PrintJSON(JSONStream* stream, | 378 static void PrintJSON(JSONStream* stream, |
| 375 Profile::TagOrder tag_order); | 379 Profile::TagOrder tag_order, |
| 380 intptr_t extra_tags); |
| 376 | 381 |
| 377 static void PrintAllocationJSON(JSONStream* stream, | 382 static void PrintAllocationJSON(JSONStream* stream, |
| 378 Profile::TagOrder tag_order, | 383 Profile::TagOrder tag_order, |
| 379 const Class& cls); | 384 const Class& cls); |
| 380 | 385 |
| 381 static void ClearSamples(); | 386 static void ClearSamples(); |
| 382 | 387 |
| 383 private: | 388 private: |
| 384 static void PrintJSONImpl(Isolate* isolate, | 389 static void PrintJSONImpl(Isolate* isolate, |
| 385 JSONStream* stream, | 390 JSONStream* stream, |
| 386 Profile::TagOrder tag_order, | 391 Profile::TagOrder tag_order, |
| 392 intptr_t extra_tags, |
| 387 SampleFilter* filter); | 393 SampleFilter* filter); |
| 388 }; | 394 }; |
| 389 | 395 |
| 390 } // namespace dart | 396 } // namespace dart |
| 391 | 397 |
| 392 #endif // VM_PROFILER_SERVICE_H_ | 398 #endif // VM_PROFILER_SERVICE_H_ |
| OLD | NEW |