Filebench的安装与使用
filebench参数
filebench
filebench介绍
filesystem测试工具之filebench
filebench
filebench介绍英ppt
filebench的github
filebench的github的wiki
安卓上有app可以直接下载
dmesg日志内容保存在文件: /var/log/dmesg
dmesg -L # color
dmesg -H # human timestamp
dmesg -T # readable timestamp
dmesg --follow # 持续观察输出
dmesg | tail -10 # 最后10行,也可以使用其它,如more,less,grep
-T 输出已读的时间戳
-u 控制输出用户空间的日志
-c 清除dmesg日志,但是日志保存的位置内容不会被删除
dmesg -h
man dmesg
emerg: System is unusable.
alert: Action must be taken immediately.
crit: Critical conditions.
err: Error conditions.
warn: Warning conditions.
notice: Normal but significant condition.
info: Informational.
debug: Debug-level messages.
使用dmesg -l info或者dmesg --level=info仅输出info级别的日志,这不包括更高级别的日志。
dmesg -l debug,notice
同时输出多种级别的日志。
使用命令tail -f /var/log/dmesg
来实时监控dmesg的日志输出。watch "dmesg | tail -20"
查看当前控制台的打印级别
cat /proc/sys/kernel/printk
#include
#include
#include
#include //内核编译的配置信息
#include
#include
#define __LOG_BUF_LEN (1 << CONFIG_LOG_BUF_SHIFT)//在2.6.28内核中为默认1<<17,这才是真正dmesg buffer的大小,网上其他都扯淡。
#define __LOG_PATH "/log/dmesg.log"
#define LOG_SLEEP(x) (sleep(x))
#define __LOG_SIZE 104857600//大于100M时删除文件
#define BUF_SIZE 256
long check_log_size(void) {
struct stat f_stat;
if( stat( __LOG_PATH, &f_stat ) == -1 ){
return -1;
}
return (long)f_stat.st_size;
}
int main() {
unsigned char buf[__LOG_BUF_LEN]={0,};
unsigned char tmpbuf[BUF_SIZE]={0,};
int ret = 0;
FILE *fp =NULL;
struct tm *ptr;
time_t lt;
daemon(0,0);//进入守护模式
while(1){
LOG_SLEEP(10);
fp = fopen(__LOG_PATH,"a+");
if(NULL == fp){
continue;
}
ret = klogctl(4,buf,__LOG_BUF_LEN);//获得dmesg信息
if(0 >= ret){
perror("klogctl ");
fclose(fp);
continue;
}
lt = time(NULL);//获得时间
ptr = (struct tm *)localtime(<);
sprintf(tmpbuf," [LOG TIME:] %s",asctime(ptr));
fwrite(tmpbuf,strlen(tmpbuf),1,fp);
fwrite(buf,strlen(buf),1,fp);
fclose(fp);
if(__LOG_SIZE < check_log_size()){
unlink(__LOG_PATH);//删除该文件
}
memset(tmpbuf,0,BUF_SIZE);
memset(buf,0,__LOG_BUF_LEN);
}
return 0;
}
https://github.com/axboe/fio
https://www.cnblogs.com/zero-gg/p/9296603.html
https://blog.csdn.net/don_chiang709/article/details/92628623
https://www.jianshu.com/p/9d823b353f22
CPU,硬盘,网络速度对比
在 CPU 的角度以具体的数据来量化 CPU、磁盘、网络的速度,对计算机各个组件不同的速度差异有个更直观的认识。