Mesa (gallium-0.1): python/retrace: Use the call no when dumping images.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Mon May 18 15:08:03 UTC 2009


Module: Mesa
Branch: gallium-0.1
Commit: c3b1a94bf61e969a3c36893e5062f72145279f81
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c3b1a94bf61e969a3c36893e5062f72145279f81

Author: José Fonseca <jfonseca at vmware.com>
Date:   Wed Mar 25 14:02:49 2009 +0000

python/retrace: Use the call no when dumping images.

To make it easy associate images with the calls.

---

 .../state_trackers/python/retrace/interpreter.py   |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/gallium/state_trackers/python/retrace/interpreter.py b/src/gallium/state_trackers/python/retrace/interpreter.py
index 7397b7e..7a87d6b 100755
--- a/src/gallium/state_trackers/python/retrace/interpreter.py
+++ b/src/gallium/state_trackers/python/retrace/interpreter.py
@@ -555,7 +555,7 @@ class Interpreter(parser.TraceDumper):
         self.objects = {}
         self.result = None
         self.globl = Global(self, None)
-        self.image_no = 0
+        self.call_no = None
 
     def register_object(self, address, object):
         self.objects[address] = object
@@ -576,6 +576,8 @@ class Interpreter(parser.TraceDumper):
         if (call.klass, call.method) in self.ignore_calls:
             return
 
+        self.call_no = call.no
+
         if self.verbosity(1):
             parser.TraceDumper.handle_call(self, call)
         
@@ -593,6 +595,8 @@ class Interpreter(parser.TraceDumper):
         if call.ret and isinstance(call.ret, model.Pointer):
             self.register_object(call.ret.address, ret)
 
+        self.call_no = None
+
     def interpret_arg(self, node):
         translator = Translator(self)
         return translator.visit(node)
@@ -602,8 +606,7 @@ class Interpreter(parser.TraceDumper):
 
     def present(self, surface, description):
         if self.options.images:
-            self.image_no += 1
-            filename = '%s_%04u.png' % (description, self.image_no)
+            filename = '%s_%04u.png' % (description, self.call_no)
             save_image(filename, surface)
         else:
             show_image(surface)




More information about the mesa-commit mailing list