Iotop使用

文章目录

Iotop依赖及编译

源码路径:https://github.com/Tomas-M/iotop#how-to-build-from-source (GitHub - Tomas-M/iotop: A top utility for IO)

1:内核配置

在编译内核make menuconfig的时候一定要把下面选项选上:

General setup ---> CPU/Task time and stats accounting ->

+\] Export task/process statistics through netlink \[+\] Enable per-task delay accounting \[+\] Enable extended accounting over taskstats \[+\] Enable per-task storage I/O accounting +CONFIG_TASKSTATS=y +CONFIG_TASK_DELAY_ACCT=y +CONFIG_TASK_XACCT=y +CONFIG_TASK_IO_ACCOUNTING=y +CONFIG_SCHED_INFO=y ## 2: 环境配置 在执行iotop出现 Error opening terminal: vt102,请继续往下看: 在板子上如下操作/etc/profile加入 export TERM=vt100 export TERMINFO=/usr/share/terminfo mkdir /usr/share/terminfo/v -p 然后copy自己的pc主机上的 /usr/share/terminfo/v/vt100 到板子上的/usr/share/terminfo/v/目录下 ## 3.依赖库ncurses 源码路径:https://invisible-island.net/ncurses/ncurses.html#download_ncurses ### 3.1 Ncurses的编译配置 ./configure --with-shared --without-debug --with-ticlib --disable-stripping --host=aarch64-linux-gnu CC=aarch64-linux-gnu-gcc --prefix="$PWD/.../libncurses" 然后make \&\& make install.libs \&\& make install.lncludes 然后使用服务器的gcc 在全编译一次 能够生成terminfo 把这里的v/vt100保存下来 ## 4. Iotop的编译及修改 需要修改Makefile,然后需要将Ncurses的成果物放到iotop的跟目录 ```c INCLUDES := ./include 新增 CC=aarch64-linux-gnu-gcc 新增 # PKG_CONFIG?=pkg-config # NCCC?=$(shell $(PKG_CONFIG) --cflags ncursesw) # NCLD?=$(shell $(PKG_CONFIG) --libs ncursesw) # ifeq ("$(NCLD)","") # NCCC:=$(shell $(PKG_CONFIG) --cflags ncurses) # NCLD:=$(shell $(PKG_CONFIG) --libs ncurses) # endif # ifeq ("$(NCLD)","") # NCCC:= # NCLD:=-lncursesw # endif CFLAGS += -L ./lib/ -Bstatic -lncurses 新增 CFLAGS += $(addprefix -I,$(INCLUDES)) 新增 ``` ## 5.测试效果如下: ![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/61715e38bf524f25b2c50a9cacdcda40.png)

相关推荐
让子弹飞024 分钟前
36.2Linux单总线驱动DS18B20实验(详细讲解代码)_csdn
linux·ubuntu·驱动的分离和分层
Yana.nice20 分钟前
yum list 和 repoquery的区别
linux
码出钞能力1 小时前
更换libc.so导致linux变砖,通过LD_PRELOAD挽救
linux·服务器
小马学嵌入式~1 小时前
嵌入式 SQLite 数据库开发笔记
linux·c语言·数据库·笔记·sql·学习·sqlite
小猪咪piggy2 小时前
【JavaEE】(24) Linux 基础使用和程序部署
linux·运维·服务器
Haven-2 小时前
Linux常见命令
linux·基本指令
IT 小阿姨(数据库)2 小时前
PgSQL中pg_stat_user_tables 和 pg_stat_user_objects参数详解
linux·运维·数据库·sql·postgresql·oracle
MChine慕青2 小时前
顺序表与单链表:核心原理与实战应用
linux·c语言·开发语言·数据结构·c++·算法·链表
虎头金猫3 小时前
如何在Linux上使用Docker在本地部署开源PDF工具Stirling PDF:StirlingPDF+cpolar让专业操作像在线文档一样简单
linux·运维·ubuntu·docker·pdf·开源·centos
努力学习的小廉4 小时前
深入了解linux系统—— 线程同步
linux·服务器·数据库·算法