summaryrefslogtreecommitdiffstats
path: root/bsp/meta-freescale/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace/0003-scripts-Tie-Python-2-3-conversion-loose-ends.patch
diff options
context:
space:
mode:
Diffstat (limited to 'bsp/meta-freescale/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace/0003-scripts-Tie-Python-2-3-conversion-loose-ends.patch')
-rw-r--r--bsp/meta-freescale/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace/0003-scripts-Tie-Python-2-3-conversion-loose-ends.patch276
1 files changed, 276 insertions, 0 deletions
diff --git a/bsp/meta-freescale/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace/0003-scripts-Tie-Python-2-3-conversion-loose-ends.patch b/bsp/meta-freescale/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace/0003-scripts-Tie-Python-2-3-conversion-loose-ends.patch
new file mode 100644
index 00000000..e30273d5
--- /dev/null
+++ b/bsp/meta-freescale/recipes-graphics/imx-gpu-apitrace/imx-gpu-apitrace/0003-scripts-Tie-Python-2-3-conversion-loose-ends.patch
@@ -0,0 +1,276 @@
+From 8ba82a1ef77e60bd614cca1e583e1a0c25b4f281 Mon Sep 17 00:00:00 2001
+From: Jose Fonseca <jfonseca@vmware.com>
+Date: Sun, 28 Apr 2019 14:14:44 +0100
+Subject: [PATCH 3/4] scripts: Tie Python 2 -> 3 conversion loose ends.
+
+Upstream-Status: Backport [https://github.com/apitrace/apitrace/commit/247e1fa87f4e87b8914662e44a8ecef4d444cc90]
+
+(cherry picked from commit 247e1fa87f4e87b8914662e44a8ecef4d444cc90)
+Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
+---
+ retrace/glstate_params.py | 2 +-
+ scripts/convert.py | 2 +-
+ scripts/highlight.py | 3 ++-
+ scripts/jsondiff.py | 2 +-
+ scripts/jsonextractimages.py | 2 +-
+ scripts/leaks.py | 4 ++--
+ scripts/profileshader.py | 2 +-
+ scripts/retracediff.py | 2 +-
+ scripts/snapdiff.py | 2 +-
+ scripts/tracecheck.py | 2 +-
+ scripts/tracediff.py | 10 +++++-----
+ scripts/unpickle.py | 19 ++++++++++---------
+ 12 files changed, 27 insertions(+), 25 deletions(-)
+
+diff --git a/retrace/glstate_params.py b/retrace/glstate_params.py
+index bc90f66b..55f2dbc9 100755
+--- a/retrace/glstate_params.py
++++ b/retrace/glstate_params.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ ##########################################################################
+ #
+ # Copyright 2011 Jose Fonseca
+diff --git a/scripts/convert.py b/scripts/convert.py
+index 83df70ce..1f285a8c 100755
+--- a/scripts/convert.py
++++ b/scripts/convert.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ ##########################################################################
+ #
+ # Copyright 2012 VMware Inc.
+diff --git a/scripts/highlight.py b/scripts/highlight.py
+index ed3b54d4..e494abf4 100644
+--- a/scripts/highlight.py
++++ b/scripts/highlight.py
+@@ -221,7 +221,8 @@ def LessHighlighter():
+ try:
+ less = subprocess.Popen(
+ args = ['less', '-FRXn'],
+- stdin = subprocess.PIPE
++ stdin = subprocess.PIPE,
++ universal_newlines = True
+ )
+ except OSError:
+ return ColorHighlighter()
+diff --git a/scripts/jsondiff.py b/scripts/jsondiff.py
+index 25c4840e..d7a18e21 100755
+--- a/scripts/jsondiff.py
++++ b/scripts/jsondiff.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ ##########################################################################
+ #
+ # Copyright 2015 VMware, Inc.
+diff --git a/scripts/jsonextractimages.py b/scripts/jsonextractimages.py
+index 917ee7e4..785e32db 100755
+--- a/scripts/jsonextractimages.py
++++ b/scripts/jsonextractimages.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ ##########################################################################
+ #
+ # Copyright 2012 Jose Fonseca
+diff --git a/scripts/leaks.py b/scripts/leaks.py
+index 325af1e2..706e60a9 100755
+--- a/scripts/leaks.py
++++ b/scripts/leaks.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ ##########################################################################
+ #
+ # Copyright 2014-2016 VMware, Inc.
+@@ -39,7 +39,7 @@ class LeakDetector(unpickle.Unpickler):
+ def __init__(self, apitrace, trace):
+
+ cmd = [apitrace, 'pickle', '--symbolic', trace]
+- p = subprocess.Popen(args = cmd, stdout = subprocess.PIPE)
++ p = subprocess.Popen(args = cmd, stdout=subprocess.PIPE)
+
+ unpickle.Unpickler.__init__(self, p.stdout)
+
+diff --git a/scripts/profileshader.py b/scripts/profileshader.py
+index 5c2a58fb..c6c1c935 100755
+--- a/scripts/profileshader.py
++++ b/scripts/profileshader.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ ##########################################################################
+ #
+ # Copyright 2012-2013 VMware, Inc.
+diff --git a/scripts/retracediff.py b/scripts/retracediff.py
+index 8105f536..967f3a93 100755
+--- a/scripts/retracediff.py
++++ b/scripts/retracediff.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ ##########################################################################
+ #
+ # Copyright 2011 Jose Fonseca
+diff --git a/scripts/snapdiff.py b/scripts/snapdiff.py
+index b0d5f757..58fefe88 100755
+--- a/scripts/snapdiff.py
++++ b/scripts/snapdiff.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ ##########################################################################
+ #
+ # Copyright 2011 Jose Fonseca
+diff --git a/scripts/tracecheck.py b/scripts/tracecheck.py
+index 3a2ec452..38167e89 100755
+--- a/scripts/tracecheck.py
++++ b/scripts/tracecheck.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ ##########################################################################
+ #
+ # Copyright 2011 VMware, Inc.
+diff --git a/scripts/tracediff.py b/scripts/tracediff.py
+index 0cd9c8c6..88e389a3 100755
+--- a/scripts/tracediff.py
++++ b/scripts/tracediff.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ ##########################################################################
+ #
+ # Copyright 2011 Jose Fonseca
+@@ -173,7 +173,7 @@ class ExternalDiffer(Differ):
+ try:
+ less = subprocess.Popen(
+ args = ['less', '-FRXn'],
+- stdin = subprocess.PIPE
++ stdin = subprocess.PIPE,
+ )
+ except OSError:
+ pass
+@@ -214,7 +214,7 @@ ignoredFunctionNames = set([
+
+
+ class Blob:
+- '''Data-less proxy for bytearrays, to save memory.'''
++ '''Data-less proxy for bytes, to save memory.'''
+
+ def __init__(self, size, hash):
+ self.size = size
+@@ -233,7 +233,7 @@ class Blob:
+ class BlobReplacer(Rebuilder):
+ '''Replace blobs with proxys.'''
+
+- def visitByteArray(self, obj):
++ def visitBytes(self, obj):
+ return Blob(len(obj), hash(str(obj)))
+
+ def visitCall(self, call):
+@@ -287,7 +287,7 @@ class PythonDiffer(Differ):
+ '--calls=' + calls,
+ trace
+ ],
+- stdout = subprocess.PIPE,
++ stdout=subprocess.PIPE,
+ )
+
+ parser = Loader(p.stdout)
+diff --git a/scripts/unpickle.py b/scripts/unpickle.py
+index 86891d29..822b8ea8 100755
+--- a/scripts/unpickle.py
++++ b/scripts/unpickle.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ ##########################################################################
+ #
+ # Copyright 2012 Jose Fonseca
+@@ -34,6 +34,7 @@ Run as:
+
+
+ import itertools
++import operator
+ import optparse
+ import sys
+ import time
+@@ -55,7 +56,7 @@ CALL_FLAG_MARKER_PUSH = (1 << 9)
+ CALL_FLAG_MARKER_POP = (1 << 10)
+
+
+-class Pointer(long):
++class Pointer(int):
+
+ def __str__(self):
+ if self == 0:
+@@ -79,7 +80,7 @@ class Visitor:
+ self.dispatch[tuple] = self.visitTuple
+ self.dispatch[list] = self.visitList
+ self.dispatch[dict] = self.visitDict
+- self.dispatch[bytearray] = self.visitByteArray
++ self.dispatch[bytes] = self.visitBytes
+ self.dispatch[Pointer] = self.visitPointer
+
+ def visit(self, obj):
+@@ -119,7 +120,7 @@ class Visitor:
+ def visitDict(self, obj):
+ return self.visitIterable(obj)
+
+- def visitByteArray(self, obj):
++ def visitBytes(self, obj):
+ raise NotImplementedError
+
+ def visitPointer(self, obj):
+@@ -153,7 +154,7 @@ class Dumper(Visitor):
+ def visitDict(self, obj):
+ return '{' + self.visitItems(iter(obj.items())) + '}'
+
+- def visitByteArray(self, obj):
++ def visitBytes(self, obj):
+ return 'blob(%u)' % len(obj)
+
+
+@@ -169,7 +170,7 @@ class Hasher(Visitor):
+ def visitIterable(self, obj):
+ return tuple(map(self.visit, obj))
+
+- def visitByteArray(self, obj):
++ def visitBytes(self, obj):
+ return str(obj)
+
+
+@@ -193,7 +194,7 @@ class Rebuilder(Visitor):
+ else:
+ return obj
+
+- def visitByteArray(self, obj):
++ def visitBytes(self, obj):
+ return obj
+
+
+@@ -269,7 +270,7 @@ class Counter(Unpickler):
+ Unpickler.parse(self)
+
+ functionFrequencies = list(self.functionFrequencies.items())
+- functionFrequencies.sort(lambda (name1, freq1), (name2, freq2): cmp(freq1, freq2))
++ functionFrequencies.sort(key=operator.itemgetter(1))
+ for name, frequency in functionFrequencies:
+ sys.stdout.write('%8u %s\n' % (frequency, name))
+
+@@ -311,7 +312,7 @@ def main():
+ msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY)
+
+ startTime = time.time()
+- parser = Counter(sys.stdin, options.verbose)
++ parser = Counter(sys.stdin.buffer, options.verbose)
+ parser.parse()
+ stopTime = time.time()
+ duration = stopTime - startTime
+--
+2.17.1
+