[pypy-svn] r72148 - in pypy/trunk/pypy/jit/tool: . test

fijal at codespeak.net fijal at codespeak.net
Fri Mar 12 02:04:11 CET 2010


Author: fijal
Date: Fri Mar 12 02:04:10 2010
New Revision: 72148

Added:
   pypy/trunk/pypy/jit/tool/test/test_traceviewer.py
      - copied, changed from r72128, pypy/trunk/pypy/jit/tool/test/test_otherviewer.py
   pypy/trunk/pypy/jit/tool/traceviewer.py
      - copied, changed from r72141, pypy/trunk/pypy/jit/tool/otherviewer.py
Removed:
   pypy/trunk/pypy/jit/tool/otherviewer.py
   pypy/trunk/pypy/jit/tool/test/test_otherviewer.py
Log:
Rename otherviewer->traceviewer


Copied: pypy/trunk/pypy/jit/tool/test/test_traceviewer.py (from r72128, pypy/trunk/pypy/jit/tool/test/test_otherviewer.py)
==============================================================================
--- pypy/trunk/pypy/jit/tool/test/test_otherviewer.py	(original)
+++ pypy/trunk/pypy/jit/tool/test/test_traceviewer.py	Fri Mar 12 02:04:10 2010
@@ -1,6 +1,6 @@
 import math
 import py
-from pypy.jit.tool.otherviewer import splitloops, FinalBlock, Block,\
+from pypy.jit.tool.traceviewer import splitloops, FinalBlock, Block,\
      split_one_loop, postprocess, main, get_gradient_color
 
 

Copied: pypy/trunk/pypy/jit/tool/traceviewer.py (from r72141, pypy/trunk/pypy/jit/tool/otherviewer.py)
==============================================================================
--- pypy/trunk/pypy/jit/tool/otherviewer.py	(original)
+++ pypy/trunk/pypy/jit/tool/traceviewer.py	Fri Mar 12 02:04:10 2010
@@ -16,7 +16,23 @@
 class SubPage(GraphPage):
     def compute(self, graph):
         dotgen = DotGen(str(graph.no))
-        dotgen.emit_node(graph.name(), shape="box", label=graph.content)
+        # split over debug_merge_points
+        counter = 0
+        lines = graph.content.split("\n")
+        lines_so_far = []
+        for line in lines:
+            line = re.sub('.\[.*\]', '', line)
+            if 'debug_merge_point' in line:
+                dotgen.emit_node('node%d' % counter, shape="box",
+                                 label="\n".join(lines_so_far))
+                if counter != 0:
+                    dotgen.emit_edge('node%d' % (counter - 1), 'node%d' % counter)
+                counter += 1
+                lines_so_far = []
+            lines_so_far.append(line)
+        dotgen.emit_node('node%d' % counter, shape="box",
+                         label="\n".join(lines_so_far))
+        dotgen.emit_edge('node%d' % (counter - 1), 'node%d' % counter)
         self.source = dotgen.generate(target=None)
 
 class Page(GraphPage):
@@ -225,12 +241,7 @@
     else:
         loop.ratio = float(opsno) / bcodes
     content = loop.content
-    lines = content.split("\n")
-    if len(lines) > LINE_CUTOFF:
-        lines = lines[:LINE_CUTOFF] + ["%d more lines..." % (len(lines) - LINE_CUTOFF)]
-    for i, line in enumerate(lines):
-        lines[i] = re.sub("\[.*\]", "", line)
-    loop.content = "Logfile at %d\n" % loop.startlineno + "\n".join(lines)
+    loop.content = "Logfile at %d\n" % loop.startlineno + content
     loop.postprocess(loops, memo)
 
 def postprocess(loops, allloops):



More information about the Pypy-commit mailing list