[pypy-commit] pypy bridge-logging: start integration test of jitlogparser on actual pypy run

kostialopuhin noreply at buildbot.pypy.org
Fri Mar 29 06:02:14 CET 2013


Author: Konstantin Lopuhin <kostia.lopuhin at gmail.com>
Branch: bridge-logging
Changeset: r62867:a4a0613420c4
Date: 2013-03-27 19:39 +0100
http://bitbucket.org/pypy/pypy/changeset/a4a0613420c4/

Log:	start integration test of jitlogparser on actual pypy run

diff --git a/pypy/tool/jitlogparser/test/test_parser.py b/pypy/tool/jitlogparser/test/test_parser.py
--- a/pypy/tool/jitlogparser/test/test_parser.py
+++ b/pypy/tool/jitlogparser/test/test_parser.py
@@ -1,3 +1,8 @@
+import re
+import os.path
+import tempfile
+import subprocess
+
 from pypy.tool.jitlogparser.parser import (SimpleParser, TraceForOpcode,
                                            Function, adjust_bridges,
                                            import_log, split_trace, Op,
@@ -5,6 +10,8 @@
 from pypy.tool.jitlogparser.storage import LoopStorage
 import py, sys
 from rpython.jit.backend.detect_cpu import autodetect_main_model
+from rpython.tool.logparser import extract_category
+
 
 def parse(input, **kwds):
     return SimpleParser.parse_from_input(input, **kwds)
@@ -372,3 +379,21 @@
     f = Function.from_operations(loop.operations, LoopStorage())
     assert len(f.chunks) == 2
     
+def test_import_log_on_pypy():
+    ''' Test import_log and parse_log_counts on a log from actual pypy run
+    '''
+    log_filename = tempfile.mktemp()
+    pypy = '/Users/kostia/programming/pypy/pypy-c' # FIXME
+    subprocess.check_call([pypy, 
+        os.path.join(os.path.dirname(__file__), 'y.py')],
+        env={'PYPYLOG': 'jit-log-opt,jit-backend:%s' % log_filename})
+    log, loops = import_log(log_filename)
+    parse_log_counts(extract_category(log, 'jit-backend-count'), loops)
+    for loop in loops:
+        loop.force_asm()
+        if re.search("file '.*lib-python.*'", loop.comment):
+            # do not care for _optimize_charset or _mk_bitmap
+            continue
+        else:
+            import pdb; pdb.set_trace()
+


More information about the pypy-commit mailing list