2 # Script that gathers data erased vs free data from /proc/yaffs_stats and simultaneously \
3 # plots it using gnuplot.
27 while [ ! -e $done_file ] ; do
28 erased_blocks=$(cat /proc/yaffs | grep n_erased_blocks | cut -d ' ' -f 2)
29 free_chunks=$(cat /proc/yaffs | grep n_free_chunks | cut -d ' ' -f 2)
31 erased_chunks=$(($erased_blocks*64))
32 str=" $i, 0, $free_chunks, $erased_chunks"
34 echo $str >> $log_file
42 # Periodically creates a truncated version of the log file and
43 # outputs commands into gnuplot, thus driving gnuplot
47 tail -$plot_samples $log_file > $trunc_file
49 plot_str=" plot '$trunc_file' using 1:3 with linespoints title 'free', '' using 1:4 with linespoints title 'erased'"
51 echo "set title 'yaffs free space vs erased space'"
52 echo "set xlabel 'seconds'"
53 echo "set ylabel 'chunks'"
58 while [ ! -e $done_file ]; do
60 tail -$plot_samples $log_file > $trunc_file
67 trap "touch $done_file" INT
69 echo "Start gathering task in background"
71 echo "Run plotting task"
72 drive_gnuplot | gnuplot