Adam Shih | 2628922 | 2022-09-23 10:54:11 +0800 | [diff] [blame] | 1 | #!/vendor/bin/sh |
| 2 | # F2FS |
| 3 | echo "--- F2FS status---" |
| 4 | cat "/sys/kernel/debug/f2fs/status" |
| 5 | echo "\n--- F2FS fsck ---" |
| 6 | cat "/dev/fscklogs/fsck" |
| 7 | echo "\n--- F2FS - fsck time (ms) ---" |
| 8 | getprop ro.boottime.init.fsck.data |
| 9 | echo "\n--- F2FS - checkpoint=disable time (ms) ---" |
| 10 | getprop ro.boottime.init.mount.data |
Adam Shih | 708d25e | 2022-09-28 13:16:25 +0800 | [diff] [blame] | 11 | |
| 12 | # UFS |
| 13 | echo "\n------ UFS model (/sys/block/sda/device/model) ------" |
| 14 | cat "/sys/block/sda/device/model" |
| 15 | echo "\n------ UFS rev (/sys/block/sda/device/rev) ------" |
| 16 | cat "/sys/block/sda/device/rev" |
| 17 | echo "\n------ UFS size (/sys/block/sda/size) ------" |
| 18 | cat "/sys/block/sda/size" |
| 19 | |
| 20 | echo "\n------ UFS Slow IO Read (/dev/sys/block/bootdevice/slowio_read_cnt) ------" |
| 21 | cat "/dev/sys/block/bootdevice/slowio_read_cnt" |
| 22 | echo "\n------ UFS Slow IO Write (/dev/sys/block/bootdevice/slowio_write_cnt) ------" |
| 23 | cat "/dev/sys/block/bootdevice/slowio_write_cnt" |
| 24 | echo "\n------ UFS Slow IO Unmap (/dev/sys/block/bootdevice/slowio_unmap_cnt) ------" |
| 25 | cat "/dev/sys/block/bootdevice/slowio_unmap_cnt" |
| 26 | echo "\n------ UFS Slow IO Sync (/dev/sys/block/bootdevice/slowio_sync_cnt) ------" |
| 27 | cat "/dev/sys/block/bootdevice/slowio_sync_cnt" |
| 28 | |
| 29 | echo "\n------ UFS err_stats ------" |
| 30 | path="/dev/sys/block/bootdevice/err_stats"; |
| 31 | for node in `ls $path/* | grep -v reset_err_status` |
| 32 | do |
| 33 | printf "%s:%d\n" $(basename $node) $(cat $node) |
| 34 | done |
| 35 | |
| 36 | |
| 37 | echo "\n------ UFS io_stats ------" |
| 38 | path="/dev/sys/block/bootdevice/io_stats" |
| 39 | printf "\t\t%-12s %-12s %-12s %-12s %-12s %-12s\n" ReadCnt ReadBytes WriteCnt WriteBytes RWCnt RWBytes |
| 40 | str=$(cat $path/*_start); arr=($str); |
| 41 | printf "Started: \t%-12s %-12s %-12s %-12s %-12s %-12s\n" ${arr[1]} ${arr[0]} ${arr[5]} ${arr[4]} ${arr[3]} ${arr[2]} |
| 42 | str=$(cat $path/*_complete); arr=($str); |
| 43 | printf "Completed: \t%-12s %-12s %-12s %-12s %-12s %-12s\n" ${arr[1]} ${arr[0]} ${arr[5]} ${arr[4]} ${arr[3]} ${arr[2]} |
| 44 | str=$(cat $path/*_maxdiff); arr=($str); |
| 45 | printf "MaxDiff: \t%-12s %-12s %-12s %-12s %-12s %-12s\n\n" ${arr[1]} ${arr[0]} ${arr[5]} ${arr[4]} ${arr[3]} ${arr[2]} |
| 46 | |
| 47 | echo "\n------ UFS req_stats ------" |
| 48 | path="/dev/sys/block/bootdevice/req_stats" |
| 49 | printf "\t%-12s %-12s %-12s %-12s %-12s %-12s\n" All Write Read Security Flush Discard |
| 50 | str=$(cat $path/*_min); arr=($str); |
| 51 | printf "Min:\t%-12s %-12s %-12s %-12s %-12s %-12s\n" ${arr[0]} ${arr[5]} ${arr[3]} ${arr[4]} ${arr[2]} ${arr[1]} |
| 52 | str=$(cat $path/*_max); arr=($str); |
| 53 | printf "Max:\t%-12s %-12s %-12s %-12s %-12s %-12s\n" ${arr[0]} ${arr[5]} ${arr[3]} ${arr[4]} ${arr[2]} ${arr[1]} |
| 54 | str=$(cat $path/*_avg); arr=($str); |
| 55 | printf "Avg.:\t%-12s %-12s %-12s %-12s %-12s %-12s\n" ${arr[0]} ${arr[5]} ${arr[3]} ${arr[4]} ${arr[2]} ${arr[1]} |
| 56 | str=$(cat $path/*_sum); arr=($str); |
| 57 | printf "Count:\t%-12s %-12s %-12s %-12s %-12s %-12s\n\n" ${arr[0]} ${arr[5]} ${arr[3]} ${arr[4]} ${arr[2]} ${arr[1]} |
| 58 | |
| 59 | echo "\n------ UFS health ------" |
| 60 | for f in $(find /dev/sys/block/bootdevice/health_descriptor -type f) |
| 61 | do |
| 62 | if [[ -r $f && -f $f ]]; then |
| 63 | echo --- $f |
| 64 | cat $f |
| 65 | echo '' |
| 66 | fi |
| 67 | done |
| 68 | |