Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(455)

Unified Diff: runtime/vm/profiler.h

Issue 2680213002: Updated MallocHooks to collect stack traces when memory is allocated. (Closed)
Patch Set: Rough first patch Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/vm/profiler.h
diff --git a/runtime/vm/profiler.h b/runtime/vm/profiler.h
index ee87a31d954051b61af6a7a822b7f2bb78da23eb..ffe98da290131830dc0dca97e7f7b1b5539c8e19 100644
--- a/runtime/vm/profiler.h
+++ b/runtime/vm/profiler.h
@@ -58,6 +58,7 @@ class Profiler : public AllStatic {
static void DumpStackTrace();
static void SampleAllocation(Thread* thread, intptr_t cid);
+ static Sample* NativeSampleAllocation();
Cutch 2017/02/08 00:28:54 SampleNativeAllocation
bkonyi 2017/02/08 01:37:05 Done.
// 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
@@ -268,6 +269,15 @@ class Sample {
state_ = ClassAllocationSampleBit::update(allocation_sample, state_);
}
+ bool is_native_allocation_sample() const {
+ return NativeAllocationSampleBit::decode(state_);
+ }
+
+ void set_is_native_allocation_sample(bool native_allocation_sample) {
+ state_ =
+ NativeAllocationSampleBit::update(native_allocation_sample, state_);
+ }
+
Thread::TaskKind thread_task() const { return ThreadTaskBit::decode(state_); }
void set_thread_task(Thread::TaskKind task) {
@@ -331,7 +341,8 @@ class Sample {
kClassAllocationSampleBit = 6,
kContinuationSampleBit = 7,
kThreadTaskBit = 8, // 5 bits.
- kNextFreeBit = 13,
+ kNativeAllocationSampleBit = 13,
+ kNextFreeBit = 14,
};
class HeadSampleBit : public BitField<uword, bool, kHeadSampleBit, 1> {};
class LeafFrameIsDart : public BitField<uword, bool, kLeafFrameIsDartBit, 1> {
@@ -344,6 +355,8 @@ class Sample {
: public BitField<uword, bool, kTruncatedTraceBit, 1> {};
class ClassAllocationSampleBit
: public BitField<uword, bool, kClassAllocationSampleBit, 1> {};
+ class NativeAllocationSampleBit
+ : public BitField<uword, bool, kNativeAllocationSampleBit, 1> {};
class ContinuationSampleBit
: public BitField<uword, bool, kContinuationSampleBit, 1> {};
class ThreadTaskBit

Powered by Google App Engine
This is Rietveld 408576698