背景: 我有2个服务器,所有os内核版本都是4.18.7,它有CONFIG_BPF_SYSCALL = y
我创建了一个shell脚本'x.sh'
i=0
while (( i < 1000000 ))
do (( i ++ ))
done
Run Code Online (Sandbox Code Playgroud)
并运行命令: perf stat ./x.sh
所有的shell版本都是"4.2.6(1)-release"
S1: CPU - Intel(R)Xeon(R)CPU E5-2630 v4 @ 2.20GHz,以及微码 - 0xb00002e和perf stat结果
5391.653531 task-clock (msec) # 1.000 CPUs utilized
4 context-switches # 0.001 K/sec
0 cpu-migrations # 0.000 K/sec
107 page-faults # 0.020 K/sec
12,910,036,202 cycles # 2.394 GHz
27,055,073,385 instructions # 2.10 insn per cycle
6,527,267,657 branches # 1210.624 M/sec
34,787,686 branch-misses # 0.53% of all branches …Run Code Online (Sandbox Code Playgroud)