| 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 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 if self.offset >= self.limit: | 628 if self.offset >= self.limit: |
| 629 return None, 0 | 629 return None, 0 |
| 630 offset = self.offset | 630 offset = self.offset |
| 631 header = PERF_EVENT_HEADER_DESC.Read(self.trace, self.offset) | 631 header = PERF_EVENT_HEADER_DESC.Read(self.trace, self.offset) |
| 632 self.offset += header.size | 632 self.offset += header.size |
| 633 return header, offset | 633 return header, offset |
| 634 | 634 |
| 635 def ReadMmap(self, header, offset): | 635 def ReadMmap(self, header, offset): |
| 636 mmap_info = PERF_MMAP_EVENT_BODY_DESC.Read(self.trace, | 636 mmap_info = PERF_MMAP_EVENT_BODY_DESC.Read(self.trace, |
| 637 offset + self.header_size) | 637 offset + self.header_size) |
| 638 # Read null-padded filename. | 638 # Read null-terminated filename. |
| 639 filename = self.trace[offset + self.header_size + ctypes.sizeof(mmap_info): | 639 filename = self.trace[offset + self.header_size + ctypes.sizeof(mmap_info): |
| 640 offset + header.size].rstrip(chr(0)) | 640 offset + header.size] |
| 641 mmap_info.filename = filename | 641 mmap_info.filename = filename[:filename.find(chr(0))] |
| 642 return mmap_info | 642 return mmap_info |
| 643 | 643 |
| 644 def ReadSample(self, header, offset): | 644 def ReadSample(self, header, offset): |
| 645 sample = self.sample_event_body_desc.Read(self.trace, | 645 sample = self.sample_event_body_desc.Read(self.trace, |
| 646 offset + self.header_size) | 646 offset + self.header_size) |
| 647 if not self.callchain_supported: | 647 if not self.callchain_supported: |
| 648 return sample | 648 return sample |
| 649 sample.ips = [] | 649 sample.ips = [] |
| 650 offset += self.header_size + ctypes.sizeof(sample) | 650 offset += self.header_size + ctypes.sizeof(sample) |
| 651 for _ in xrange(sample.nr): | 651 for _ in xrange(sample.nr): |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 937 print "%10d total ticks" % ticks | 937 print "%10d total ticks" % ticks |
| 938 print "%10d ticks not in symbols" % missed_ticks | 938 print "%10d ticks not in symbols" % missed_ticks |
| 939 print "%10d unaccounted ticks" % really_missed_ticks | 939 print "%10d unaccounted ticks" % really_missed_ticks |
| 940 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()]) |
| 941 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()]) |
| 942 print "%9.2fs library processing time" % mmap_time | 942 print "%9.2fs library processing time" % mmap_time |
| 943 print "%9.2fs tick processing time" % sample_time | 943 print "%9.2fs tick processing time" % sample_time |
| 944 | 944 |
| 945 log_reader.Dispose() | 945 log_reader.Dispose() |
| 946 trace_reader.Dispose() | 946 trace_reader.Dispose() |
| OLD | NEW |