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

Unified Diff: runtime/vm/profiler.h

Issue 1820013002: Remember thread's task when sampling use it when filtering (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | runtime/vm/profiler.cc » ('j') | runtime/vm/profiler_service.cc » ('J')
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 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_;
« no previous file with comments | « no previous file | runtime/vm/profiler.cc » ('j') | runtime/vm/profiler_service.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698