X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=linux-tests%2Fplot_data.sh;h=e7482bc49f8650fece50e9d9e1defffd6616fb32;hp=dcc1de3c951f8ee68fec238bfae663eb0e9854bf;hb=a7b5dcf904ba6f7890e4b77ce1f56388b855d0f6;hpb=a5d0fae6989a94efc39f77f1e8de703c8bcd87a5 diff --git a/linux-tests/plot_data.sh b/linux-tests/plot_data.sh index dcc1de3..e7482bc 100755 --- a/linux-tests/plot_data.sh +++ b/linux-tests/plot_data.sh @@ -25,11 +25,30 @@ i=0; rm -f $log_file while [ ! -e $done_file ] ; do -str=$(cat /proc/yaffs_stats) -echo "$i, $str" -echo "$i, $str" >> $log_file -i=$(($i+1)) -sleep $gather_delay + xx='1' + erased_blocks='2' + while [ "$xx" != "$erased_blocks" ] ; do + xx=$(cat /proc/yaffs | grep n_erased_blocks | cut -d ' ' -f 2) + erased_blocks=$(cat /proc/yaffs | grep n_erased_blocks | cut -d ' ' -f 2) + if [ -z "$xx" ] ; then + xx='bad value' + fi + done + xx='1' + free_chunks='2' + while [ "$xx" != "$free_chunks" ] ; do + xx=$(cat /proc/yaffs | grep n_free_chunks | cut -d ' ' -f 2) + free_chunks=$(cat /proc/yaffs | grep n_free_chunks | cut -d ' ' -f 2) + if [ -z "$xx" ] ; then + xx='bad value' + fi + done + erased_chunks=$(($erased_blocks*64)) + str=" $i, 0, $free_chunks, $erased_chunks" + echo $str + echo $str >> $log_file + i=$(($i+1)) + sleep $gather_delay done }