Author: Armin Rigo <[email protected]>
Branch:
Changeset: r72851:a134c3074fb6
Date: 2014-08-17 18:41 +0200
http://bitbucket.org/pypy/pypy/changeset/a134c3074fb6/
Log: From stmgc-c7: put the "# Loop" and "# bridge" header in more dumped
logs than just the "jit-log-opt" one.
diff --git a/rpython/jit/metainterp/logger.py b/rpython/jit/metainterp/logger.py
--- a/rpython/jit/metainterp/logger.py
+++ b/rpython/jit/metainterp/logger.py
@@ -15,10 +15,14 @@
def log_loop(self, inputargs, operations, number=0, type=None,
ops_offset=None, name=''):
if type is None:
debug_start("jit-log-noopt-loop")
+ debug_print("# Loop", number, '(%s)' % name, ":", "noopt",
+ "with", len(operations), "ops")
logops = self._log_operations(inputargs, operations, ops_offset)
debug_stop("jit-log-noopt-loop")
elif type == "rewritten":
debug_start("jit-log-rewritten-loop")
+ debug_print("# Loop", number, '(%s)' % name, ":", type,
+ "with", len(operations), "ops")
logops = self._log_operations(inputargs, operations, ops_offset)
debug_stop("jit-log-rewritten-loop")
elif number == -2:
@@ -37,12 +41,18 @@
descr=None, ops_offset=None):
if extra == "noopt":
debug_start("jit-log-noopt-bridge")
+ debug_print("# bridge out of Guard",
+ "0x%x" % compute_unique_id(descr),
+ "with", len(operations), "ops")
logops = self._log_operations(inputargs, operations, ops_offset)
debug_stop("jit-log-noopt-bridge")
elif extra == "rewritten":
debug_start("jit-log-rewritten-bridge")
+ debug_print("# bridge out of Guard",
+ "0x%x" % compute_unique_id(descr),
+ "with", len(operations), "ops")
logops = self._log_operations(inputargs, operations, ops_offset)
- debug_stop("jit-log-rewritten-bridge")
+ debug_stop("jit-log-rewritten-bridge")
elif extra == "compiling":
debug_start("jit-log-compiling-bridge")
logops = self._log_operations(inputargs, operations, ops_offset)
diff --git a/rpython/jit/metainterp/test/test_logger.py
b/rpython/jit/metainterp/test/test_logger.py
--- a/rpython/jit/metainterp/test/test_logger.py
+++ b/rpython/jit/metainterp/test/test_logger.py
@@ -32,10 +32,11 @@
return log_stream.getvalue()
class Logger(logger.Logger):
- def log_loop(self, loop, namespace={}, ops_offset=None):
+ def log_loop(self, loop, namespace={}, ops_offset=None, name=''):
self.namespace = namespace
return capturing(logger.Logger.log_loop, self,
- loop.inputargs, loop.operations,
ops_offset=ops_offset)
+ loop.inputargs, loop.operations,
ops_offset=ops_offset,
+ name=name)
def _make_log_operations(self1):
class LogOperations(logger.LogOperations):
@@ -230,8 +231,9 @@
None: 40
}
logger = Logger(self.make_metainterp_sd())
- output = logger.log_loop(loop, ops_offset=ops_offset)
+ output = logger.log_loop(loop, ops_offset=ops_offset, name="foo")
assert output.strip() == """
+# Loop 0 (foo) : noopt with 3 ops
[i0]
+10: i2 = int_add(i0, 1)
i4 = int_mul(i2, 2)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit