OLD | NEW |
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 Loading... |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |