| Index: runtime/vm/profiler.h
|
| diff --git a/runtime/vm/profiler.h b/runtime/vm/profiler.h
|
| index 450e5da3f6e22c89d2580fcf631b5d12bb4fab25..1f65c917a8961dce73d3a9b49dbf7d3f87f879db 100644
|
| --- a/runtime/vm/profiler.h
|
| +++ b/runtime/vm/profiler.h
|
| @@ -91,11 +91,14 @@ class SampleVisitor : public ValueObject {
|
| class SampleFilter : public ValueObject {
|
| public:
|
| SampleFilter(Isolate* isolate,
|
| + intptr_t thread_task_mask,
|
| int64_t time_origin_micros,
|
| int64_t time_extent_micros)
|
| : isolate_(isolate),
|
| + thread_task_mask_(thread_task_mask),
|
| time_origin_micros_(time_origin_micros),
|
| time_extent_micros_(time_extent_micros) {
|
| + ASSERT(thread_task_mask != 0);
|
| ASSERT(time_origin_micros_ >= -1);
|
| ASSERT(time_extent_micros_ >= -1);
|
| }
|
| @@ -114,9 +117,12 @@ class SampleFilter : public ValueObject {
|
| // Returns |true| if |sample| passes the time filter.
|
| bool TimeFilterSample(Sample* sample);
|
|
|
| + // Returns |true| if |sample| passes the thread task filter.
|
| + bool TaskFilterSample(Sample* sample);
|
| +
|
| private:
|
| Isolate* isolate_;
|
| -
|
| + intptr_t thread_task_mask_;
|
| int64_t time_origin_micros_;
|
| int64_t time_extent_micros_;
|
| };
|
| @@ -274,12 +280,12 @@ class Sample {
|
| state_ = ClassAllocationSampleBit::update(allocation_sample, state_);
|
| }
|
|
|
| - bool is_mutator_thread() const {
|
| - return MutatorThreadBit::decode(state_);
|
| + Thread::TaskKind thread_task() const {
|
| + return ThreadTaskBit::decode(state_);
|
| }
|
|
|
| - void set_is_mutator_thread(bool mutator_thread) {
|
| - state_ = MutatorThreadBit::update(mutator_thread, state_);
|
| + void set_thread_task(Thread::TaskKind task) {
|
| + state_ = ThreadTaskBit::update(task, state_);
|
| }
|
|
|
| bool is_continuation_sample() const {
|
| @@ -346,7 +352,8 @@ class Sample {
|
| kTruncatedTraceBit = 5,
|
| kClassAllocationSampleBit = 6,
|
| kContinuationSampleBit = 7,
|
| - kMutatorThreadBit = 8,
|
| + kThreadTaskBit = 8, // 4 bits.
|
| + kNextFreeBit = 12,
|
| };
|
| class HeadSampleBit : public BitField<uword, bool, kHeadSampleBit, 1> {};
|
| class LeafFrameIsDart :
|
| @@ -361,8 +368,8 @@ class Sample {
|
| : public BitField<uword, bool, kClassAllocationSampleBit, 1> {};
|
| class ContinuationSampleBit
|
| : public BitField<uword, bool, kContinuationSampleBit, 1> {};
|
| - class MutatorThreadBit
|
| - : public BitField<uword, bool, kMutatorThreadBit, 1> {};
|
| + class ThreadTaskBit
|
| + : public BitField<uword, Thread::TaskKind, kThreadTaskBit, 4> {};
|
|
|
| int64_t timestamp_;
|
| ThreadId tid_;
|
|
|