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

Unified Diff: runtime/vm/profiler.h

Issue 2713803003: Revert "Updated MallocHooks to collect stack traces when memory is allocated." (Closed)
Patch Set: 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
« no previous file with comments | « runtime/vm/os_win.cc ('k') | runtime/vm/profiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/profiler.h
diff --git a/runtime/vm/profiler.h b/runtime/vm/profiler.h
index 9f967cf9bea02ca0b3b176a14616582e3f6a1d75..ee87a31d954051b61af6a7a822b7f2bb78da23eb 100644
--- a/runtime/vm/profiler.h
+++ b/runtime/vm/profiler.h
@@ -41,8 +41,6 @@ struct ProfilerCounters {
int64_t stack_walker_dart_exit;
int64_t stack_walker_dart;
int64_t stack_walker_none;
- // Count of failed checks:
- int64_t failure_native_allocation_sample;
};
@@ -60,7 +58,6 @@ class Profiler : public AllStatic {
static void DumpStackTrace();
static void SampleAllocation(Thread* thread, intptr_t cid);
- static Sample* SampleNativeAllocation(intptr_t skip_count);
// 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
@@ -94,7 +91,7 @@ class Profiler : public AllStatic {
class SampleVisitor : public ValueObject {
public:
- explicit SampleVisitor(Dart_Port port) : port_(port), visited_(0) {}
+ explicit SampleVisitor(Isolate* isolate) : isolate_(isolate), visited_(0) {}
virtual ~SampleVisitor() {}
virtual void VisitSample(Sample* sample) = 0;
@@ -103,10 +100,10 @@ class SampleVisitor : public ValueObject {
void IncrementVisited() { visited_++; }
- Dart_Port port() const { return port_; }
+ Isolate* isolate() const { return isolate_; }
private:
- Dart_Port port_;
+ Isolate* isolate_;
intptr_t visited_;
DISALLOW_IMPLICIT_CONSTRUCTORS(SampleVisitor);
@@ -115,11 +112,11 @@ class SampleVisitor : public ValueObject {
class SampleFilter : public ValueObject {
public:
- SampleFilter(Dart_Port port,
+ SampleFilter(Isolate* isolate,
intptr_t thread_task_mask,
int64_t time_origin_micros,
int64_t time_extent_micros)
- : port_(port),
+ : isolate_(isolate),
thread_task_mask_(thread_task_mask),
time_origin_micros_(time_origin_micros),
time_extent_micros_(time_extent_micros) {
@@ -133,7 +130,7 @@ class SampleFilter : public ValueObject {
// Return |true| if |sample| passes the filter.
virtual bool FilterSample(Sample* sample) { return true; }
- Dart_Port port() const { return port_; }
+ Isolate* isolate() const { return isolate_; }
// Returns |true| if |sample| passes the time filter.
bool TimeFilterSample(Sample* sample);
@@ -142,7 +139,7 @@ class SampleFilter : public ValueObject {
bool TaskFilterSample(Sample* sample);
private:
- Dart_Port port_;
+ Isolate* isolate_;
intptr_t thread_task_mask_;
int64_t time_origin_micros_;
int64_t time_extent_micros_;
@@ -160,20 +157,21 @@ class ClearProfileVisitor : public SampleVisitor {
// Each Sample holds a stack trace from an isolate.
class Sample {
public:
- void Init(Dart_Port port, int64_t timestamp, ThreadId tid) {
+ void Init(Isolate* isolate, int64_t timestamp, ThreadId tid) {
Clear();
timestamp_ = timestamp;
tid_ = tid;
- port_ = port;
+ isolate_ = isolate;
}
- Dart_Port port() const { return port_; }
+ // Isolate sample was taken from.
+ Isolate* isolate() const { return isolate_; }
// Thread sample was taken on.
ThreadId tid() const { return tid_; }
void Clear() {
- port_ = ILLEGAL_PORT;
+ isolate_ = NULL;
pc_marker_ = 0;
for (intptr_t i = 0; i < kStackBufferSizeInWords; i++) {
stack_buffer_[i] = 0;
@@ -270,15 +268,6 @@ 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) {
@@ -342,8 +331,7 @@ class Sample {
kClassAllocationSampleBit = 6,
kContinuationSampleBit = 7,
kThreadTaskBit = 8, // 5 bits.
- kNativeAllocationSampleBit = 13,
- kNextFreeBit = 14,
+ kNextFreeBit = 13,
};
class HeadSampleBit : public BitField<uword, bool, kHeadSampleBit, 1> {};
class LeafFrameIsDart : public BitField<uword, bool, kLeafFrameIsDartBit, 1> {
@@ -360,12 +348,10 @@ class Sample {
: public BitField<uword, bool, kContinuationSampleBit, 1> {};
class ThreadTaskBit
: public BitField<uword, Thread::TaskKind, kThreadTaskBit, 5> {};
- class NativeAllocationSampleBit
- : public BitField<uword, bool, kNativeAllocationSampleBit, 1> {};
int64_t timestamp_;
ThreadId tid_;
- Dart_Port port_;
+ Isolate* isolate_;
uword pc_marker_;
uword stack_buffer_[kStackBufferSizeInWords];
uword vm_tag_;
@@ -488,7 +474,7 @@ class SampleBuffer {
// Bad sample.
continue;
}
- if (sample->port() != visitor->port()) {
+ if (sample->isolate() != visitor->isolate()) {
// Another isolate.
continue;
}
« no previous file with comments | « runtime/vm/os_win.cc ('k') | runtime/vm/profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698