[pypy-svn] r79266 - in pypy/branch/jit-free/pypy/jit: metainterp tool tool/test
arigo at codespeak.net
arigo at codespeak.net
Thu Nov 18 18:47:23 CET 2010
Author: arigo
Date: Thu Nov 18 18:47:21 2010
New Revision: 79266
Modified:
pypy/branch/jit-free/pypy/jit/metainterp/jitprof.py
pypy/branch/jit-free/pypy/jit/metainterp/pyjitpl.py
pypy/branch/jit-free/pypy/jit/tool/jitoutput.py
pypy/branch/jit-free/pypy/jit/tool/test/test_jitoutput.py
Log:
Print the cpu.total_{compiled,freed}_{loops,bridges} at the end too.
Modified: pypy/branch/jit-free/pypy/jit/metainterp/jitprof.py
==============================================================================
--- pypy/branch/jit-free/pypy/jit/metainterp/jitprof.py (original)
+++ pypy/branch/jit-free/pypy/jit/metainterp/jitprof.py Thu Nov 18 18:47:21 2010
@@ -24,6 +24,10 @@
NVIRTUALS
NVHOLES
NVREUSED
+TOTAL_COMPILED_LOOPS
+TOTAL_COMPILED_BRIDGES
+TOTAL_FREED_LOOPS
+TOTAL_FREED_BRIDGES
"""
def _setup():
@@ -91,6 +95,7 @@
calls = 0
current = None
printing = True
+ cpu = None
def start(self):
self.starttime = self.timer()
@@ -176,6 +181,16 @@
self._print_intline("nvirtuals", cnt[NVIRTUALS])
self._print_intline("nvholes", cnt[NVHOLES])
self._print_intline("nvreused", cnt[NVREUSED])
+ cpu = self.cpu
+ if cpu is not None: # for some tests
+ self._print_intline("Total # of loops",
+ cpu.total_compiled_loops)
+ self._print_intline("Total # of bridges",
+ cpu.total_compiled_bridges)
+ self._print_intline("Freed # of loops",
+ cpu.total_freed_loops)
+ self._print_intline("Freed # of bridges",
+ cpu.total_freed_bridges)
def _print_line_time(self, string, i, tim):
final = "%s:%s\t%d\t%f\n" % (string, " " * max(0, 13-len(string)), i, tim)
Modified: pypy/branch/jit-free/pypy/jit/metainterp/pyjitpl.py
==============================================================================
--- pypy/branch/jit-free/pypy/jit/metainterp/pyjitpl.py (original)
+++ pypy/branch/jit-free/pypy/jit/metainterp/pyjitpl.py Thu Nov 18 18:47:21 2010
@@ -1206,6 +1206,7 @@
self.logger_ops = Logger(self, guard_number=True)
self.profiler = ProfilerClass()
+ self.profiler.cpu = cpu
self.warmrunnerdesc = warmrunnerdesc
backendmodule = self.cpu.__module__
Modified: pypy/branch/jit-free/pypy/jit/tool/jitoutput.py
==============================================================================
--- pypy/branch/jit-free/pypy/jit/tool/jitoutput.py (original)
+++ pypy/branch/jit-free/pypy/jit/tool/jitoutput.py Thu Nov 18 18:47:21 2010
@@ -27,6 +27,10 @@
(('nvirtuals',), '^nvirtuals:\s+(\d+)$'),
(('nvholes',), '^nvholes:\s+(\d+)$'),
(('nvreused',), '^nvreused:\s+(\d+)$'),
+ (('total_compiled_loops',), '^Total # of loops:\s+(\d+)$'),
+ (('total_compiled_bridges',), '^Total # of bridges:\s+(\d+)$'),
+ (('total_freed_loops',), '^Freed # of loops:\s+(\d+)$'),
+ (('total_freed_bridges',), '^Freed # of bridges:\s+(\d+)$'),
]
class Ops(object):
Modified: pypy/branch/jit-free/pypy/jit/tool/test/test_jitoutput.py
==============================================================================
--- pypy/branch/jit-free/pypy/jit/tool/test/test_jitoutput.py (original)
+++ pypy/branch/jit-free/pypy/jit/tool/test/test_jitoutput.py Thu Nov 18 18:47:21 2010
@@ -60,6 +60,10 @@
nvirtuals: 13
nvholes: 14
nvreused: 15
+Total # of loops: 100
+Total # of bridges: 300
+Freed # of loops: 99
+Freed # of bridges: 299
'''
def test_parse():
More information about the Pypy-commit
mailing list