[SRU][O][N][PATCH v2 0/3] python perf module missing in realtime kernel (LP: #2089411)

Juerg Haefliger juerg.haefliger at canonical.com
Thu Jan 23 16:06:32 UTC 2025


BugLink: https://bugs.launchpad.net/bugs/2089411

[Impact]

ubuntu at ubuntu-plucky:~$ python3 -c 'import perf; [print(c) for c in perf.cpu_map()]'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/perf/__init__.py", line 24, in <module>
    raise KernelNotFoundError()
perf.KernelNotFoundError: WARNING: python perf module not found for kernel 6.12.0-4-generic

You may need to install the following packages for this specific kernel:
  linux-tools-6.12.0-4-generic-generic
You may also want to install of the following package to keep up to date:
  linux-tools-generic

This works only with the main generic kernel but not with any of the derivatives. Packaging is
broken and the perf python modules is looking in the wrong place for the library.

[Test Plan]

Run:
$ python3 -c 'import perf; [print(c) for c in perf.cpu_map()]'
$ perf

The above must not result in errors.

[Where Problems Could Occur]

Potential issues when using the perf python module or any scripts/binaries provided by the
linux-tools packages.

v1->v2:
  - Link the lib subdirectory rather than its parent
  - Add fall-back to old perf python path


Juerg Haefliger (3):
  UBUNTU: [Packaging] linux-tools: Add missing python perf symlink
  UBUNTU: [Packaging] linux-tools: Fix python perf library packaging
  UBUNTU: [Packaging] linux-tools: Fall back to old python perf path

 debian/rules.d/2-binary-arch.mk  |  9 +++++++--
 debian/rules.d/3-binary-indep.mk |  2 +-
 debian/tools/python-perf.py      | 32 +++++++++++++++++---------------
 3 files changed, 25 insertions(+), 18 deletions(-)

-- 
2.43.0




More information about the kernel-team mailing list