summaryrefslogtreecommitdiff
path: root/src/gallium/tools/trace/model.py
diff options
context:
space:
mode:
authorMatti Hamalainen <ccr@tnsp.org>2021-03-25 14:36:54 +0200
committerMarge Bot <eric+marge@anholt.net>2021-04-10 14:00:45 +0000
commit44ed8378bf69fc3762e114eb3b1985daa6566e28 (patch)
treeb718361883dc76a8d3373576d0065d35b2dcd74e /src/gallium/tools/trace/model.py
parente7bece080f45580e387a4dcbd5f0e79979277ce4 (diff)
gallium/tools: update trace scripts to Python 3
Bring the scripts for parsing, dumping state and diffing of Gallium trace files to modern day by updating them to Python 3. Add option '-p' to some tools for outputting only plaintext instead of ANSI / colorized format. Also fix state parsing of some dumps by adding 'clear_render_target' and 'get_disk_shader_cache' to ignored calls list. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4321 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/9830>
Diffstat (limited to 'src/gallium/tools/trace/model.py')
-rwxr-xr-xsrc/gallium/tools/trace/model.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/gallium/tools/trace/model.py b/src/gallium/tools/trace/model.py
index 6a421847113..913a4ef13d2 100755
--- a/src/gallium/tools/trace/model.py
+++ b/src/gallium/tools/trace/model.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python3
##########################################################################
#
# Copyright 2008 VMware, Inc.
@@ -33,12 +33,7 @@
import sys
import string
import binascii
-
-try:
- from cStringIO import StringIO
-except ImportError:
- from StringIO import StringIO
-
+from io import StringIO
import format
@@ -177,7 +172,7 @@ class PrettyPrinter:
self.formatter.literal('NULL')
return
- if isinstance(node.value, basestring):
+ if isinstance(node.value, str):
self.formatter.literal('"' + node.value + '"')
return