Re: [PATCH v6 24/59] perf python: Move exported-sql-viewer.py and parallel-perf.py to tools/perf/python/

sashiko-bot
2026-04-25T18:07:07Z

Sashiko AI review found 2 potential issue(s):
- [High] Moving exported-sql-viewer.py breaks its dependency on libxed.py, resulting in a fatal ImportError.
- [High] The moved standalone Python scripts are no longer installed during `make install`.
--

commit 0db10728d07bb97e6548935001d81b9e0657485c
Author: Ian Rogers <irogers@google.com>

perf python: Move exported-sql-viewer.py and parallel-perf.py to tools/perf/python/

This commit moves standalone Python scripts to tools/perf/python. It is
part of an effort to deprecate the tools/perf/scripts/python support.

> 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

Will this rename cause an ImportError when executing exported-sql-viewer.py?

The script contains the import "from libxed import LibXED", but libxed.py
remains in tools/perf/scripts/python/ in this patch. Because the old scripts
directory is no longer in the default path, the execution will fail.

This regression is fixed later in the series by the commit
"perf intel-pt-events: Port intel-pt-events/libxed to use python module".

Also, does moving these scripts cause them to be dropped during make install?

The installation rule in tools/perf/Makefile.perf targets
scripts/python/*.py. Since the scripts are moved without updating the
Makefile in the same patch, they are silently dropped from the final
installation.

This installation regression is fixed later in the series by the commits
"perf: Remove libpython support and legacy Python scripts" and
"perf Makefile: Update Python script installation path".

[ ... ]
> 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
[ ... ]
> @@ -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

Because parallel-perf.py is dropped from the installation, does this skip
condition gracefully abort the test and silently mask the missing script
regression in installed testing environments?

--
Sashiko AI review · https://sashiko.dev/#/patchset/20260425174858.3922152-1-irogers@google.com?part=24