summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/exported-sql-viewer.py
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2024-01-22 19:23:56 -0800
committerAndrew Morton <akpm@linux-foundation.org>2024-01-22 19:23:56 -0800
commitf0b7a0d1d46625db5b0e631c05ae96d78eda6c70 (patch)
tree44dde92e4dbd16f25c7ce50240bf53a7b753e7ad /tools/perf/scripts/python/exported-sql-viewer.py
parent5aa1c96e8ef347430e7a7c898f290425d1b568ef (diff)
parent6613476e225e090cc9aad49be7fa504e290dd33d (diff)
Merge branch 'master' into mm-hotfixes-stable
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
-rwxr-xr-xtools/perf/scripts/python/exported-sql-viewer.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/scripts/python/exported-sql-viewer.py b/tools/perf/scripts/python/exported-sql-viewer.py
index 13f2d8a81610..121cf61ba1b3 100755
--- a/tools/perf/scripts/python/exported-sql-viewer.py
+++ b/tools/perf/scripts/python/exported-sql-viewer.py
@@ -677,8 +677,8 @@ class CallGraphModelBase(TreeModel):
# sqlite supports GLOB (text only) which uses * and ? and is case sensitive
if not self.glb.dbref.is_sqlite3:
# Escape % and _
- s = value.replace("%", "\%")
- s = s.replace("_", "\_")
+ s = value.replace("%", "\\%")
+ s = s.replace("_", "\\_")
# Translate * and ? into SQL LIKE pattern characters % and _
trans = string.maketrans("*?", "%_")
match = " LIKE '" + str(s).translate(trans) + "'"