[PATCH v6 24/59] perf python: Move exported-sql-viewer.py and parallel-perf.py to tools/perf/python/
Ian Rogers
irogers at google.com
Sat Apr 25 10:48:22 PDT 2026
These scripts are standalone and not using the `perf script` libpython
support. Move to tools/perf/python in an effort to deprecate the
tools/perf/scripts/python support.
Signed-off-by: Ian Rogers <irogers at google.com>
---
v2:
1. Updated exported-sql-viewer.py : I updated the comments at the top
of the script to use the new path
tools/perf/python/exported-sql-viewer.py in the usage examples.
2. Fixed Test Path in script.sh : I updated the path in
tools/perf/tests/shell/script.sh to point to the new location of
parallel-perf.py at ../../python/parallel-perf.py .
v5:
1. Fix Test 105 Failure: Added a shebang line and marked the generated
`db_test.py` script as executable in `script.sh`, preventing
permission denied errors during standalone execution.
---
tools/perf/{scripts => }/python/exported-sql-viewer.py | 4 ++--
tools/perf/{scripts => }/python/parallel-perf.py | 0
tools/perf/tests/shell/script.sh | 4 +++-
3 files changed, 5 insertions(+), 3 deletions(-)
rename tools/perf/{scripts => }/python/exported-sql-viewer.py (99%)
rename tools/perf/{scripts => }/python/parallel-perf.py (100%)
diff --git a/tools/perf/scripts/python/exported-sql-viewer.py b/tools/perf/python/exported-sql-viewer.py
similarity index 99%
rename from tools/perf/scripts/python/exported-sql-viewer.py
rename to tools/perf/python/exported-sql-viewer.py
index e0b2e7268ef6..f3ac96ada1f5 100755
--- a/tools/perf/scripts/python/exported-sql-viewer.py
+++ b/tools/perf/python/exported-sql-viewer.py
@@ -10,12 +10,12 @@
# Following on from the example in the export scripts, a
# call-graph can be displayed for the pt_example database like this:
#
-# python tools/perf/scripts/python/exported-sql-viewer.py pt_example
+# python tools/perf/python/exported-sql-viewer.py pt_example
#
# Note that for PostgreSQL, this script supports connecting to remote databases
# by setting hostname, port, username, password, and dbname e.g.
#
-# python tools/perf/scripts/python/exported-sql-viewer.py "hostname=myhost username=myuser password=mypassword dbname=pt_example"
+# python tools/perf/python/exported-sql-viewer.py "hostname=myhost username=myuser password=mypassword dbname=pt_example"
#
# The result is a GUI window with a tree representing a context-sensitive
# call-graph. Expanding a couple of levels of the tree and adjusting column
diff --git a/tools/perf/scripts/python/parallel-perf.py b/tools/perf/python/parallel-perf.py
similarity index 100%
rename from tools/perf/scripts/python/parallel-perf.py
rename to tools/perf/python/parallel-perf.py
diff --git a/tools/perf/tests/shell/script.sh b/tools/perf/tests/shell/script.sh
index 7007f1cdf761..f983b80e77b7 100755
--- a/tools/perf/tests/shell/script.sh
+++ b/tools/perf/tests/shell/script.sh
@@ -43,6 +43,7 @@ test_db()
fi
cat << "_end_of_file_" > "${db_test}"
+#!/usr/bin/env python3
perf_db_export_mode = True
perf_db_export_calls = False
perf_db_export_callchains = True
@@ -53,6 +54,7 @@ def sample_table(*args):
def call_path_table(*args):
print(f'call_path_table({args}')
_end_of_file_
+ chmod +x "${db_test}"
case $(uname -m)
in s390x)
cmd_flags="--call-graph dwarf -e cpu-clock";;
@@ -76,7 +78,7 @@ test_parallel_perf()
err=2
return
fi
- pp=$(dirname "$0")/../../scripts/python/parallel-perf.py
+ pp=$(dirname "$0")/../../python/parallel-perf.py
if [ ! -f "${pp}" ] ; then
echo "SKIP: parallel-perf.py script not found "
err=2
--
2.54.0.545.g6539524ca2-goog
More information about the linux-arm-kernel
mailing list