iotop毫无疑问linux IO检测上是一个很好的工具,但苦于要求和内核版本Python版本号。我的很多朋友放弃了。我也是。无意中发现iopp,使用c书面,与此iotop它是一个作用。nice!
一起分享
安装方法非常easy。首先复制以下源码保存为iopp.c文件
#include <stdio.h>
#include <sys/types.h>
#include <dirent.h>
#include <ctype.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <getopt.h>
#define PROC "/proc"
#define GET_VALUE(v)
p = strchr(p, ':');
++p;
++p;
q = strchr(p, '
');
length = q - p;
if (length >= BUFFERLEN)
{
printf("ERROR - value is larger than the buffer: %d
", __LINE__);
exit(1);
}
strncpy(value, p, length);
value[length] = '