X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=linux-tests%2Fplot_data.sh;h=cd5a1cd6f8992af4b5865b3cb50e22ba7a46b4d5;hp=6713f722aa5a972dd238021fa6f7b71b8bbe2f06;hb=390dac6aa9334603dc13325bfb0511e778e8b926;hpb=6c7131b1d7c221125851a7c0bd183dd05a02d583 diff --git a/linux-tests/plot_data.sh b/linux-tests/plot_data.sh index 6713f72..cd5a1cd 100755 --- a/linux-tests/plot_data.sh +++ b/linux-tests/plot_data.sh @@ -7,6 +7,8 @@ log_file=data gather_delay=1 +done_file=plot_done + # Plot settings trunc_file=trunc_data plot_samples=1000 @@ -14,14 +16,16 @@ plot_delay=2 + + # Gathering task gather_data() { i=0; rm -f $log_file -while true; do -str=$(cat /proc/yaffs_debug) +while [ ! -e $done_file ] ; do +str=$(cat /proc/yaffs_stats) echo "$i, $str" echo "$i, $str" >> $log_file let i=$i+1 @@ -44,7 +48,7 @@ echo "set title 'yaffs free space and erased space'" echo $plot_str -while true; do +while [ ! -e $done_file ]; do sleep $plot_delay tail -$plot_samples $log_file > $trunc_file echo replot @@ -52,9 +56,15 @@ done } +rm -f $done_file +trap "touch $done_file" INT echo "Start gathering task in background" gather_data & echo "Run plotting task" drive_gnuplot | gnuplot +wait + +echo "All done" +