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