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

Side by Side Diff: runtime/vm/profiler.h

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 unified diff | Download patch
« no previous file with comments | « no previous file | runtime/vm/profiler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_PROFILER_H_ 5 #ifndef VM_PROFILER_H_
6 #define VM_PROFILER_H_ 6 #define VM_PROFILER_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/bitfield.h" 9 #include "vm/bitfield.h"
10 #include "vm/code_observers.h" 10 #include "vm/code_observers.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 private: 84 private:
85 Isolate* isolate_; 85 Isolate* isolate_;
86 intptr_t visited_; 86 intptr_t visited_;
87 87
88 DISALLOW_IMPLICIT_CONSTRUCTORS(SampleVisitor); 88 DISALLOW_IMPLICIT_CONSTRUCTORS(SampleVisitor);
89 }; 89 };
90 90
91 91
92 class SampleFilter : public ValueObject { 92 class SampleFilter : public ValueObject {
93 public: 93 public:
94 explicit SampleFilter(Isolate* isolate) : isolate_(isolate) { } 94 SampleFilter(Isolate* isolate,
95 int64_t time_origin_micros,
96 int64_t time_extent_micros)
97 : isolate_(isolate),
98 time_origin_micros_(time_origin_micros),
99 time_extent_micros_(time_extent_micros) { }
95 virtual ~SampleFilter() { } 100 virtual ~SampleFilter() { }
96 101
97 // Override this function. 102 // Override this function.
98 // Return |true| if |sample| passes the filter. 103 // Return |true| if |sample| passes the filter.
99 virtual bool FilterSample(Sample* sample) { 104 virtual bool FilterSample(Sample* sample) {
100 return true; 105 return true;
101 } 106 }
102 107
103 Isolate* isolate() const { 108 Isolate* isolate() const {
104 return isolate_; 109 return isolate_;
105 } 110 }
106 111
112 // Returns |true| if |sample| passes the time filter.
113 bool TimeFilterSample(Sample* sample);
114
107 private: 115 private:
108 Isolate* isolate_; 116 Isolate* isolate_;
117
118 int64_t time_origin_micros_;
119 int64_t time_extent_micros_;
109 }; 120 };
110 121
111 122
112 class ClearProfileVisitor : public SampleVisitor { 123 class ClearProfileVisitor : public SampleVisitor {
113 public: 124 public:
114 explicit ClearProfileVisitor(Isolate* isolate); 125 explicit ClearProfileVisitor(Isolate* isolate);
115 126
116 virtual void VisitSample(Sample* sample); 127 virtual void VisitSample(Sample* sample);
117 }; 128 };
118 129
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 private: 629 private:
619 ZoneGrowableArray<ProcessedSample*> samples_; 630 ZoneGrowableArray<ProcessedSample*> samples_;
620 CodeLookupTable* code_lookup_table_; 631 CodeLookupTable* code_lookup_table_;
621 632
622 DISALLOW_COPY_AND_ASSIGN(ProcessedSampleBuffer); 633 DISALLOW_COPY_AND_ASSIGN(ProcessedSampleBuffer);
623 }; 634 };
624 635
625 } // namespace dart 636 } // namespace dart
626 637
627 #endif // VM_PROFILER_H_ 638 #endif // VM_PROFILER_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698