| Index: runtime/vm/profiler.h
|
| diff --git a/runtime/vm/profiler.h b/runtime/vm/profiler.h
|
| index 9f967cf9bea02ca0b3b176a14616582e3f6a1d75..d8780fa53c438eed48b9ecfa55b3f7acfb026da8 100644
|
| --- a/runtime/vm/profiler.h
|
| +++ b/runtime/vm/profiler.h
|
| @@ -60,7 +60,9 @@ class Profiler : public AllStatic {
|
| static void DumpStackTrace();
|
|
|
| static void SampleAllocation(Thread* thread, intptr_t cid);
|
| - static Sample* SampleNativeAllocation(intptr_t skip_count);
|
| + static Sample* SampleNativeAllocation(intptr_t skip_count,
|
| + uword address,
|
| + uintptr_t allocation_size);
|
|
|
| // SampleThread is called from inside the signal handler and hence it is very
|
| // critical that the implementation of SampleThread does not do any of the
|
| @@ -141,6 +143,8 @@ class SampleFilter : public ValueObject {
|
| // Returns |true| if |sample| passes the thread task filter.
|
| bool TaskFilterSample(Sample* sample);
|
|
|
| + static const intptr_t kNoTaskFilter = -1;
|
| +
|
| private:
|
| Dart_Port port_;
|
| intptr_t thread_task_mask_;
|
| @@ -183,6 +187,8 @@ class Sample {
|
| lr_ = 0;
|
| metadata_ = 0;
|
| state_ = 0;
|
| + native_allocation_address_ = 0;
|
| + native_allocation_size_bytes_ = 0;
|
| continuation_index_ = -1;
|
| uword* pcs = GetPCArray();
|
| for (intptr_t i = 0; i < pcs_length_; i++) {
|
| @@ -279,6 +285,24 @@ class Sample {
|
| NativeAllocationSampleBit::update(native_allocation_sample, state_);
|
| }
|
|
|
| + void set_native_allocation_address(uword address) {
|
| + native_allocation_address_ = address;
|
| + }
|
| +
|
| + uword native_allocation_address() const { return native_allocation_address_; }
|
| +
|
| + bool NativeAllocationFreed() const {
|
| + return (native_allocation_address_ == 0);
|
| + }
|
| +
|
| + uintptr_t native_allocation_size_bytes() const {
|
| + return native_allocation_size_bytes_;
|
| + }
|
| +
|
| + void set_native_allocation_size_bytes(uintptr_t size) {
|
| + native_allocation_size_bytes_ = size;
|
| + }
|
| +
|
| Thread::TaskKind thread_task() const { return ThreadTaskBit::decode(state_); }
|
|
|
| void set_thread_task(Thread::TaskKind task) {
|
| @@ -373,6 +397,8 @@ class Sample {
|
| uword metadata_;
|
| uword lr_;
|
| uword state_;
|
| + uword native_allocation_address_;
|
| + uintptr_t native_allocation_size_bytes_;
|
| intptr_t continuation_index_;
|
|
|
| /* There are a variable number of words that follow, the words hold the
|
| @@ -564,6 +590,18 @@ class ProcessedSample : public ZoneAllocated {
|
|
|
| bool IsAllocationSample() const { return allocation_cid_ > 0; }
|
|
|
| + bool is_native_allocation_sample() const { return native_allocation_sample_; }
|
| + void set_is_native_allocation_sample(bool native_allocation_sample) {
|
| + native_allocation_sample_ = native_allocation_sample;
|
| + }
|
| +
|
| + uintptr_t native_allocation_size_bytes() const {
|
| + return native_allocation_size_bytes_;
|
| + }
|
| + void set_native_allocation_size_bytes(uintptr_t allocation_size) {
|
| + native_allocation_size_bytes_ = allocation_size;
|
| + }
|
| +
|
| // Was the stack trace truncated?
|
| bool truncated() const { return truncated_; }
|
| void set_truncated(bool truncated) { truncated_ = truncated; }
|
| @@ -598,6 +636,9 @@ class ProcessedSample : public ZoneAllocated {
|
| intptr_t allocation_cid_;
|
| bool truncated_;
|
| bool first_frame_executing_;
|
| + bool native_allocation_sample_;
|
| + uword native_allocation_address_;
|
| + uintptr_t native_allocation_size_bytes_;
|
| ProfileTrieNode* timeline_trie_;
|
|
|
| friend class SampleBuffer;
|
|
|