oe-time-dd-test.sh 755 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/sh
  2. #
  3. # oe-time-dd-test records how much time it takes to
  4. # write <count> number of kilobytes to the filesystem.
  5. # It also records the number of processes that are in
  6. # running (R), uninterruptible sleep (D) and interruptible
  7. # sleep (S) state from the output of "top" command.
  8. # The purporse of this script is to find which part of
  9. # the build system puts stress on the filesystem io and
  10. # log all the processes.
  11. usage() {
  12. echo "Usage: $0 <count>"
  13. }
  14. TIMEOUT=15
  15. if [ $# -ne 1 ]; then
  16. usage
  17. exit 1
  18. fi
  19. uptime
  20. timeout ${TIMEOUT} dd if=/dev/zero of=oe-time-dd-test.dat bs=1024 count=$1 conv=fsync
  21. if [ $? -ne 0 ]; then
  22. echo "Timeout used: ${TIMEOUT}"
  23. top -c -b -n1 -w 512
  24. tail -30 tmp*/log/cooker/*/console-latest.log
  25. fi