Chromium Code Reviews| Index: runtime/vm/profiler_service.h |
| diff --git a/runtime/vm/profiler_service.h b/runtime/vm/profiler_service.h |
| index d9205b3b7a1ee851107a8f1778c3f4e0d1de36b1..021c8bcfa9bd5455348c8c05694b963c0e749526 100644 |
| --- a/runtime/vm/profiler_service.h |
| +++ b/runtime/vm/profiler_service.h |
| @@ -9,6 +9,7 @@ |
| #include "vm/code_observers.h" |
| #include "vm/globals.h" |
| #include "vm/growable_array.h" |
| +#include "vm/hash_map.h" |
| #include "vm/object.h" |
| #include "vm/tags.h" |
| #include "vm/thread_interrupter.h" |
| @@ -29,6 +30,7 @@ class ProfileCodeTable; |
| class RawCode; |
| class RawFunction; |
| class SampleFilter; |
| +class ProcessedSample; |
| class ProcessedSampleBuffer; |
| class ProfileFunctionSourcePosition { |
| @@ -83,13 +85,15 @@ class ProfileFunction : public ZoneAllocated { |
| intptr_t exclusive_ticks() const { return exclusive_ticks_; } |
| intptr_t inclusive_ticks() const { return inclusive_ticks_; } |
| - |
| void IncInclusiveTicks() { inclusive_ticks_++; } |
| - |
| void Tick(bool exclusive, |
| intptr_t inclusive_serial, |
| TokenPosition token_position); |
| + bool contains_native_allocation() const { |
| + return contains_native_allocation_; |
|
Cutch
2017/03/21 20:27:11
is this used anywhere? why is it needed?
bkonyi
2017/03/22 21:25:21
Apparently not. Removed.
|
| + } |
| + |
| static const char* KindToCString(Kind kind); |
| void PrintToJSONArray(JSONArray* functions); |
| @@ -119,6 +123,8 @@ class ProfileFunction : public ZoneAllocated { |
| intptr_t inclusive_ticks_; |
| intptr_t inclusive_serial_; |
| + bool contains_native_allocation_; |
| + |
| void PrintToJSONObject(JSONObject* func); |
| // A |ProfileCode| that contains this function. |
| void AddProfileCode(intptr_t code_table_index); |
| @@ -193,6 +199,10 @@ class ProfileCode : public ZoneAllocated { |
| } |
| void IncInclusiveTicks() { inclusive_ticks_++; } |
| + bool contains_native_allocation() const { |
| + return contains_native_allocation_; |
| + } |
| + |
| bool IsOptimizedDart() const; |
| RawCode* code() const { return code_.raw(); } |
| @@ -227,6 +237,8 @@ class ProfileCode : public ZoneAllocated { |
| intptr_t inclusive_ticks_; |
| intptr_t inclusive_serial_; |
| + bool contains_native_allocation_; |
| + |
| const Code& code_; |
| char* name_; |
| int64_t compile_timestamp_; |
| @@ -257,7 +269,15 @@ class ProfileTrieNode : public ZoneAllocated { |
| intptr_t count() const { return count_; } |
| - void Tick() { count_++; } |
| + void Tick(ProcessedSample* sample, bool exclusive = false); |
| + |
| + void IncrementAllocation(intptr_t allocation, bool exclusive) { |
| + ASSERT(allocation >= 0); |
| + if (exclusive) { |
| + exclusive_allocations_ += allocation; |
| + } |
| + inclusive_allocations_ += allocation; |
| + } |
| intptr_t NumChildren() const { return children_.length(); } |
| @@ -284,6 +304,8 @@ class ProfileTrieNode : public ZoneAllocated { |
| intptr_t table_index_; |
| intptr_t count_; |
| + intptr_t exclusive_allocations_; |
| + intptr_t inclusive_allocations_; |
| ZoneGrowableArray<ProfileTrieNode*> children_; |
| intptr_t frame_id_; |