| 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 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1186   ProcessedSampleBuffer* buffer = new(zone) ProcessedSampleBuffer(); | 1186   ProcessedSampleBuffer* buffer = new(zone) ProcessedSampleBuffer(); | 
| 1187 | 1187 | 
| 1188   const intptr_t length = capacity(); | 1188   const intptr_t length = capacity(); | 
| 1189   for (intptr_t i = 0; i < length; i++) { | 1189   for (intptr_t i = 0; i < length; i++) { | 
| 1190     Sample* sample = At(i); | 1190     Sample* sample = At(i); | 
| 1191     if (sample->ignore_sample()) { | 1191     if (sample->ignore_sample()) { | 
| 1192       // Bad sample. | 1192       // Bad sample. | 
| 1193       continue; | 1193       continue; | 
| 1194     } | 1194     } | 
| 1195     if (!sample->head_sample()) { | 1195     if (!sample->head_sample()) { | 
| 1196         // An inner sample in a chain of samples. | 1196       // An inner sample in a chain of samples. | 
| 1197         continue; | 1197       continue; | 
| 1198       } | 1198     } | 
| 1199     if (sample->isolate() != filter->isolate()) { | 1199     if (sample->isolate() != filter->isolate()) { | 
| 1200       // Another isolate. | 1200       // Another isolate. | 
| 1201       continue; | 1201       continue; | 
| 1202     } | 1202     } | 
| 1203     if (sample->timestamp() == 0) { | 1203     if (sample->timestamp() == 0) { | 
| 1204       // Empty. | 1204       // Empty. | 
| 1205       continue; | 1205       continue; | 
| 1206     } | 1206     } | 
| 1207     if (sample->At(0) == 0) { | 1207     if (sample->At(0) == 0) { | 
| 1208       // No frames. | 1208       // No frames. | 
| (...skipping 12 matching lines...) Expand all  Loading... | 
| 1221 ProcessedSample* SampleBuffer::BuildProcessedSample( | 1221 ProcessedSample* SampleBuffer::BuildProcessedSample( | 
| 1222     Sample* sample, | 1222     Sample* sample, | 
| 1223     const CodeLookupTable& clt) { | 1223     const CodeLookupTable& clt) { | 
| 1224   Thread* thread = Thread::Current(); | 1224   Thread* thread = Thread::Current(); | 
| 1225   Zone* zone = thread->zone(); | 1225   Zone* zone = thread->zone(); | 
| 1226 | 1226 | 
| 1227   ProcessedSample* processed_sample = new(zone) ProcessedSample(); | 1227   ProcessedSample* processed_sample = new(zone) ProcessedSample(); | 
| 1228 | 1228 | 
| 1229   // Copy state bits from sample. | 1229   // Copy state bits from sample. | 
| 1230   processed_sample->set_timestamp(sample->timestamp()); | 1230   processed_sample->set_timestamp(sample->timestamp()); | 
|  | 1231   processed_sample->set_tid(sample->tid()); | 
| 1231   processed_sample->set_vm_tag(sample->vm_tag()); | 1232   processed_sample->set_vm_tag(sample->vm_tag()); | 
| 1232   processed_sample->set_user_tag(sample->user_tag()); | 1233   processed_sample->set_user_tag(sample->user_tag()); | 
| 1233   if (sample->is_allocation_sample()) { | 1234   if (sample->is_allocation_sample()) { | 
| 1234     processed_sample->set_allocation_cid(sample->allocation_cid()); | 1235     processed_sample->set_allocation_cid(sample->allocation_cid()); | 
| 1235   } | 1236   } | 
| 1236   processed_sample->set_first_frame_executing(!sample->exit_frame_sample()); | 1237   processed_sample->set_first_frame_executing(!sample->exit_frame_sample()); | 
| 1237 | 1238 | 
| 1238   // Copy stack trace from sample(s). | 1239   // Copy stack trace from sample(s). | 
| 1239   bool truncated = false; | 1240   bool truncated = false; | 
| 1240   Sample* current = sample; | 1241   Sample* current = sample; | 
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1280   return next_sample; | 1281   return next_sample; | 
| 1281 } | 1282 } | 
| 1282 | 1283 | 
| 1283 | 1284 | 
| 1284 ProcessedSample::ProcessedSample() | 1285 ProcessedSample::ProcessedSample() | 
| 1285     : pcs_(kSampleSize), | 1286     : pcs_(kSampleSize), | 
| 1286       timestamp_(0), | 1287       timestamp_(0), | 
| 1287       vm_tag_(0), | 1288       vm_tag_(0), | 
| 1288       user_tag_(0), | 1289       user_tag_(0), | 
| 1289       allocation_cid_(-1), | 1290       allocation_cid_(-1), | 
| 1290       truncated_(false) { | 1291       truncated_(false), | 
|  | 1292       timeline_trie_(NULL) { | 
| 1291 } | 1293 } | 
| 1292 | 1294 | 
| 1293 | 1295 | 
| 1294 void ProcessedSample::FixupCaller(const CodeLookupTable& clt, | 1296 void ProcessedSample::FixupCaller(const CodeLookupTable& clt, | 
| 1295                                   uword pc_marker, | 1297                                   uword pc_marker, | 
| 1296                                   uword* stack_buffer) { | 1298                                   uword* stack_buffer) { | 
| 1297   const CodeDescriptor* cd = clt.FindCode(At(0)); | 1299   const CodeDescriptor* cd = clt.FindCode(At(0)); | 
| 1298   if (cd == NULL) { | 1300   if (cd == NULL) { | 
| 1299     // No Dart code. | 1301     // No Dart code. | 
| 1300     return; | 1302     return; | 
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1361   } | 1363   } | 
| 1362 } | 1364 } | 
| 1363 | 1365 | 
| 1364 | 1366 | 
| 1365 ProcessedSampleBuffer::ProcessedSampleBuffer() | 1367 ProcessedSampleBuffer::ProcessedSampleBuffer() | 
| 1366     : code_lookup_table_(new CodeLookupTable(Thread::Current())) { | 1368     : code_lookup_table_(new CodeLookupTable(Thread::Current())) { | 
| 1367   ASSERT(code_lookup_table_ != NULL); | 1369   ASSERT(code_lookup_table_ != NULL); | 
| 1368 } | 1370 } | 
| 1369 | 1371 | 
| 1370 }  // namespace dart | 1372 }  // namespace dart | 
| OLD | NEW | 
|---|