Skip to content

Instantly share code, notes, and snippets.

@KingofHamyang
Last active January 26, 2021 05:08
Show Gist options
  • Save KingofHamyang/925398f27ed7e68f042f0b4e9c94c1fc to your computer and use it in GitHub Desktop.
Save KingofHamyang/925398f27ed7e68f042f0b4e9c94c1fc to your computer and use it in GitHub Desktop.
mobi_sh
#!/bin/bash
FILE_SYSTEMS=(“xfs” “f2fs” “ext4”)
WRITE_TYPE=(0 1 4)
SYNC_TYPE=(8 8 2)
rm ./output/result.mobibench.dat
for fs in ${FILE_SYSTEMS[@]}; do
umount /dev/sda6 1>/dev/null
if [ $fs == ext4 ]; then
mkfs.ext4 -F -E lazy_itable_init=0,lazy_journal_init=0 /dev/sda6
else
mkfs.$fs -f /dev/sda6
fi
mount /dev/sda6 /home/haseongjun/work_dir 1>/dev/null
printf “%8s” “$fs” >> “./output/result.mobibench.dat”
for((i=0; i<3; i++)); do
echo “$fs, $i start”
date
echo 3 > /proc/sys/vm/drop_caches
kb_per_sec=`../Mobibench/shell/mobibench -p /home/haseongjun/work_dir -f 1048576 -a ${WRITE_TYPE[$i]} -y ${SYNC_TYPE[$i]} | awk ‘/[TIME]/ {print $8}’`
printf “%16f” “$kb_per_sec” >> “./output/result.mobibench.dat”
printf ” KB/sec” >> “./output/result.mobibench.dat”
echo “end”
date
done
printf “\n” >> “./output/result.mobibench.dat”
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment