当前位置: 首页 > news >正文

Debian/Ubuntu 安装和使用 perf 调试工具

为操作系统安装基本依赖环境:

apt-get update -y
apt-get upgrade -y
apt-get install lrzsz zip unzip libkrb5-dev libicu-dev screen iftop openssl libssl-dev libunwind8 iftop net-tools gcc gdb cmake curl wget -y
apt-get install gcc gdb cmake python-dev g++ -y ##:clang
apt-get install python3-dev -y ## yum install python-devel

如果 Ubuntu 安装GDB调试器失败,可以参考下述类似命名安装解决

wget http://kr.archive.ubuntu.com/ubuntu/pool/main/b/babeltrace/libbabeltrace1_1.3.2-1_amd64.deb
wget http://kr.archive.ubuntu.com/ubuntu/pool/main/b/babeltrace/libbabeltrace-ctf1_1.3.2-1_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/main/g/gdb/gdb_7.11.1-0ubuntu1~16.5_amd64.deb
dpkg -i libbabeltrace1_1.3.2-1_amd64.deb
dpkg -i libbabeltrace-ctf1_1.3.2-1_amd64.deb
dpkg -i gdb_7.11.1-0ubuntu1~16.5_amd64.deb
apt-get install gdb -yapt-get install libssl1.1=1.1.1-1ubuntu2.1~18.04.17 -y
apt-get install krb5-multidev=1.16-2ubuntu0.2 libicu60=60.2-3ubuntu3.2 -y

为 Debain 操作系统安装 perf 调试工具

apt-get install linux-perf

为 Ubuntu 操作系统安装 perf 调试工具

apt-get install linux-tools-common linux-tools-generic linux-cloud-tools-generic linux-tools-`uname -r`

检查已安装好的 perf 调试工具是否能用?

如果执行命令以后出现下述错误,但您的系统内核并非该版本。

root@debian:~# perf
/usr/bin/perf: line 13: exec: perf_6.1: not found
E: linux-perf-6.1 is not installed.

那么查看 /usr/bin/perf 是否有您内核版本的 perf 调试工具。

root@debian:~# /usr/bin/perf
perf       perf_5.10  

如果你执行 uname -r 命令获取出来的版本号是大于 perf 调试工具自身版本时。

root@debian:~# uname -r 
6.1.6

那么如何确定,应当使用那个版本的 perf 调试工具呢?

root@debian:~# apt-get install linux-perf
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
linux-perf is already the newest version (5.10.162-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

重新尝试 apt-get install linux-perf 命令,安装结果会告诉人们应当使用那个版本的 perf 工具,根据上面的提示,我们使用 perf_5.10。

root@debian:~# perf_5.10 -v
perf version 5.10.162

大功告成,如果上述没有可以让你的PC安装上可用版本 perf 的办法,那么你可以手动拿着 perf 的代码手动编译来获取适用于,当前系统内核版本的 perf 工具。

http://www.lryc.cn/news/12865.html

相关文章:

  • 【Python语言基础】——Python NumPy 数组连接
  • 解决IDEA报错:无效的目标发行版: 17
  • Redis第四讲
  • Linux Ubuntu 软件安装与卸载
  • metasploit穷举模块
  • day35 贪心算法 | 435、无重叠区间 763、划分字母区间 56、合并区间
  • C++Primer15.5节练习
  • 【日常点滴019】Python制作流浪气球游戏(导弹射击类)
  • effective c++阅读之旅---条款29
  • Android system — 进程生命周期与ADJ
  • vue3+ts+node个人博客系统(三)
  • Python第三方模块
  • 怎样查询PMP成绩?
  • 说说变量 __name__ 和它可能取到的一个值 __main__
  • 软考高级-信息系统管理师之整体管理(最新版)
  • JVM学习篇垃圾收集器ParNewCMS与底层三色标记算法详解
  • 基于FFmpeg和Screen Capturer Recorder实现屏幕和声音的录制
  • 猿人学14题详解
  • Allegro如何快速把推挤的走线变平滑操作指导
  • nginx基础学习
  • 【HDFS】FsDatasetImpl#recoverClose方法
  • 加油站会员管理小程序实战开发教程15 完结篇
  • 学习 Python 之 Pygame 开发坦克大战(五)
  • 【ROS】Windows系统安装ROS体验
  • 第1讲-初步认识数据库系统(测试题总结)
  • 进程-操作系统结构
  • 【网络原理6】数据链路层协议——以太网
  • 组合数学原理与例题
  • 【机器学习 深度学习】通俗讲解集成学习算法
  • 汉字----dgfont