LinuxIO工具iotop的替代品iopp
系统大全为您提供
iotop无疑在linux IO检测上是个不错的工具,但苦于要求内核版本和Python版本,不少朋友放弃了,我也是。偶然间找到了iopp,用c写的,这个跟iotop是一个作用,nice!给大家分享下
安装方法很简单,首先复制下面源代码保存为iopp.c文件
#include <stdio.h>
#include <syspes.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] = '
安装方法很简单,首先复制下面源代码保存为iopp.c文件
#include <stdio.h>
#include <syspes.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] = '