|
搞定了
只要改一下/etc/coremark.sh脚本就可以了。,改成
- #!/bin/sh
- echo "testing coremark ... "
- sleep 1
- /bin/coremark > /tmp/coremark.log
- cat /tmp/coremark.log | grep "CoreMark 1.0" | cut -d "/" -f 1 > /etc/bench.log
- sed -i 's/CoreMark 1.0/ (CpuMark/g' /etc/bench.log
- echo " Scores)" >> /etc/bench.log
- cat /etc/bench.log
- sleep 5
- echo "<br/>" >> /etc/bench.log
- echo "<div><table>" >> /etc/bench.log
- if [ -x /usr/bin/openssl ];then
- CORES=$(grep processor /proc/cpuinfo | wc -l)
- PROJS="aes-128-gcm aes-256-gcm chacha20-poly1305"
- for P in $PROJS;do
- echo "testing $P ..."
- sleep 1
- /usr/bin/openssl speed -multi $CORES -evp $P 1>/tmp/${P}.score 2>/dev/null || echo "NA" >/tmp/${P}.score
- S=$(tail -n 1 /tmp/${P}.score | awk '{print $5}')
- echo "${P}(1K) : ${S}"
- echo "<tr><td>${P}(1K)</td><td>$S</td></tr>" >> /etc/bench.log
- rm -f /tmp/${P}.score
- sleep 5
- done
- fi
- echo "</table></div>" >> /etc/bench.log
- if [ -f "/etc/bench.log" ]; then
- sed -i '/coremark/d' /etc/crontabs/root
- crontab /etc/crontabs/root
- fi
复制代码
如果页面做了xss防护(<table>这种html标签会被转义),
就改成
- #!/bin/sh
- echo "testing coremark ... "
- sleep 1
- /bin/coremark > /tmp/coremark.log
- cat /tmp/coremark.log | grep "CoreMark 1.0" | cut -d "/" -f 1 > /etc/bench.log
- sed -i 's/CoreMark 1.0/ (CpuMark/g' /etc/bench.log
- echo " Scores)" >> /etc/bench.log
- cat /etc/bench.log
- sleep 5
- if [ -x /usr/bin/openssl ];then
- CORES=$(grep processor /proc/cpuinfo | wc -l)
- PROJS="aes-128-gcm aes-256-gcm chacha20-poly1305"
- for P in $PROJS;do
- echo "testing $P ..."
- sleep 1
- /usr/bin/openssl speed -multi $CORES -evp $P 1>/tmp/${P}.score 2>/dev/null || echo "NA" >/tmp/${P}.score
- S=$(tail -n 1 /tmp/${P}.score | awk '{print $5}')
- echo "${P}(1K) : ${S}"
- echo " __ [${P}(1K) : $S] " >> /etc/bench.log
- rm -f /tmp/${P}.score
- sleep 5
- done
- fi
- if [ -f "/etc/bench.log" ]; then
- sed -i '/coremark/d' /etc/crontabs/root
- crontab /etc/crontabs/root
- fi
复制代码
|
|