我试图在我的Windows机器上使用WSL 2来设置Ubuntu20.04LTS,以便能够在Linux和Windows的某个版本上运行性能实验,作为其中的一部分,我打算安装perf
工具。
为了做到这一点,我读到包linux-tools-common
和linux-tools-generic
是必需的。我使用apt install
安装了这些程序,它确实导致了perf
的安装。但是,如果我试图运行该工具,将显示以下提示:
$ perf --version
WARNING: perf not found for kernel 5.4.72-microsoft
You may need to install the following packages for this specific kernel:
linux-tools-5.4.72-microsoft-standard-WSL2
linux-cloud-tools-5.4.72-microsoft-standard-WSL2
You may also want to install one of the following packages to keep up to date:
linux-tools-standard-WSL2
linux-cloud-tools-standard-WSL2
然而,这些包都不存在于apt存储库中,我也找不到对这些包的任何引用。
有没有人经历过在WSL2上建立Linux perf
,或者能够就如何最好地解决这个问题向我提供建议?
发布于 2021-04-08 08:08:02
WSL2目前不支持Perf,因为它有一个自定义内核,它不支持硬件计数器。您可以手动安装perf,但它不会给出预期的结果。https://github.com/microsoft/WSL/issues/4678
https://askubuntu.com/questions/1314136
复制相似问题