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

Unified Diff: runtime/vm/profiler_service.cc

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 | « runtime/vm/profiler.cc ('k') | runtime/vm/profiler_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/profiler_service.cc
diff --git a/runtime/vm/profiler_service.cc b/runtime/vm/profiler_service.cc
index 9cfce3d23f921384e30efab2c4dc4df79ce09e06..fb862a992aa8bbb04a470d9fc2488c0338968e8c 100644
--- a/runtime/vm/profiler_service.cc
+++ b/runtime/vm/profiler_service.cc
@@ -2497,24 +2497,21 @@ void ProfilerService::PrintJSONImpl(Thread* thread,
class NoAllocationSampleFilter : public SampleFilter {
public:
NoAllocationSampleFilter(Isolate* isolate,
- bool include_background_samples,
+ intptr_t thread_task_mask,
int64_t time_origin_micros,
int64_t time_extent_micros)
: SampleFilter(isolate,
+ thread_task_mask,
time_origin_micros,
- time_extent_micros),
- include_background_samples_(include_background_samples) {
+ time_extent_micros) {
}
bool FilterSample(Sample* sample) {
if (sample->is_allocation_sample()) {
rmacnak 2016/03/21 21:10:52 return !sample->is_allocation_sample()
Cutch 2016/03/22 15:42:27 Done.
return false;
}
- return sample->is_mutator_thread() || include_background_samples_;
+ return true;
}
-
- private:
- const bool include_background_samples_;
};
@@ -2525,9 +2522,8 @@ void ProfilerService::PrintJSON(JSONStream* stream,
int64_t time_extent_micros) {
Thread* thread = Thread::Current();
Isolate* isolate = thread->isolate();
- const bool include_background_samples = false;
NoAllocationSampleFilter filter(isolate,
- include_background_samples,
+ Thread::kMutatorTask,
time_origin_micros,
time_extent_micros);
const bool as_timeline = false;
@@ -2539,9 +2535,11 @@ class ClassAllocationSampleFilter : public SampleFilter {
public:
ClassAllocationSampleFilter(Isolate* isolate,
const Class& cls,
+ intptr_t thread_task_mask,
int64_t time_origin_micros,
int64_t time_extent_micros)
: SampleFilter(isolate,
+ thread_task_mask,
time_origin_micros,
time_extent_micros),
cls_(Class::Handle(cls.raw())) {
@@ -2567,6 +2565,7 @@ void ProfilerService::PrintAllocationJSON(JSONStream* stream,
Isolate* isolate = thread->isolate();
ClassAllocationSampleFilter filter(isolate,
cls,
+ Thread::kMutatorTask,
time_origin_micros,
time_extent_micros);
const bool as_timeline = false;
@@ -2580,9 +2579,12 @@ void ProfilerService::PrintTimelineJSON(JSONStream* stream,
int64_t time_extent_micros) {
Thread* thread = Thread::Current();
Isolate* isolate = thread->isolate();
- const bool include_background_samples = true;
+ const intptr_t thread_task_mask = Thread::kMutatorTask |
+ Thread::kCompilerTask |
+ Thread::kSweeperTask |
+ Thread::kMarkerTask;
NoAllocationSampleFilter filter(isolate,
- include_background_samples,
+ thread_task_mask,
time_origin_micros,
time_extent_micros);
const bool as_timeline = true;
« no previous file with comments | « runtime/vm/profiler.cc ('k') | runtime/vm/profiler_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698