Confirming the bug:
$ uname -a
Linux n-perf 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
$ sudo apt install linux-tools-$(uname -r)
(...)
$ python3 -c 'import perf; [print(c) for c in perf.cpu_map()]'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'perf'
Updating to kernel in noble-proposed and rebooting:
$ uname -a
Linux n-perf 6.8.0-32-generic #32-Ubuntu SMP PREEMPT_DYNAMIC Wed May 1 15:30:59 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
linux-tools was also updated:
$ dpkg -l linux-tools-$(uname -r)
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-============================-============-============-========================================================
ii linux-tools-6.8.0-32-generic 6.8.0-32.32 amd64 Linux kernel version specific tools for version 6.8.0-32
The python command now works:
$ python3 -c 'import perf; [print(c) for c in perf.cpu_map()]'
0
Another verification also shows the module is now available:
Noble verification
Confirming the bug:
$ uname -a
Linux n-perf 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
$ sudo apt install linux-tools-$(uname -r)
(...)
$ python3 -c 'import perf; [print(c) for c in perf.cpu_map()]' rror: No module named 'perf'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundE
Updating to kernel in noble-proposed and rebooting:
$ uname -a
Linux n-perf 6.8.0-32-generic #32-Ubuntu SMP PREEMPT_DYNAMIC Wed May 1 15:30:59 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
linux-tools was also updated: Unknown/ Install/ Remove/ Purge/Hold Not/Inst/ Conf-files/ Unpacked/ halF-conf/ Half-inst/ trig-aWait/ Trig-pend /Reinst- required (Status,Err: uppercase=bad) ======= ======= ======= ====-== ======= ===-=== ======= ==-==== ======= ======= ======= ======= ======= ======= ======= === 6.8.0-32- generic 6.8.0-32.32 amd64 Linux kernel version specific tools for version 6.8.0-32
$ dpkg -l linux-tools-$(uname -r)
Desired=
| Status=
|/ Err?=(none)
||/ Name Version Architecture Description
+++-===
ii linux-tools-
The python command now works:
$ python3 -c 'import perf; [print(c) for c in perf.cpu_map()]'
0
Another verification also shows the module is now available:
$ python3 -c 'import perf; print(perf. __file_ _)' python3/ dist-packages/ linux-tools- 6.8.0-32/ perf.cpython- 312-x86_ 64-linux- gnu.so
/usr/lib/
Noble verification succeeded.