summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2009-04-08 16:25:29 +0100
committerJosé Fonseca <jfonseca@vmware.com>2009-05-24 18:12:07 -0700
commit12c714e3b5c1426e8cd7ebfc4821a575868491f6 (patch)
treeaf47f04c3eedc32a1392fadb01ffc3b2c8afd9ee /src
parent65b82755c1323422b7e0fe47af179fa55a7e5ede (diff)
python/retrace: Allow to specify the range of calls of interest.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/gallium/state_trackers/python/retrace/interpreter.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/python/retrace/interpreter.py b/src/gallium/state_trackers/python/retrace/interpreter.py
index a22314d2000..c2bfacc68f7 100755
--- a/src/gallium/state_trackers/python/retrace/interpreter.py
+++ b/src/gallium/state_trackers/python/retrace/interpreter.py
@@ -572,6 +572,8 @@ class Interpreter(parser.TraceDumper):
self.interpret_call(call)
def handle_call(self, call):
+ if self.options.stop and call.no >= self.options.stop:
+ sys.exit(0)
if (call.klass, call.method) in self.ignore_calls:
return
@@ -605,6 +607,9 @@ class Interpreter(parser.TraceDumper):
return self.options.verbosity >= level
def present(self, surface, description):
+ if self.call_no < self.options.start:
+ return
+
if self.options.images:
filename = '%s_%04u.png' % (description, self.call_no)
save_image(filename, surface)
@@ -621,6 +626,8 @@ class Main(parser.Main):
optparser.add_option("-v", "--verbose", action="count", dest="verbosity", default=1, help="increase verbosity level")
optparser.add_option("-i", "--images", action="store_true", dest="images", default=False, help="save images instead of showing them")
optparser.add_option("-s", "--step", action="store_true", dest="step", default=False, help="step trhough every draw")
+ optparser.add_option("-f", "--from", action="store", type="int", dest="start", default=0, help="from call no")
+ optparser.add_option("-t", "--to", action="store", type="int", dest="stop", default=0, help="until call no")
return optparser
def process_arg(self, stream, options):