diff options
author | Charles Manning <cdhmanning@gmail.com> | 2011-01-14 15:24:53 +1300 |
---|---|---|
committer | Charles Manning <cdhmanning@gmail.com> | 2011-01-14 15:24:53 +1300 |
commit | 6752805392f3b421d820effa4bf3f7484862d409 (patch) | |
tree | 042528a47bc4279893f6357afe086761e79b8582 | |
parent | 371b2eaad7d9c4947ec1e5c5f0576b7e118df617 (diff) |
yaffs testing: Change plotting to check for null data
/proc/yaffs reads can get mangled. These changes repeat the reads
until stable valid values are read.
Signed-off-by: Charles Manning <cdhmanning@gmail.com>
-rwxr-xr-x | linux-tests/plot_data.sh | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/linux-tests/plot_data.sh b/linux-tests/plot_data.sh index 59c26b0..e7482bc 100755 --- a/linux-tests/plot_data.sh +++ b/linux-tests/plot_data.sh @@ -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,9 +25,24 @@ i=0; rm -f $log_file while [ ! -e $done_file ] ; do - 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) - + 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 |