summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.com>2025-07-31 22:36:25 +0200
committerJiri Kosina <jkosina@suse.com>2025-07-31 22:36:25 +0200
commite9ef810dfee7a2227da9d423aecb0ced35faddbe (patch)
tree52befbbbeacbd9340f90884dee840be3f492d3e1 /tools/perf/scripts/python
parent3a1d22bd85381c4e358fc3340e776c3a3223a1d0 (diff)
parent3a807f3ff9eaaeead81576c5a72d226d519a2fe7 (diff)
Merge branch 'for-6.17/amd-sfh' into for-linus
- add support for operating modes (Basavaraj Natikar)
Diffstat (limited to 'tools/perf/scripts/python')
-rwxr-xr-xtools/perf/scripts/python/exported-sql-viewer.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/perf/scripts/python/exported-sql-viewer.py b/tools/perf/scripts/python/exported-sql-viewer.py
index 121cf61ba1b3..e0b2e7268ef6 100755
--- a/tools/perf/scripts/python/exported-sql-viewer.py
+++ b/tools/perf/scripts/python/exported-sql-viewer.py
@@ -680,7 +680,10 @@ class CallGraphModelBase(TreeModel):
s = value.replace("%", "\\%")
s = s.replace("_", "\\_")
# Translate * and ? into SQL LIKE pattern characters % and _
- trans = string.maketrans("*?", "%_")
+ if sys.version_info[0] == 3:
+ trans = str.maketrans("*?", "%_")
+ else:
+ trans = string.maketrans("*?", "%_")
match = " LIKE '" + str(s).translate(trans) + "'"
else:
match = " GLOB '" + str(value) + "'"