Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame] | 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 | |
| 12 | usage() { |
| 13 | echo "Usage: $0 <count>" |
| 14 | } |
| 15 | |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 16 | TIMEOUT=15 |
| 17 | |
Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame] | 18 | if [ $# -ne 1 ]; then |
| 19 | usage |
| 20 | exit 1 |
| 21 | fi |
| 22 | |
| 23 | uptime |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 24 | timeout ${TIMEOUT} dd if=/dev/zero of=oe-time-dd-test.dat bs=1024 count=$1 conv=fsync |
| 25 | if [ $? -ne 0 ]; then |
| 26 | echo "Timeout used: ${TIMEOUT}" |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame^] | 27 | echo "start: top output" |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 28 | top -c -b -n1 -w 512 |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame^] | 29 | echo "end: top output" |
| 30 | echo "start: iostat" |
| 31 | iostat -y -z -x 5 1 |
| 32 | echo "end: iostat" |
| 33 | echo "start: cooker log" |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 34 | tail -30 tmp*/log/cooker/*/console-latest.log |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame^] | 35 | echo "end: cooker log" |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 36 | fi |