2 # profile-kpios-disk.sh
4 # /proc/diskinfo <after skipping major/minor>
5 # Field 1 -- device name
6 # Field 2 -- # of reads issued
7 # Field 3 -- # of reads merged
8 # Field 4 -- # of sectors read
9 # Field 5 -- # of milliseconds spent reading
10 # Field 6 -- # of writes completed
11 # Field 7 -- # of writes merged
12 # Field 8 -- # of sectors written
13 # Field 9 -- # of milliseconds spent writing
14 # Field 10 -- # of I/Os currently in progress
15 # Field 11 -- # of milliseconds spent doing I/Os
16 # Field 12 -- weighted # of milliseconds spent doing I/Os
29 for DISK_FILE in `ls -r --sort=time --time=ctime ${RUN_LOG_DIR}/${RUN_ID}/disk-[0-9]*`; do
31 ROW_N=( `cat ${DISK_FILE} | grep sd | cut -c11- | cut -f${FIELD} -d' ' | tr "\n" "\t"` )
33 if [ $HEADER -eq 1 ]; then
35 cat ${DISK_FILE} | grep sd | cut -c11- | cut -f1 -d' ' | tr "\n" ", "
40 if [ ${#ROW_M[@]} -eq 0 ]; then
44 if [ ${#ROW_M[@]} -ne ${#ROW_N[@]} ]; then
45 echo "Badly formatted profile data in ${DISK_FILE}"
51 for (( i=0; i<${#ROW_N[@]}; i++ )); do
52 DELTA=`echo "${ROW_N[${i}]}-${ROW_M[${i}]}" | bc`
53 let TOTAL=${TOTAL}+${DELTA}
70 for DISK_FILE in `ls -r --sort=time --time=ctime ${RUN_LOG_DIR}/${RUN_ID}/disk-[0-9]*`; do
72 ROW_N=( `cat ${DISK_FILE} | grep sd | cut -c11- | cut -f${FIELD} -d' ' | tr "\n" "\t"` )
74 if [ $HEADER -eq 1 ]; then
76 cat ${DISK_FILE} | grep sd | cut -c11- | cut -f1 -d' ' | tr "\n" ", "
81 if [ ${#ROW_M[@]} -eq 0 ]; then
85 if [ ${#ROW_M[@]} -ne ${#ROW_N[@]} ]; then
86 echo "Badly formatted profile data in ${DISK_FILE}"
92 for (( i=0; i<${#ROW_N[@]}; i++ )); do
93 DELTA=`echo "${ROW_N[${i}]}-${ROW_M[${i}]}" | bc`
94 MBS=`echo "scale=2; ((${DELTA}*512)/${TIME})/(1024*1024)" | bc`
95 TOTAL=`echo "scale=2; ${TOTAL}+${MBS}" | bc`
105 echo "Reads issued per device"
108 echo "Reads merged per device"
111 echo "Sectors read per device"
113 echo "MB/s per device"
117 echo "Writes issued per device"
120 echo "Writes merged per device"
123 echo "Sectors written per device"
125 echo "MB/s per device"