Ubuntu18.04安装perf报错

问题

尝试安装perf监控程序资源开销,安装后报错

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

安装对应版本的linux-tools-4.15.0-39-generic无法找到package

解决

其实perf已经内置在linux-tools-generic里面,所以安装后创建perf软链接即可

sudo apt install linux-tools-generic
sudo ln -s ln -s /usr/lib/linux-tools/4.15.0-162-generic/perf /usr/bin/perf

其中4.15.0-162-generic字段酌情替换

原文地址:https://www.cnblogs.com/azureology/p/15518117.html