Linux利器之perf(火焰圖)


1 Ubuntu下安裝perf

在Ubuntu18上默認沒有安裝perf,可以通過如下命令嘗試: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-oem-osp1 5.0.0.1025.28
  linux-tools-gke-5.0 5.0.0.1023.12
  linux-tools-virtual-hwe-18.04-edge 5.3.0.12.83
  linux-tools-virtual-hwe-18.04 5.0.0.32.89
  linux-tools-virtual 4.15.0.66.68
  linux-tools-oracle 4.15.0.1027.30
  linux-tools-oem 4.15.0.1059.63
  linux-tools-lowlatency-hwe-18.04-edge 5.3.0.12.83
  linux-tools-lowlatency-hwe-18.04 5.0.0.32.89
  linux-tools-lowlatency 4.15.0.66.68
  linux-tools-gke-4.15 4.15.0.1046.49
  linux-tools-generic-hwe-18.04-edge 5.3.0.12.83
  linux-tools-generic-hwe-18.04 5.0.0.32.89
  linux-tools-generic 4.15.0.66.68
  linux-tools-gcp 5.0.0.1021.26
  linux-tools-aws 4.15.0.1052.51
You should explicitly select one to install.

E: Package 'linux-tools' has no installation candidate

 一般選擇安裝 linux-tools-generic 就好了,使用如下命令:

sudo apt-get install linux-tools-common 
sudo apt-get install linux-tools

可能提示錯誤,這個時候按照提示升級安裝即可:

WARNING: perf not found for kernel 4.15.0-48

  You may need to install the following packages for this specific kernel:
    linux-tools-4.15.0-48-generic
    linux-cloud-tools-4.15.0-48-generic

  You may also want to install one of the following packages to keep up to date:
    linux-tools-generic
    linux-cloud-tools-generic

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM