stress-ng交叉编译在板子上运行

一、直接用我移植好的:https://github.com/fanchenxinok/stress-ng-arm

二、自己移植过程

(1)下载源码包:

https://kernel.ubuntu.com/~cking/tarballs/stress-ng/

(2)我下载的是 stress-ng-0.10.07.tar.xz

解压 $ tar -xvf stress-ng-0.10.07.tar.xz

(3)修改Makefile

在makefile添加你的交叉编译工具路径

CROSS_COMPILER = $(EASY_SDK)/sysroots/x86_64-arago-linux/usr/bin/arm-linux-gnueabihf

CC = $(CROSS_COMPILER)-gcc --sysroot=$(EASY_SDK)/sysroots/armv7ahf-neon-linux-gnueabi

(4)找到config文件,删除里面所有的配置。否则会报一些错误。

(5)执行make, 会遇到一些少头文件的错误, 添加相应的头文件即可。

(6)用法参考: https://kernel.ubuntu.com/~cking/stress-ng/

CPU压力密集型
./stress-ng --cpu 0 --cpu-method pi -t 5m --times &

Mem: 116908K used, 1509556K free, 2152K shrd, 1052K buff, 18616K cached
CPU: 98.8% usr  1.1% sys  0.0% nic  0.0% idle  0.0% io  0.0% irq  0.0% sirq
Load average: 1.23 2.64 3.10 2/99 21624
  PID  PPID USER     STAT   VSZ %VSZ CPU %CPU COMMAND
21621 21620 root     R    12960  0.8   0 92.2 ./stress-ng --cpu 0 --cpu-method p
 

IO压力密集型
./stress-ng --io 4 --hdd 1 -t 5m --times &

[root@x home]# mpstat -P ALL 5

01:06:10     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest   %idle
01:06:15     all    0.00    0.00    6.88   93.12    0.00    0.00    0.00    0.00    0.00
01:06:15       0    0.00    0.00    6.88   93.12    0.00    0.00    0.00    0.00    0.00

可以看到 iowait高达93.12

 

补充:

编译过程出现如下错误:

make[1]: 正在进入目录 `/home/fanchenxin/j6_entry/j6demo_package/my_projects/stress-ng-0.10.07'
CC stress-access.c
In file included from stress-access.c:25:0:
stress-ng.h:103:10: fatal error: cpuid.h:没有那个文件或目录
 #include <cpuid.h>
          ^~~~~~~~~
compilation terminated.
 

解决:

将config文件删除,再make就好了,不要make clean。

 

  • 4
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值