Add scripts for realtime plotting erased psace vs free space
authorCharles Manning <cdhmanning@gmail.com>
Fri, 19 Mar 2010 03:06:14 +0000 (16:06 +1300)
committerCharles Manning <cdhmanning@gmail.com>
Fri, 19 Mar 2010 03:06:14 +0000 (16:06 +1300)
linux-tests/drive_gnuplot.sh [new file with mode: 0755]
linux-tests/gather_data.sh [new file with mode: 0755]
linux-tests/plot_data.sh [new file with mode: 0755]

diff --git a/linux-tests/drive_gnuplot.sh b/linux-tests/drive_gnuplot.sh
new file mode 100755 (executable)
index 0000000..0f1ebd8
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/sh
+# drive_gnuplot syntehsises the commands for driving gnuplot
+
+the_log_file=data
+
+plot_str=" plot 'trunc_data' using 1:3 with linespoints title 'free', '' using 1:4 with linespoints title 'erased'"
+
+echo "set title 'yaffs free space and erased space'"
+
+echo $plot_str
+while true; do
+sleep 1
+tail -100 $the_log_file > trunc_data
+echo replot
+done
+
diff --git a/linux-tests/gather_data.sh b/linux-tests/gather_data.sh
new file mode 100755 (executable)
index 0000000..4a463fd
--- /dev/null
@@ -0,0 +1,14 @@
+#! /bin/sh
+# gather_data.sh  agthers the data to be plotted
+#
+the_file=data
+i=0;
+rm -f $the_file
+
+while true; do
+str=$(cat /proc/yaffs_debug)
+echo "$i, $str" 
+echo "$i, $str"  >> $the_file
+let i=$i+1
+sleep 1
+done
diff --git a/linux-tests/plot_data.sh b/linux-tests/plot_data.sh
new file mode 100755 (executable)
index 0000000..23a2202
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+# plot_data.sh runs the plot, updating it in realtime
+
+./drive_gnuplot.sh | gnuplot
+