OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2010 the V8 project authors. All rights reserved. | 3 # Copyright 2010 the V8 project authors. All rights reserved. |
4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
6 # met: | 6 # met: |
7 # | 7 # |
8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 origin = JS_SNAPSHOT_ORIGIN | 392 origin = JS_SNAPSHOT_ORIGIN |
393 else: | 393 else: |
394 name = self.log[self.log_pos:self.log_pos + event.name_size] | 394 name = self.log[self.log_pos:self.log_pos + event.name_size] |
395 origin = JS_ORIGIN | 395 origin = JS_ORIGIN |
396 self.log_pos += event.name_size | 396 self.log_pos += event.name_size |
397 origin_offset = self.log_pos | 397 origin_offset = self.log_pos |
398 self.log_pos += event.code_size | 398 self.log_pos += event.code_size |
399 code = Code(name, start_address, end_address, origin, origin_offset) | 399 code = Code(name, start_address, end_address, origin, origin_offset) |
400 conficting_code = self.code_map.Find(start_address) | 400 conficting_code = self.code_map.Find(start_address) |
401 if conficting_code: | 401 if conficting_code: |
402 LogReader._HandleCodeConflict(conficting_code, code) | 402 if not (conficting_code.start_address == code.start_address and |
403 # TODO(vitalyr): this warning is too noisy because of our | 403 conficting_code.end_address == code.end_address): |
404 # attempts to reconstruct code log from the snapshot. | 404 self.code_map.Remove(conficting_code) |
405 # print >>sys.stderr, \ | 405 else: |
406 # "Warning: Skipping duplicate code log entry %s" % code | 406 LogReader._HandleCodeConflict(conficting_code, code) |
407 continue | 407 # TODO(vitalyr): this warning is too noisy because of our |
| 408 # attempts to reconstruct code log from the snapshot. |
| 409 # print >>sys.stderr, \ |
| 410 # "Warning: Skipping duplicate code log entry %s" % code |
| 411 continue |
408 self.code_map.Add(code) | 412 self.code_map.Add(code) |
409 continue | 413 continue |
410 | 414 |
411 if tag == LogReader._CODE_MOVE_TAG: | 415 if tag == LogReader._CODE_MOVE_TAG: |
412 event = self.code_move_struct.from_buffer(self.log, self.log_pos) | 416 event = self.code_move_struct.from_buffer(self.log, self.log_pos) |
413 self.log_pos += ctypes.sizeof(event) | 417 self.log_pos += ctypes.sizeof(event) |
414 old_start_address = event.from_address | 418 old_start_address = event.from_address |
415 new_start_address = event.to_address | 419 new_start_address = event.to_address |
416 if old_start_address == new_start_address: | 420 if old_start_address == new_start_address: |
417 # Skip useless code move entries. | 421 # Skip useless code move entries. |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
933 print "%10d total ticks" % ticks | 937 print "%10d total ticks" % ticks |
934 print "%10d ticks not in symbols" % missed_ticks | 938 print "%10d ticks not in symbols" % missed_ticks |
935 print "%10d unaccounted ticks" % really_missed_ticks | 939 print "%10d unaccounted ticks" % really_missed_ticks |
936 print "%10d total symbols" % len([c for c in code_map.AllCode()]) | 940 print "%10d total symbols" % len([c for c in code_map.AllCode()]) |
937 print "%10d used symbols" % len([c for c in code_map.UsedCode()]) | 941 print "%10d used symbols" % len([c for c in code_map.UsedCode()]) |
938 print "%9.2fs library processing time" % mmap_time | 942 print "%9.2fs library processing time" % mmap_time |
939 print "%9.2fs tick processing time" % sample_time | 943 print "%9.2fs tick processing time" % sample_time |
940 | 944 |
941 log_reader.Dispose() | 945 log_reader.Dispose() |
942 trace_reader.Dispose() | 946 trace_reader.Dispose() |
OLD | NEW |