如何安装
perf
监控工具?perf
监控工具?apt-get install linux-tools-common linux-tools-generic linux-tools-`uname -r`
sudo apt-get install linux-tools-common linux-tools-generic
(跳过依赖于内核版本的部分)就足够了。 - Martin R.uname -r
shell 扩展)。 - notpeteruname -r
- dylannininperf
实用程序可以在linux-tools软件包中找到。linux-tools-generic-hwe-$version
(我当前安装的是linux-tools-generic-hwe-20.04
)。 - pizzapants184git clone --depth 1 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
cd linux/tools/perf
make
cp perf /usr/bin
perf --version
命令来检查当前版本。apt-get install build-essential git flex bison
。 - Matthias Kuhnperf -h
时,您将收到“警告:找不到适用于内核5.11.0-41的perf工具”(或者任何其他perf不可用的较新内核)。必须手动从linux-tools编译该工具。 - Daveperf trace
。 - stasontrace
,而在v5中还存在。我非常怀疑v6的perf
能否在内核5.x上正常工作。也许可以在回答中建议检查是否使用了与实际内核相同的主要版本? - stasonsudo apt install linux-tools-common
https://packages.ubuntu.com/eoan/linux-tools-common
sudo apt install linux-perf
linux-tools
软件包不存在无条件的情况下。$ sudo apt-get install linux-tools
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package linux-tools is a virtual package provided by:
linux-tools-virtual 3.13.0.36.43
linux-tools-lowlatency 3.13.0.36.43
linux-tools-generic-lts-trusty 3.13.0.36.43
linux-tools-generic-lts-saucy 3.13.0.36.43
linux-tools-generic 3.13.0.36.43
You should explicitly select one to install.
E: Package 'linux-tools' has no installation candidate
linux-tools-generic
软件包。linux-tools-common
和适用于您当前内核版本的特定软件包。 - davidAsudo /usr/lib/linux-tools-5.15.0-67/perf trace date
- 尝试使用 locate /lib/linux-tools | grep perf
查找你可能拥有的版本。 - stason我在我的电脑上安装了Linux 3.17.2并尝试使用
sudo apt-get install linux-tools-3.17.2
cd linux/tools/perf
然后运行make命令:
make
make install
sudo apt-get install linux-tools-common
sudo apt-get install linux-tools
WARNING: perf not found for kernel 4.15.0-39
You may need to install the following packages for this specific kernel:
linux-tools-4.15.0-39-generic
linux-cloud-tools-4.15.0-39-generic
You may also want to install one of the following packages to keep up to date:
linux-tools-generic
linux-cloud-tools-generic
sudo apt-get install linux-tools-generic
,这就足够了。perf
时遇到权限错误,请参考这里:
以非root权限运行perf
which perf
命令来查找它们的位置。 - Dave