UBUNTU: [Packaging] linux-tools: Fall back to old python perf path
BugLink: https://bugs.launchpad.net/bugs/2089411 linux-tools from older kernels without these patches provide the perf python library in a different/broken path, so we have to look there as well. Sigh. Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com> Acked-by: Kevin Becker <kevin.becker@canonical.com> Acked-by: Agathe Porte <agathe.porte@canonical.com> Signed-off-by: Koichiro Den <koichiro.den@canonical.com>
This commit is contained in:
committed by
Mehmet Basaran
parent
1ecc312721
commit
94f464fdee
Vendored
+4
-1
@@ -20,7 +20,10 @@ class KernelNotFoundError(Exception):
|
||||
_kernel_version = os.uname().release
|
||||
_perf_dir = f"/usr/lib/linux-tools/{_kernel_version}/lib"
|
||||
if not os.path.exists(_perf_dir):
|
||||
raise KernelNotFoundError()
|
||||
_abi_version = "-".join(_kernel_version.split("-")[0:2])
|
||||
_perf_dir = f"/usr/lib/python3/dist-packages/linux-tools-{_abi_version}"
|
||||
if not os.path.exists(_perf_dir):
|
||||
raise KernelNotFoundError()
|
||||
_perf_lib = glob(os.path.join(_perf_dir, "perf.*.so"))[-1]
|
||||
|
||||
_spec = importlib.util.spec_from_file_location("perf", _perf_lib)
|
||||
|
||||
Reference in New Issue
Block a user