ubuntu 16.04安装 perf

本文档记录了在 Ubuntu 16.04 系统上安装 perf 的详细步骤,包括通过 `apt` 安装所需的依赖包,并解决在安装过程中遇到的问题。安装完成后,使用 `perf stat` 命令测试了一个名为 `test` 的程序,展示了 perf 收集到的性能统计数据。

安装

tsh@tsh-virtual-machine:~/codeTest/learnPerf$ perf stat ./test
The program 'perf' is currently not installed. You can install it by typing:
sudo apt install linux-tools-common


tsh@tsh-virtual-machine:~/codeTest/learnPerf$ sudo apt install linux-tools-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  linux-tools-common
0 upgraded, 1 newly installed, 0 to remove and 329 not upgraded.
Need to get 140 kB of archives.
After this operation, 565 kB of additional disk space will be used.
Get:1 http://cn.archive.ubuntu.com/ubuntu xenial-updates/main amd64 linux-tools-common all 4.4.0-142.168 [140 kB]
Fetched 140 kB in 5s (23.6 kB/s)             
Selecting previously unselected package linux-tools-common.
(Reading database ... 182683 files and directories currently installed.)
Preparing to unpack .../linux-tools-common_4.4.0-142.168_all.deb ...
Unpacking linux-tools-common (4.4.0-142.168) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up linux-tools-common (4.4.0-142.168) ...


tsh@tsh-virtual-machine:~/codeTest/learnPerf$ sudo perf stat ./test
WARNING: perf not found for kernel 4.8.0-36

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

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


tsh@tsh-virtual-machine:~/codeTest/learnPerf$ sudo apt-get install linux-tools-4.8.0-36-generic  linux-cloud-tools-4.8.0-36-generic  linux-tools-generic    linux-cloud-tools-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libdw1 linux-cloud-tools-4.4.0-142 linux-cloud-tools-4.4.0-142-generic linux-cloud-tools-common linux-hwe-cloud-tools-4.8.0-36 linux-hwe-tools-4.8.0-36 linux-tools-4.4.0-142
  linux-tools-4.4.0-142-generic
The following NEW packages will be installed:
  libdw1 linux-cloud-tools-4.4.0-142 linux-cloud-tools-4.4.0-142-generic linux-cloud-tool

评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值