Author: Anton Gulenko <[email protected]>
Branch: storage
Changeset: r723:7c6f695323c6
Date: 2014-03-29 19:10 +0100
http://bitbucket.org/pypy/lang-smalltalk/changeset/7c6f695323c6/

Log:    Added a debug-folder generated by the extract_loops.py script, which
        keeps the debug_* operations.

diff --git a/spyvm/tool/extract_loops.py b/spyvm/tool/extract_loops.py
--- a/spyvm/tool/extract_loops.py
+++ b/spyvm/tool/extract_loops.py
@@ -6,21 +6,26 @@
         print "Need pypy log-file as parameter."
         return 1
     logfile = argv[0]
-    traces = logparser.extract_traces(logfile, remove_main_labels=False)
     
     tracedir = logfile + "_traces"
+    traces = logparser.extract_traces(logfile, remove_main_labels=False)
+    print_traces(traces, tracedir)
+    traces = logparser.extract_traces(logfile, remove_debug=False, 
remove_main_labels=False)
+    print_traces(traces, os.path.join(tracedir, "debug"))
+    
+def print_traces(traces, tracedir):
     if os.path.exists(tracedir):
         shutil.rmtree(tracedir)
     os.mkdir(tracedir)
     
     for i, trace in enumerate(traces):
         basename = os.path.join(tracedir, "loop_" + str(i))
-        print_trace(trace.loop, basename + '_main')
-        print_trace(trace.setup, basename + '_setup')
+        print_trace_part(trace.loop, basename + '_main')
+        print_trace_part(trace.setup, basename + '_setup')
         for bridge_num, bridge in enumerate(trace.bridges):
-            print_trace(bridge, basename + "_bridge_" + str(bridge_num))
+            print_trace_part(bridge, basename + "_bridge_" + str(bridge_num))
     
-def print_trace(trace, filename):
+def print_trace_part(trace, filename):
     if trace:
         file = open(filename, 'w')
         for t in trace:
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to