summaryrefslogtreecommitdiff
path: root/src/gallium/tools/trace/dump_state.py
diff options
context:
space:
mode:
authorMatti Hamalainen <ccr@tnsp.org>2021-04-20 15:32:20 +0300
committerMarge Bot <eric+marge@anholt.net>2021-05-07 15:48:03 +0000
commitd730c18bdbefec3a361da467167099b01f8f5cd5 (patch)
tree16a701352a2fc0f34dcaaebc924acb6d0ee77c8a /src/gallium/tools/trace/dump_state.py
parent054b2afcb9344cab346c8d53ae8909f1acd07319 (diff)
gallium/tools: implement 'named' pointers option in dump.py
As suggested by zmike in issue #4609, raw pointer values in are problematic for diffing state dumps. In attempt to remedy this, we implement an option --named/-N in dump.py that generates symbolic names for all pointers based on the context. Signed-off-by: Matti Hamalainen <ccr@tnsp.org> Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10648>
Diffstat (limited to 'src/gallium/tools/trace/dump_state.py')
-rwxr-xr-xsrc/gallium/tools/trace/dump_state.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gallium/tools/trace/dump_state.py b/src/gallium/tools/trace/dump_state.py
index b23a929e265..5683034a14d 100755
--- a/src/gallium/tools/trace/dump_state.py
+++ b/src/gallium/tools/trace/dump_state.py
@@ -36,6 +36,7 @@ import copy
import argparse
import model
+import format
import parse as parser
@@ -706,7 +707,7 @@ class Context(Dispatcher):
return so_target
-class Interpreter(parser.TraceParser):
+class Interpreter(parser.SimpleTraceDumper):
'''Specialization of a trace parser that interprets the calls as it goes
along.'''
@@ -722,9 +723,8 @@ class Interpreter(parser.TraceParser):
('pipe_context', 'flush_resource'),
))
- def __init__(self, stream, options):
- parser.TraceParser.__init__(self, stream)
- self.options = options
+ def __init__(self, stream, options, formatter):
+ parser.SimpleTraceDumper.__init__(self, stream, options, formatter)
self.objects = {}
self.result = None
self.globl = Global(self)
@@ -805,7 +805,8 @@ class Main(parser.Main):
return optparser
def process_arg(self, stream, options):
- parser = Interpreter(stream, options)
+ formatter = format.Formatter(sys.stderr)
+ parser = Interpreter(stream, options, formatter)
parser.parse()