aboutsummaryrefslogtreecommitdiff
path: root/storage/dump_storage.sh
blob: 5f08fc134b343657cdd34cb64f6cc69ddbe160c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/vendor/bin/sh
# F2FS
echo "--- F2FS status---"
cat "/sys/kernel/debug/f2fs/status"
echo "\n--- F2FS fsck ---"
cat "/dev/fscklogs/fsck"
echo "\n--- F2FS - fsck time (ms) ---"
getprop ro.boottime.init.fsck.data
echo "\n--- F2FS - checkpoint=disable time (ms) ---"
getprop ro.boottime.init.mount.data

# UFS
echo "\n------ UFS model (/sys/block/sda/device/model) ------"
cat "/sys/block/sda/device/model"
echo "\n------ UFS rev (/sys/block/sda/device/rev) ------"
cat "/sys/block/sda/device/rev"
echo "\n------ UFS size (/sys/block/sda/size) ------"
cat "/sys/block/sda/size"

echo "\n------ UFS Slow IO Read (/dev/sys/block/bootdevice/slowio_read_cnt) ------"
cat "/dev/sys/block/bootdevice/slowio_read_cnt"
echo "\n------ UFS Slow IO Write (/dev/sys/block/bootdevice/slowio_write_cnt) ------"
cat "/dev/sys/block/bootdevice/slowio_write_cnt"
echo "\n------ UFS Slow IO Unmap (/dev/sys/block/bootdevice/slowio_unmap_cnt) ------"
cat "/dev/sys/block/bootdevice/slowio_unmap_cnt"
echo "\n------ UFS Slow IO Sync (/dev/sys/block/bootdevice/slowio_sync_cnt) ------"
cat "/dev/sys/block/bootdevice/slowio_sync_cnt"

echo "\n------ UFS err_stats ------"
path="/dev/sys/block/bootdevice/err_stats";
for node in `ls $path/* | grep -v reset_err_status`
do
  printf "%s:%d\n" $(basename $node) $(cat $node)
done


echo "\n------ UFS io_stats ------"
path="/dev/sys/block/bootdevice/io_stats"
printf "\t\t%-12s %-12s %-12s %-12s %-12s %-12s\n" ReadCnt ReadBytes WriteCnt WriteBytes RWCnt RWBytes
str=$(cat $path/*_start); arr=($str);
printf "Started: \t%-12s %-12s %-12s %-12s %-12s %-12s\n" ${arr[1]} ${arr[0]} ${arr[5]} ${arr[4]} ${arr[3]} ${arr[2]}
str=$(cat $path/*_complete); arr=($str);
printf "Completed: \t%-12s %-12s %-12s %-12s %-12s %-12s\n" ${arr[1]} ${arr[0]} ${arr[5]} ${arr[4]} ${arr[3]} ${arr[2]}
str=$(cat $path/*_maxdiff); arr=($str);
printf "MaxDiff: \t%-12s %-12s %-12s %-12s %-12s %-12s\n\n" ${arr[1]} ${arr[0]} ${arr[5]} ${arr[4]} ${arr[3]} ${arr[2]}

echo "\n------ UFS req_stats ------"
path="/dev/sys/block/bootdevice/req_stats"
printf "\t%-12s %-12s %-12s %-12s %-12s %-12s\n" All Write Read Security Flush Discard
str=$(cat $path/*_min); arr=($str);
printf "Min:\t%-12s %-12s %-12s %-12s %-12s %-12s\n" ${arr[0]} ${arr[5]} ${arr[3]} ${arr[4]} ${arr[2]} ${arr[1]}
str=$(cat $path/*_max); arr=($str);
printf "Max:\t%-12s %-12s %-12s %-12s %-12s %-12s\n" ${arr[0]} ${arr[5]} ${arr[3]} ${arr[4]} ${arr[2]} ${arr[1]}
str=$(cat $path/*_avg); arr=($str);
printf "Avg.:\t%-12s %-12s %-12s %-12s %-12s %-12s\n" ${arr[0]} ${arr[5]} ${arr[3]} ${arr[4]} ${arr[2]} ${arr[1]}
str=$(cat $path/*_sum); arr=($str);
printf "Count:\t%-12s %-12s %-12s %-12s %-12s %-12s\n\n" ${arr[0]} ${arr[5]} ${arr[3]} ${arr[4]} ${arr[2]} ${arr[1]}

echo "\n------ UFS health ------"
for f in $(find /dev/sys/block/bootdevice/health_descriptor -type f)
do
  if [[ -r $f && -f $f ]]; then
    echo --- $f
    cat $f
    echo ''
  fi
done