yaffs: Clean up yaffs VFS glue code.
[yaffs2.git] / linux-tests / plot_data.sh
index cd5a1cd6f8992af4b5865b3cb50e22ba7a46b4d5..59c26b085a8d8dce6a5b72d0ed7426792191d633 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh
+\#!/bin/sh
 # Script that gathers data erased vs free data from /proc/yaffs_stats and simultaneously \
 # plots it using gnuplot.
 
@@ -25,11 +25,15 @@ i=0;
 rm -f $log_file
 
 while [ ! -e $done_file ] ; do
-str=$(cat /proc/yaffs_stats)
-echo "$i, $str" 
-echo "$i, $str"  >> $log_file
-let i=$i+1
-sleep $gather_delay
+       erased_blocks=$(cat /proc/yaffs | grep n_erased_blocks | cut -d ' ' -f 2)
+       free_chunks=$(cat /proc/yaffs | grep n_free_chunks | cut -d ' ' -f 2)
+
+       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
 }
 
@@ -44,7 +48,10 @@ tail -$plot_samples $log_file > $trunc_file
 
 plot_str=" plot '$trunc_file' using 1:3 with linespoints title 'free', '' using 1:4 with linespoints title 'erased'"
 
-echo "set title 'yaffs free space and erased space'"
+echo "set title 'yaffs free space vs erased space'"
+echo "set xlabel 'seconds'"
+echo "set ylabel 'chunks'"
+
 
 echo $plot_str