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

Side by Side Diff: runtime/vm/profiler.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 unified diff | Download patch
« no previous file with comments | « runtime/vm/profiler.h ('k') | runtime/vm/profiler_service.h » ('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 #include "platform/address_sanitizer.h" 5 #include "platform/address_sanitizer.h"
6 #include "platform/memory_sanitizer.h" 6 #include "platform/memory_sanitizer.h"
7 #include "platform/utils.h" 7 #include "platform/utils.h"
8 8
9 #include "vm/allocation.h" 9 #include "vm/allocation.h"
10 #include "vm/atomic.h" 10 #include "vm/atomic.h"
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 #elif defined(TARGET_ARCH_MIPS) 289 #elif defined(TARGET_ARCH_MIPS)
290 bool ReturnAddressLocator::LocateReturnAddress(uword* return_address) { 290 bool ReturnAddressLocator::LocateReturnAddress(uword* return_address) {
291 ASSERT(return_address != NULL); 291 ASSERT(return_address != NULL);
292 return false; 292 return false;
293 } 293 }
294 #else 294 #else
295 #error ReturnAddressLocator implementation missing for this architecture. 295 #error ReturnAddressLocator implementation missing for this architecture.
296 #endif 296 #endif
297 297
298 298
299 bool SampleFilter::TimeFilterSample(Sample* sample) {
300 if ((time_origin_micros_ == -1) ||
301 (time_extent_micros_ == -1)) {
302 // No time filter passed in, always pass.
303 return true;
304 }
305 const int64_t timestamp = sample->timestamp();
306 int64_t delta = timestamp - time_origin_micros_;
307 return (delta >= 0) && (delta < time_extent_micros_);
308 }
309
310
299 ClearProfileVisitor::ClearProfileVisitor(Isolate* isolate) 311 ClearProfileVisitor::ClearProfileVisitor(Isolate* isolate)
300 : SampleVisitor(isolate) { 312 : SampleVisitor(isolate) {
301 } 313 }
302 314
303 315
304 void ClearProfileVisitor::VisitSample(Sample* sample) { 316 void ClearProfileVisitor::VisitSample(Sample* sample) {
305 sample->Clear(); 317 sample->Clear();
306 } 318 }
307 319
308 320
(...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after
1201 continue; 1213 continue;
1202 } 1214 }
1203 if (sample->timestamp() == 0) { 1215 if (sample->timestamp() == 0) {
1204 // Empty. 1216 // Empty.
1205 continue; 1217 continue;
1206 } 1218 }
1207 if (sample->At(0) == 0) { 1219 if (sample->At(0) == 0) {
1208 // No frames. 1220 // No frames.
1209 continue; 1221 continue;
1210 } 1222 }
1223 if (!filter->TimeFilterSample(sample)) {
1224 // Did not pass time filter.
1225 continue;
1226 }
1211 if (!filter->FilterSample(sample)) { 1227 if (!filter->FilterSample(sample)) {
1212 // Did not pass filter. 1228 // Did not pass filter.
1213 continue; 1229 continue;
1214 } 1230 }
1215 buffer->Add(BuildProcessedSample(sample, buffer->code_lookup_table())); 1231 buffer->Add(BuildProcessedSample(sample, buffer->code_lookup_table()));
1216 } 1232 }
1217 return buffer; 1233 return buffer;
1218 } 1234 }
1219 1235
1220 1236
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
1363 } 1379 }
1364 } 1380 }
1365 1381
1366 1382
1367 ProcessedSampleBuffer::ProcessedSampleBuffer() 1383 ProcessedSampleBuffer::ProcessedSampleBuffer()
1368 : code_lookup_table_(new CodeLookupTable(Thread::Current())) { 1384 : code_lookup_table_(new CodeLookupTable(Thread::Current())) {
1369 ASSERT(code_lookup_table_ != NULL); 1385 ASSERT(code_lookup_table_ != NULL);
1370 } 1386 }
1371 1387
1372 } // namespace dart 1388 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/profiler.h ('k') | runtime/vm/profiler_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698