Advertisement
Guest User

zram-test.sh

a guest
May 21st, 2018
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. Main() {
  4. read Algo </sys/block/zram0/comp_algorithm
  5. Swappiness=$(/sbin/sysctl -a 2>/dev/null | awk -F" = " '/vm.swappiness/ {print $2}')
  6. RunTest
  7. case ${Swappiness} in
  8. 100)
  9. sed -i 's/vm.swappiness=100/vm.swappiness=80/' /etc/sysctl.conf
  10. sync
  11. reboot
  12. ;;
  13. 80)
  14. sed -i 's/vm.swappiness=80/vm.swappiness=60/' /etc/sysctl.conf
  15. sync
  16. reboot
  17. ;;
  18. 60)
  19. sed -i 's/vm.swappiness=60/vm.swappiness=40/' /etc/sysctl.conf
  20. sync
  21. reboot
  22. ;;
  23. esac
  24. }
  25.  
  26. RunTest() {
  27. CountOfCores=$(grep -c processor /proc/cpuinfo)
  28. echo -e "$(date)\t${Swappiness}\t${CountOfCores}\t${Algo}\t\c" >>zram-test.log
  29. if [ -d ComputeLibrary-18.03 ]; then
  30. rm -rf ComputeLibrary-18.03
  31. fi
  32. tar xvf v18.03.tar.gz
  33. cd ComputeLibrary-18.03/
  34. grep -r "lala" *
  35. (time scons Werror=1 -j8 debug=0 neon=1 opencl=1 embed_kernels=1 os=linux arch=arm64-v8a build=native) 2>&1 | grep "^real" >>../zram-test.log
  36. }
  37.  
  38. cd /home/tk
  39. sleep 30
  40.  
  41. Main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement