Skip to content

perf build: Fix pylint build failures

Leo Yan linux-perf-users lkml 2 versions Applied

Status from this message: Thanks, applied patches 1-2 and 4, waiting for the suggestion from Ian

Get series with b4
b4 am [email protected] change-id 20260930-perf_fix_pylint_errors-3cef583b1e47

Versions newest first

  1. v2 Latest4 patches 6 repliesApplied
  2. v13 patches 1 replySuperseded

Changes in v2 from the cover letter

- Run pylint after the Python extension without delaying C builds
(Sashiko).
- Fix the PostgreSQL warning.
- Link to v1: https://lore.kernel.org/r/[email protected]

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/4perf build: Build the Python extension before pylint consumerstools/perf/Build tools/perf/Makefile.perf tools/perf/tests/Build+21 -21 reply
2/4perf build: Add the output Python directory to pylint's PYTHONPATHtools/perf/Makefile.perf+1 -11 reply
3/4perf test: Suppress optparse deprecation warning with older pylinttools/perf/tests/shell/lib/attr.py+2 -12 replies
4/4perf python: Avoid shadowing exception name in PostgreSQL exportertools/perf/python/export-to-postgresql.py+2 -21 reply

Reviews trailers per patch

3 of 4 patches have a Reviewed-by or Acked-by.

PatchIan Rogers
1/4R-b
2/4R-b
3/4
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/4] perf build: Fix pylint build failures

Recent changes to perf's Python module, including enabling pylint by default, exposed build failures in our CI. For example:

tests/shell/lib/perf_brstack_max.py:8:0: E0401: Unable to import 'perf' (import-error)

This series builds the perf Python extension before running pylint on its consumers without delaying C builds. It also prepends the output Python directory to PYTHONPATH for out-of-tree builds.

The series also mutes the optparse deprecation warning from older pylint versions. Python has reversed this deprecation, and newer pylint versions no longer report it.

A final patch renames an exception variable in the PostgreSQL exporter to fix pylint warning.

Tested on an x86 Intel Xeon(R) w7-3465X (28 cores, 56 threads), the average real build time over three runs was 20.104s for v1 and 18.998s for v2, about 1.1s (5.5%) faster.

---
Changes in v2:
- Run pylint after the Python extension without delaying C builds
(Sashiko).
- Fix the PostgreSQL warning.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Leo Yan (4):
perf build: Build the Python extension before pylint consumers perf build: Add the output Python directory to pylint's PYTHONPATH perf test: Suppress optparse deprecation warning with older pylint perf python: Avoid shadowing exception name in PostgreSQL exporter

 tools/perf/Build                          |  4 +++-
 tools/perf/Makefile.perf                  | 17 ++++++++++++++++-
 tools/perf/python/export-to-postgresql.py |  4 ++--
 tools/perf/tests/Build                    |  4 +++-
 tools/perf/tests/shell/lib/attr.py        |  3 ++-
 5 files changed, 26 insertions(+), 6 deletions(-)

---
base-commit: 45d15e89a783a0a279b7a54f9018c230127380d7
change-id: 20260930-perf_fix_pylint_errors-3cef583b1e47

Best regards,

Signature · 1 line
Leo Yan <[email protected]>