Skip to content

Instantly share code, notes, and snippets.

@adam900710
Created March 6, 2019 06:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adam900710/ca47b9a8d4b8db7168b261b6fba71ff1 to your computer and use it in GitHub Desktop.
Save adam900710/ca47b9a8d4b8db7168b261b6fba71ff1 to your computer and use it in GitHub Desktop.
Performance test with btrfs perf interface
#!/bin/bash
dev=/dev/test/test
mnt=/mnt/btrfs
trace_result="/home/adam/trace"
_fail()
{
echo "!!! FAILED: $@ !!!"
exit 1
}
start_trace()
{
while true; do
sleep 1
cat /sys/fs/btrfs/1b4e28ba-2fa1-11d2-883f-b9a761bde3fb/profiler >> $trace_result
done
}
umount $dev &> /dev/null
umount $mnt &> /dev/null
rm $trace_result
wipefs -fa $dev
mkfs.btrfs -f $dev -U 1b4e28ba-2fa1-11d2-883f-b9a761bde3fb
mount $dev $mnt -o enospc_debug
start_trace &
trace_pid=$!
/home/adam/xfstests-dev/ltp/fsstress -d $mnt -w -n 10000000 -p 4 &
sleep 120
killall -KILL fsstress
kill $trace_pid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment