OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2012 the V8 project authors. All rights reserved. | 3 # Copyright 2012 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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 return snapshot_pos_to_name | 344 return snapshot_pos_to_name |
345 | 345 |
346 | 346 |
347 class LogReader(object): | 347 class LogReader(object): |
348 """V8 low-level (binary) log reader.""" | 348 """V8 low-level (binary) log reader.""" |
349 | 349 |
350 _ARCH_TO_POINTER_TYPE_MAP = { | 350 _ARCH_TO_POINTER_TYPE_MAP = { |
351 "ia32": ctypes.c_uint32, | 351 "ia32": ctypes.c_uint32, |
352 "arm": ctypes.c_uint32, | 352 "arm": ctypes.c_uint32, |
353 "mips": ctypes.c_uint32, | 353 "mips": ctypes.c_uint32, |
354 "x64": ctypes.c_uint64 | 354 "x64": ctypes.c_uint64, |
| 355 "arm64": ctypes.c_uint64 |
355 } | 356 } |
356 | 357 |
357 _CODE_CREATE_TAG = "C" | 358 _CODE_CREATE_TAG = "C" |
358 _CODE_MOVE_TAG = "M" | 359 _CODE_MOVE_TAG = "M" |
359 _CODE_DELETE_TAG = "D" | 360 _CODE_DELETE_TAG = "D" |
360 _SNAPSHOT_POSITION_TAG = "P" | 361 _SNAPSHOT_POSITION_TAG = "P" |
361 _CODE_MOVING_GC_TAG = "G" | 362 _CODE_MOVING_GC_TAG = "G" |
362 | 363 |
363 def __init__(self, log_name, code_map, snapshot_pos_to_name): | 364 def __init__(self, log_name, code_map, snapshot_pos_to_name): |
364 self.log_file = open(log_name, "r") | 365 self.log_file = open(log_name, "r") |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 PrintTicks(optimized_ticks, ticks, "ticks in optimized code") | 1003 PrintTicks(optimized_ticks, ticks, "ticks in optimized code") |
1003 PrintTicks(generated_ticks, ticks, "ticks in other lazily compiled code") | 1004 PrintTicks(generated_ticks, ticks, "ticks in other lazily compiled code") |
1004 PrintTicks(v8_internal_ticks, ticks, "ticks in v8::internal::*") | 1005 PrintTicks(v8_internal_ticks, ticks, "ticks in v8::internal::*") |
1005 print "%10d total symbols" % len([c for c in code_map.AllCode()]) | 1006 print "%10d total symbols" % len([c for c in code_map.AllCode()]) |
1006 print "%10d used symbols" % len([c for c in code_map.UsedCode()]) | 1007 print "%10d used symbols" % len([c for c in code_map.UsedCode()]) |
1007 print "%9.2fs library processing time" % mmap_time | 1008 print "%9.2fs library processing time" % mmap_time |
1008 print "%9.2fs tick processing time" % sample_time | 1009 print "%9.2fs tick processing time" % sample_time |
1009 | 1010 |
1010 log_reader.Dispose() | 1011 log_reader.Dispose() |
1011 trace_reader.Dispose() | 1012 trace_reader.Dispose() |
OLD | NEW |