diff options
author | Brint E. Kriebel <bekit@cyngn.com> | 2014-11-03 18:57:56 -0800 |
---|---|---|
committer | Brint E. Kriebel <bekit@cyngn.com> | 2014-11-03 18:57:56 -0800 |
commit | f25e7804729d25bcfde575b78b501e06a8cbb708 (patch) | |
tree | d98e3220a7522671e6ce82a2d40bf878dfa3eccc /scripts/spo_test.sh | |
parent | 5668a2234ad79ffd45838679692d10236a3e965f (diff) | |
parent | 4f5a66a6eb77baa896d3adfb12139a830573f609 (diff) | |
download | android_external_f2fs-tools-f25e7804729d25bcfde575b78b501e06a8cbb708.tar.gz android_external_f2fs-tools-f25e7804729d25bcfde575b78b501e06a8cbb708.tar.bz2 android_external_f2fs-tools-f25e7804729d25bcfde575b78b501e06a8cbb708.zip |
Merge branch 'cm-11.0' into stable/cm-11.0cm-11.0-XNPH05Q-tomato-9828f8e9cccm-11.0-XNPH05Q-bacon-5229c4ef56stable/cm-11.0-XNF9Xstable/cm-11.0-XNF8Ystable/cm-11.0shipping/cm-11.0
Conflicts:
Android.mk
VERSION
fsck/dump.c
fsck/f2fs.h
fsck/fsck.c
fsck/main.c
fsck/mount.c
include/f2fs_fs.h
include/f2fs_version.h
lib/libf2fs.c
mkfs/Makefile.am
mkfs/f2fs_format.c
mkfs/f2fs_format_utils.c
mkfs/f2fs_format_utils.h
tools/f2fstat.c
tools/fibmap.c
Change-Id: I5cc044a6fe47bac6cab8d845f8d63729f765de50
Diffstat (limited to 'scripts/spo_test.sh')
-rwxr-xr-x | scripts/spo_test.sh | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/scripts/spo_test.sh b/scripts/spo_test.sh new file mode 100755 index 0000000..2191214 --- /dev/null +++ b/scripts/spo_test.sh @@ -0,0 +1,70 @@ +#!/bin/bash + +MNT=/mnt/f2fs +DEV=/dev/sdb1 +USER_DIR=/home/zeus +F2FS_DIR=$USER_DIR/f2fs_test + +check_stop() { + stop=`cat /tmp/stop` + if [ $stop -eq 1 ]; then + exit + fi +} + +case $1 in +start) + echo 0 > /tmp/stop + umount /mnt/* + echo 3 > /proc/sys/vm/drop_caches + echo 8 > /proc/sys/kernel/printk + + date >> $USER_DIR/por_result + sync + + insmod $F2FS_DIR/src/fs/f2fs/f2fs.ko || exit + + echo Start checking F2FS without fsync + check_stop + fsck.f2fs $DEV -d 0 || exit + mount -t f2fs -o disable_roll_forward $DEV $MNT || exit + umount $MNT + echo 3 > /proc/sys/vm/drop_caches + + echo Start checking F2FS with fsync + check_stop + fsck.f2fs $DEV -d 0 || exit + mount -t f2fs $DEV $MNT || exit + umount $MNT + + check_stop + fsck.f2fs $DEV -d 0 || exit + mount -t f2fs $DEV $MNT || exit + + count=`cat $USER_DIR/por_time` + if [ $count -eq 20 ]; then + echo Start rm all + time rm -rf $MNT/* || exit + echo 0 > $USER_DIR/por_time + sync + else + echo $((count+1)) > $USER_DIR/por_time + fi + echo 8 > /proc/sys/kernel/printk + echo Start fsstress + date + $F2FS_DIR/stress_test/fsstress/fsstress -z -f link=0 -f mkdir=3 -f mknod=3 -f rmdir=2 -f symlink=3 -f truncate=4 -f write=10 -f creat=10 -f unlink=5 -f rename=5 -f fsync=10 -p 10 -n 10000 -l 0 -d $MNT & + RANDOM=`date '+%s'` + rand=$[($RANDOM % 540) + 60] + echo Start sleep: $rand seconds + sleep $rand + + echo Reboot now + check_stop + echo b > /proc/sysrq-trigger + ;; +stop) + killall -9 fsstress + echo 1 > /tmp/stop + ;; +esac |