Commits

Maciej Fijalkowski committed b81a1cf Merge

Merged in kostialopuhin/pypy/fix-jit-logs (pull request #133)

Fix jitlogparser after changes in jit logging from jitframe-on-heap branch

Comments (0)

Files changed (7)

pypy/tool/jitlogparser/parser.py

 
 def import_log(logname, ParserCls=SimpleParser):
     log = parse_log_file(logname)
+    hex_re = '0x([\da-f]+)'
     addrs = {}
     for entry in extract_category(log, 'jit-backend-addr'):
-        m = re.search('bootstrap ([-\da-f]+)', entry)
+        m = re.search('bootstrap ' + hex_re, entry)
         if not m:
             # a bridge
-            m = re.search('has address ([-\da-f]+)', entry)
+            m = re.search('has address ' + hex_re, entry)
             addr = int(m.group(1), 16)
             entry = entry.lower()
-            m = re.search('guard [\da-f]+', entry)
-            name = m.group(0)
+            m = re.search('guard ' + hex_re, entry)
+            name = 'guard ' + m.group(1)
         else:
             name = entry[:entry.find('(') - 1].lower()
             addr = int(m.group(1), 16)
         comm = loop.comment
         comm = comm.lower()
         if comm.startswith('# bridge'):
-            m = re.search('guard (\d+)', comm)
-            name = 'guard ' + hex(int(m.group(1)))[2:]
+            m = re.search('guard ([\da-f]+)', comm)
+            name = 'guard ' + m.group(1)
         elif "(" in comm:
             name = comm[2:comm.find('(')-1]
         else:
 def split_trace(trace):
     labels = [0]
     if trace.comment and 'Guard' in trace.comment:
-        descrs = ['bridge ' + re.search('Guard ([\da-f]+)', trace.comment).group(1)]
+        descrs = ['bridge %d' % int(
+            re.search('Guard ([\da-f]+)', trace.comment).group(1), 16)]
     else:
         descrs = ['entry ' + re.search('Loop (\d+)', trace.comment).group(1)]
     for i, op in enumerate(trace.operations):

pypy/tool/jitlogparser/test/logtest.log

 CODE_DUMP @7f3b0b2e63d5 +0  554889E5534154415541564157488DA500000000488B042590C5540148C7042590C554010000000048898570FFFFFF488B042598C5540148C7042598C554010000000048898568FFFFFF488B0425A0C5540148C70425A0C554010000000048898560FFFFFF488B0425A8C5540148C70425A8C554010000000048898558FFFFFF4C8B3C2550525B0149BB3050920D3B7F00004D8B334983C60149BB3050920D3B7F00004D89334981FF102700000F8D000000004983C7014C8B342580F76A024983EE014C89342580F76A024983FE000F8C00000000E9AEFFFFFF488B042588F76A024829E0483B042580EC3C01760D49BB05632E0B3B7F000041FFD3554889E5534154415541564157488DA550FFFFFF4889BD70FFFFFF4889B568FFFFFF48899560FFFFFF48898D58FFFFFF4D89C7E954FFFFFF49BB00602E0B3B7F000041FFD34440484C3D030300000049BB00602E0B3B7F000041FFD34440484C3D070304000000
 [11f210b949b3] jit-backend-dump}
 [11f210b949b4] {jit-backend-addr
-Loop 0 (<code object f, file 'x.py', line 2> #9 LOAD_FAST) has address 7f3b0b2e645d to 7f3b0b2e64af (bootstrap 7f3b0b2e63d5)
+Loop 0 (<code object f, file 'x.py', line 2> #9 LOAD_FAST) has address 0x7f3b0b2e645d to 0x7f3b0b2e64af (bootstrap 0x7f3b0b2e63d5)
 [11f210bab188] jit-backend-addr}
 [11f210bab189] jit-backend}
 [11f210bacbb7] {jit-log-opt-loop

pypy/tool/jitlogparser/test/logtest2.log

 CODE_DUMP @7f8907a0b3d5 +0  554889E5534154415541564157488DA500000000488B042590C2540148C7042590C254010000000048898570FFFFFF488B042598C2540148C7042598C254010000000048898568FFFFFF488B0425A0C2540148C70425A0C254010000000048898560FFFFFF488B0425A8C2540148C70425A8C254010000000048898558FFFFFF4C8B3C25D04D5B0149BB30B00C0A897F00004D8B334983C60149BB30B00C0A897F00004D89334981FF102700000F8D000000004D89FE4983E7024983FF000F85000000004983C6034C8B3C25A0536B024983EF014C893C25A0536B024983FF000F8C000000004D89F7E99AFFFFFF488B0425A8536B024829E0483B042580DC3C01760D49BB05B3A007897F000041FFD3554889E5534154415541564157488DA550FFFFFF4889BD70FFFFFF4889B568FFFFFF48899560FFFFFF48898D58FFFFFF4D89C7E940FFFFFF49BB00B0A007897F000041FFD34440484C3D030300000049BB00B0A007897F000041FFD34440484C3D39030400000049BB00B0A007897F000041FFD34440484C3907070305000000
 [1f5fe73276a] jit-backend-dump}
 [1f5fe73438f] {jit-backend-addr
-Loop 0 (<code object f, file 'x.py', line 2> #9 LOAD_FAST) has address 7f8907a0b45d to 7f8907a0b4c3 (bootstrap 7f8907a0b3d5)
+Loop 0 (<code object f, file 'x.py', line 2> #9 LOAD_FAST) has address 0x7f8907a0b45d to 0x7f8907a0b4c3 (bootstrap 0x7f8907a0b3d5)
 [1f5fe7369af] jit-backend-addr}
 [1f5fe737940] {jit-backend-dump
 BACKEND x86_64
 CODE_DUMP @7f8907a0b565 +0  554889E5534154415541564157488DA5000000004C8B3C2590C2540148C7042590C25401000000004C8B342598C2540148C7042598C25401000000004C8B2C25A0C2540148C70425A0C25401000000004C8B2425A8C2540148C70425A8C25401000000004C8B1425D04D5B014C8B0C25B8C2540148C70425B8C25401000000004C8B0425E04D5B01488B3C25E84D5B01488B3425D0C2540148C70425D0C2540100000000488B1C25D8C2540148C70425D8C2540100000000488B1425E0C2540148C70425E0C254010000000049BB38B00C0A897F0000498B0B4883C10149BB38B00C0A897F000049890B4983F8010F85000000004883FE017206813E980700000F85000000004983FA000F850000000049BBA8F0B407897F00004D39DC0F8500000000488B56084881FA102700000F8D000000004989D44883E2024883FA000F85000000004983C403488B1425A0536B024883EA0148891425A0536B024883FA000F8C000000004C89BD70FFFFFF4C89B568FFFFFF4C89AD60FFFFFF4C898D58FFFFFF4D89E749BB5DB4A007897F000041FFE3488B0425A8536B024829E0483B042580DC3C01760D49BB05B3A007897F000041FFD3554889E5534154415541564157488DA550FFFFFF4989FF4989F64989D54989CC4D89C24C8B5D104D89D84C8B5D184C89DF4C8B5D204C89DE4C8B5D284C89DB4C8B5D304C89DAE9CCFEFFFF49BB00B0A007897F000041FFD321383C343029241D180C08030600000049BB00B0A007897F000041FFD3383C18343029240C08030700000049BB00B0A007897F000041FFD329383C3430241808030800000049BB00B0A007897F000041FFD3383C3034241808030900000049BB00B0A007897F000041FFD3383C183424030A00000049BB00B0A007897F000041FFD3383C34241809030B00000049BB00B0A007897F000041FFD3383C34243107030C000000
 [1f5fee2e673] jit-backend-dump}
 [1f5fee2f38d] {jit-backend-addr
-Loop 1 (<code object f, file 'x.py', line 2> #9 LOAD_FAST) has address 7f8907a0b631 to 7f8907a0b6f8 (bootstrap 7f8907a0b565)
+Loop 1 (<code object f, file 'x.py', line 2> #9 LOAD_FAST) has address 0x7f8907a0b631 to 0x7f8907a0b6f8 (bootstrap 0x7f8907a0b565)
 [1f5fee312e3] jit-backend-addr}
 [1f5fee320ed] {jit-backend-dump
 BACKEND x86_64
 CODE_DUMP @7f8907a0b817 +0  554889E5534154415541564157488DA500000000488B042590C2540148C7042590C254010000000048898570FFFFFF488B042598C2540148C7042598C254010000000048898568FFFFFF488B0425A0C2540148C70425A0C254010000000048898560FFFFFF488B0425A8C2540148C70425A8C254010000000048898558FFFFFF4C8B3C25D04D5B0149BB40B00C0A897F00004D8B334983C60149BB40B00C0A897F00004D89334981FF102700000F8D000000004D89FE4983E7024983FF000F85000000004983C6034C8B3C25A0536B024983EF024C893C25A0536B024983FF000F8C000000004D89F7E99AFFFFFF488B0425A8536B024829E0483B042580DC3C01760D49BB05B3A007897F000041FFD3554889E5534154415541564157488DA550FFFFFF4889BD70FFFFFF4889B568FFFFFF48899560FFFFFF48898D58FFFFFF4D89C7E940FFFFFF49BB00B0A007897F000041FFD34440484C3D030D00000049BB00B0A007897F000041FFD34440484C3D39030E00000049BB00B0A007897F000041FFD34440484C390707030F000000
 [1f60076fd90] jit-backend-dump}
 [1f600770f30] {jit-backend-addr
-Loop 2 (<code object f, file 'x.py', line 2> #9 LOAD_FAST) has address 7f8907a0b89f to 7f8907a0b905 (bootstrap 7f8907a0b817)
+Loop 2 (<code object f, file 'x.py', line 2> #9 LOAD_FAST) has address 0x7f8907a0b89f to 0x7f8907a0b905 (bootstrap 0x7f8907a0b817)
 [1f6007730fc] jit-backend-addr}
 [1f600773fde] {jit-backend-dump
 BACKEND x86_64
 CODE_DUMP @7f8907a0b9b7 +0  488DA50000000049BB48B00C0A897F00004D8B3B4983C70149BB48B00C0A897F00004D893B4D89F74983C6010F80000000004C8B3C25A0536B024983EF014C893C25A0536B024983FF000F8C00000000488B0425704F3D01488D5010483B1425784F3D01761A49BB10B2A007897F000041FFD349BB8EB2A007897F000041FFD348C7009807000048891425704F3D014C89700848898550FFFFFF4C8BBD70FFFFFF4C8BB568FFFFFF4C8BAD60FFFFFF49BBA8F0B407897F00004D89DC49C7C2000000004C8B8D58FFFFFF49C7C00100000048C7C709000000488BB550FFFFFF48C7C30000000048C7C20000000049BB31B6A007897F000041FFE349BB00B0A007897F000041FFD3444039484C3D031000000049BB00B0A007897F000041FFD34440484C39070311000000
 [1f60086ba5a] jit-backend-dump}
 [1f60086d36e] {jit-backend-addr
-Bridge out of guard 4 has address 7f8907a0b9b7 to 7f8907a0bab1
+Bridge out of guard 0x4a has address 0x7f8907a0b9b7 to 0x7f8907a0bab1
 [1f60086ffd2] jit-backend-addr}
 [1f600870dca] {jit-backend-dump
 BACKEND x86_64
 [1f600878f4e] jit-backend-dump}
 [1f600884c12] jit-backend}
 [1f60088780a] {jit-log-opt-bridge
-# bridge out of Guard 4 with 16 ops
+# bridge out of Guard 4a with 16 ops
 [p0, p1, p2, p3, i4, i5]
 debug_merge_point(0, '<code object f. file 'x.py'. line 2> #31 LOAD_FAST')
 debug_merge_point(0, '<code object f. file 'x.py'. line 2> #34 LOAD_CONST')

pypy/tool/jitlogparser/test/test_parser.py

     bridge.comment = 'bridge out of Guard af with 1 ops'
     loop.comment = 'Loop 0'
     loops = split_trace(loop) + split_trace(bridge)
-    input = ['grrr:123\nasb:12\nbridge af:1234']
+    input = ['grrr:123\nasb:12\nbridge 175:1234']
     parse_log_counts(input, loops)
     assert loops[-1].count == 1234
     assert loops[1].count == 123

rpython/jit/backend/arm/assembler.py

     operations as regalloc_operations,
     operations_with_guard as regalloc_operations_with_guard)
 from rpython.jit.backend.llsupport import jitframe
-from rpython.jit.backend.llsupport.assembler import DEBUG_COUNTER
+from rpython.jit.backend.llsupport.assembler import DEBUG_COUNTER, debug_bridge
 from rpython.jit.backend.llsupport.asmmemmgr import MachineDataBlockWrapper
 from rpython.jit.backend.model import CompiledLoopToken
 from rpython.jit.codewriter.effectinfo import EffectInfo
         self.update_frame_depth(frame_depth)
         self.teardown()
 
-        debug_start("jit-backend-addr")
-        debug_print("bridge out of Guard %d has address 0x%x to 0x%x" %
-                    (descr_number, r_uint(rawstart),
-                     r_uint(rawstart + codeendpos)))
-        debug_stop("jit-backend-addr")
+        debug_bridge(descr_number, rawstart, codeendpos)
 
         return AsmInfo(ops_offset, startpos + rawstart, codeendpos - startpos)
 

rpython/jit/backend/llsupport/assembler.py

     ConstInt, BoxInt)
 from rpython.jit.metainterp.resoperation import ResOperation, rop
 from rpython.rlib import rgc
-from rpython.rlib.debug import debug_start, debug_stop, have_debug_prints
+from rpython.rlib.debug import (debug_start, debug_stop, have_debug_prints,
+                                debug_print)
 from rpython.rlib.rarithmetic import r_uint
 from rpython.rtyper.annlowlevel import cast_instance_to_gcref
 from rpython.rtyper.lltypesystem import rffi, lltype
                ResOperation(rop.SETFIELD_RAW, [c_adr, box2],
                             None, descr=self.debug_counter_descr)]
         operations.extend(ops)
+
+
+def debug_bridge(descr_number, rawstart, codeendpos):
+    debug_start("jit-backend-addr")
+    debug_print("bridge out of Guard 0x%x has address 0x%x to 0x%x" %
+                (r_uint(descr_number), r_uint(rawstart),
+                    r_uint(rawstart + codeendpos)))
+    debug_stop("jit-backend-addr")
+

rpython/jit/backend/x86/assembler.py

 import os
 
 from rpython.jit.backend.llsupport import symbolic, jitframe
-from rpython.jit.backend.llsupport.assembler import GuardToken, BaseAssembler, DEBUG_COUNTER
+from rpython.jit.backend.llsupport.assembler import (GuardToken, BaseAssembler,
+                                                DEBUG_COUNTER, debug_bridge)
 from rpython.jit.backend.llsupport.asmmemmgr import MachineDataBlockWrapper
 from rpython.jit.backend.llsupport.gcmap import allocate_gcmap
 from rpython.jit.metainterp.history import Const, Box
         rawstart = self.materialize_loop(original_loop_token)
         self.patch_stack_checks(frame_depth_no_fixed_size + JITFRAME_FIXED_SIZE,
                                 rawstart)
-        debug_start("jit-backend-addr")
-        debug_print("bridge out of Guard 0x%x has address 0x%x to 0x%x" %
-                    (r_uint(descr_number), r_uint(rawstart),
-                     r_uint(rawstart + codeendpos)))
-        debug_stop("jit-backend-addr")
+        debug_bridge(descr_number, rawstart, codeendpos)
         self.patch_pending_failure_recoveries(rawstart)
         # patch the jump from original guard
         self.patch_jump_for_descr(faildescr, rawstart)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.