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

Unified Diff: runtime/vm/profiler_service.cc

Issue 1541893002: Support narrowing a cpu profile to a given time window (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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 9a0d5fc07a19f6d501db1a3d3a9008c122bfcccf..1aba7d3243c34f5a388363f01076bb15c84efd92 100644
--- a/runtime/vm/profiler_service.cc
+++ b/runtime/vm/profiler_service.cc
@@ -2304,8 +2304,12 @@ void ProfilerService::PrintJSONImpl(Thread* thread,
class NoAllocationSampleFilter : public SampleFilter {
public:
- explicit NoAllocationSampleFilter(Isolate* isolate)
- : SampleFilter(isolate) {
+ NoAllocationSampleFilter(Isolate* isolate,
+ int64_t time_origin_micros,
+ int64_t time_extent_micros)
+ : SampleFilter(isolate,
+ time_origin_micros,
+ time_extent_micros) {
}
bool FilterSample(Sample* sample) {
@@ -2316,10 +2320,14 @@ class NoAllocationSampleFilter : public SampleFilter {
void ProfilerService::PrintJSON(JSONStream* stream,
Profile::TagOrder tag_order,
- intptr_t extra_tags) {
+ intptr_t extra_tags,
+ int64_t time_origin_micros,
+ int64_t time_extent_micros) {
Thread* thread = Thread::Current();
Isolate* isolate = thread->isolate();
- NoAllocationSampleFilter filter(isolate);
+ NoAllocationSampleFilter filter(isolate,
+ time_origin_micros,
+ time_extent_micros);
const bool as_timeline = false;
PrintJSONImpl(thread, stream, tag_order, extra_tags, &filter, as_timeline);
}
@@ -2327,8 +2335,13 @@ void ProfilerService::PrintJSON(JSONStream* stream,
class ClassAllocationSampleFilter : public SampleFilter {
public:
- ClassAllocationSampleFilter(Isolate* isolate, const Class& cls)
- : SampleFilter(isolate),
+ ClassAllocationSampleFilter(Isolate* isolate,
+ const Class& cls,
+ int64_t time_origin_micros,
+ int64_t time_extent_micros)
+ : SampleFilter(isolate,
+ time_origin_micros,
+ time_extent_micros),
cls_(Class::Handle(cls.raw())) {
ASSERT(!cls_.IsNull());
}
@@ -2345,20 +2358,29 @@ class ClassAllocationSampleFilter : public SampleFilter {
void ProfilerService::PrintAllocationJSON(JSONStream* stream,
Profile::TagOrder tag_order,
- const Class& cls) {
+ const Class& cls,
+ int64_t time_origin_micros,
+ int64_t time_extent_micros) {
Thread* thread = Thread::Current();
Isolate* isolate = thread->isolate();
- ClassAllocationSampleFilter filter(isolate, cls);
+ ClassAllocationSampleFilter filter(isolate,
+ cls,
+ time_origin_micros,
+ time_extent_micros);
const bool as_timeline = false;
PrintJSONImpl(thread, stream, tag_order, kNoExtraTags, &filter, as_timeline);
}
void ProfilerService::PrintTimelineJSON(JSONStream* stream,
- Profile::TagOrder tag_order) {
+ Profile::TagOrder tag_order,
+ int64_t time_origin_micros,
+ int64_t time_extent_micros) {
Thread* thread = Thread::Current();
Isolate* isolate = thread->isolate();
- NoAllocationSampleFilter filter(isolate);
+ NoAllocationSampleFilter filter(isolate,
+ 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