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

Unified Diff: runtime/vm/profiler_service.cc

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/profiler_service.h ('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 8b9bee9489e861ece363d122e87e3e01413d9711..5290e0697d0be85c47e5d1afba05d6069c55d92d 100644
--- a/runtime/vm/profiler_service.cc
+++ b/runtime/vm/profiler_service.cc
@@ -2670,19 +2670,16 @@ void ProfilerService::PrintJSONImpl(Thread* thread,
class NoAllocationSampleFilter : public SampleFilter {
public:
- NoAllocationSampleFilter(Dart_Port port,
+ NoAllocationSampleFilter(Isolate* isolate,
intptr_t thread_task_mask,
int64_t time_origin_micros,
int64_t time_extent_micros)
- : SampleFilter(port,
+ : SampleFilter(isolate,
thread_task_mask,
time_origin_micros,
time_extent_micros) {}
- bool FilterSample(Sample* sample) {
- return !sample->is_allocation_sample() &&
- !sample->is_native_allocation_sample();
- }
+ bool FilterSample(Sample* sample) { return !sample->is_allocation_sample(); }
};
@@ -2693,7 +2690,7 @@ void ProfilerService::PrintJSON(JSONStream* stream,
int64_t time_extent_micros) {
Thread* thread = Thread::Current();
Isolate* isolate = thread->isolate();
- NoAllocationSampleFilter filter(isolate->main_port(), Thread::kMutatorTask,
+ NoAllocationSampleFilter filter(isolate, Thread::kMutatorTask,
time_origin_micros, time_extent_micros);
const bool as_timeline = false;
PrintJSONImpl(thread, stream, tag_order, extra_tags, &filter, as_timeline);
@@ -2702,12 +2699,12 @@ void ProfilerService::PrintJSON(JSONStream* stream,
class ClassAllocationSampleFilter : public SampleFilter {
public:
- ClassAllocationSampleFilter(Dart_Port port,
+ ClassAllocationSampleFilter(Isolate* isolate,
const Class& cls,
intptr_t thread_task_mask,
int64_t time_origin_micros,
int64_t time_extent_micros)
- : SampleFilter(port,
+ : SampleFilter(isolate,
thread_task_mask,
time_origin_micros,
time_extent_micros),
@@ -2725,21 +2722,6 @@ class ClassAllocationSampleFilter : public SampleFilter {
};
-class NativeAllocationSampleFilter : public SampleFilter {
- public:
- NativeAllocationSampleFilter(intptr_t thread_task_mask,
- int64_t time_origin_micros,
- int64_t time_extent_micros)
- : SampleFilter(ILLEGAL_PORT,
- thread_task_mask,
- time_origin_micros,
- time_extent_micros) {}
- bool FilterSample(Sample* sample) {
- return sample->is_native_allocation_sample();
- }
-};
-
-
void ProfilerService::PrintAllocationJSON(JSONStream* stream,
Profile::TagOrder tag_order,
const Class& cls,
@@ -2747,24 +2729,8 @@ void ProfilerService::PrintAllocationJSON(JSONStream* stream,
int64_t time_extent_micros) {
Thread* thread = Thread::Current();
Isolate* isolate = thread->isolate();
- ClassAllocationSampleFilter filter(isolate->main_port(), cls,
- Thread::kMutatorTask, time_origin_micros,
- time_extent_micros);
- const bool as_timeline = false;
- PrintJSONImpl(thread, stream, tag_order, kNoExtraTags, &filter, as_timeline);
-}
-
-
-void ProfilerService::PrintNativeAllocationJSON(JSONStream* stream,
- Profile::TagOrder tag_order,
- int64_t time_origin_micros,
- int64_t time_extent_micros) {
- Thread* thread = Thread::Current();
- const intptr_t thread_task_mask = Thread::kMutatorTask |
- Thread::kCompilerTask |
- Thread::kSweeperTask | Thread::kMarkerTask;
- NativeAllocationSampleFilter filter(thread_task_mask, time_origin_micros,
- time_extent_micros);
+ ClassAllocationSampleFilter filter(isolate, cls, Thread::kMutatorTask,
+ time_origin_micros, time_extent_micros);
const bool as_timeline = false;
PrintJSONImpl(thread, stream, tag_order, kNoExtraTags, &filter, as_timeline);
}
@@ -2779,8 +2745,8 @@ void ProfilerService::PrintTimelineJSON(JSONStream* stream,
const intptr_t thread_task_mask = Thread::kMutatorTask |
Thread::kCompilerTask |
Thread::kSweeperTask | Thread::kMarkerTask;
- NoAllocationSampleFilter filter(isolate->main_port(), thread_task_mask,
- time_origin_micros, time_extent_micros);
+ NoAllocationSampleFilter filter(isolate, thread_task_mask, time_origin_micros,
+ time_extent_micros);
const bool as_timeline = true;
PrintJSONImpl(thread, stream, tag_order, kNoExtraTags, &filter, as_timeline);
}
« no previous file with comments | « runtime/vm/profiler_service.h ('k') | runtime/vm/profiler_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698