Chromium Code Reviews| Index: runtime/vm/profiler_service.h |
| diff --git a/runtime/vm/profiler_service.h b/runtime/vm/profiler_service.h |
| index 62612bb1e23232eb54f47c3647c07974dfaad19b..9446d441fc83cbc7484fac2795d00d287caa6bc5 100644 |
| --- a/runtime/vm/profiler_service.h |
| +++ b/runtime/vm/profiler_service.h |
| @@ -50,6 +50,8 @@ class ProfileFunction : public ZoneAllocated { |
| return name_; |
| } |
| + const char* Name() const; |
| + |
| RawFunction* function() const { |
| return function_.raw(); |
| } |
| @@ -246,6 +248,8 @@ class ProfileTrieNode : public ZoneAllocated { |
| return children_.At(i); |
| } |
| + intptr_t IndexOf(ProfileTrieNode* node); |
| + |
| protected: |
| void SortChildren(); |
| @@ -285,6 +289,14 @@ class Profile : public ValueObject { |
| kNumTrieKinds, |
| }; |
| + static bool IsCodeTrie(TrieKind kind) { |
| + return (kind == kExclusiveCode) || (kind == kInclusiveCode); |
| + } |
| + |
| + static bool IsFunctionTrie(TrieKind kind) { |
| + return !IsCodeTrie(kind); |
| + } |
| + |
| explicit Profile(Isolate* isolate); |
| // Build a filtered model using |filter| with the specified |tag_order|. |
| @@ -324,6 +336,31 @@ class Profile : public ValueObject { |
| }; |
| +class ProfileTrieWalker { |
|
srdjan
2015/06/26 18:18:22
Please subclass from a meaningful class (ValueObje
Cutch
2015/06/26 19:21:41
Done.
|
| + public: |
| + explicit ProfileTrieWalker(Profile* profile) |
| + : profile_(profile), |
| + parent_(NULL), |
| + current_(NULL), |
| + code_trie_(false) { |
| + ASSERT(profile_ != NULL); |
| + } |
| + |
| + void Reset(Profile::TrieKind trie_kind); |
| + |
| + const char* CurrentName(); |
| + |
| + bool Down(); |
| + bool NextSibling(); |
| + |
| + private: |
| + Profile* profile_; |
| + ProfileTrieNode* parent_; |
| + ProfileTrieNode* current_; |
| + bool code_trie_; |
| +}; |
| + |
| + |
| class ProfilerService : public AllStatic { |
| public: |
| static void PrintJSON(JSONStream* stream, |