-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathplot-nfs-commit.sh
executable file
·75 lines (57 loc) · 1.84 KB
/
plot-nfs-commit.sh
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
69
70
71
72
73
74
75
#!/bin/bash
for dir
do
# flush-0:23-2648 [002] 331.554492: nfs_commit_unstable_pages: bdi 0:23: ino=7307267 npages=105770 tocommit=4 write_chunk=8192 sync=0 ret=16371
# kworker/5:1-418 [005] 103.526752: nfs_commit_release: bdi 0:21: ino=2614859 offset=0 len=1
plot() {
send=$1
release=$2
suffix=$3
gnuplot <<EOF
set size 1
set terminal pngcairo size ${width:-1280}, 800
set output "nfs-commit$suffix.png"
set xlabel "time (s)"
set ylabel "commit size (MB)"
plot "$send" using 1:(\$5/256) with steps title "write chunk", \
"$send" using 1:(\$7/256) with points pt 5 ps 0.6 title "send commit", \
"$release" using 1:(\$4/256) with points pt 2 ps 0.6 title "release commit"
EOF
}
trace_file=trace.bz2
cd $dir
bzcat $trace_file | grep -qF "nfs_commit_unstable_pages" || exit 1
bzcat $trace_file | grep -F "nfs_commit_unstable_pages" |\
grep -vF 'bdi 0:15:' |\
grep -vF 'ret=0' |\
sed 's/.*\]//' |\
sed 's/bdi [^ ]\+//' |\
sed 's/[^0-9.-]\+/ /g' > trace-commit
[[ $? -eq 0 ]] || exit
bzcat $trace_file | grep -F "nfs_commit_release" |\
grep -vF 'bdi 0:15:' |\
sed 's/.*\]//' |\
sed 's/bdi.[^ ]\+//' |\
sed 's/[^0-9.-]\+/ /g' > trace-commit-release
plot trace-commit trace-commit-release
# grep -F "nfs_commit" $trace_file |\
# grep -vF "ret=0" > trace-commit-nonzero
# tail -n 300 < trace-commit-nonzero > trace-commit-nonzero-300
# trace_file=trace-commit-nonzero-300
# grep -F "nfs_commit_unstable_pages" $trace_file |\
# sed 's/.*\]//' |\
# sed 's/bdi.[^ ]\+//' |\
# sed 's/[^0-9.-]\+/ /g' > trace-commit-300
#
# grep -F "nfs_commit_release" $trace_file |\
# sed 's/.*\]//' |\
# sed 's/bdi.[^ ]\+//' |\
# sed 's/[^0-9.-]\+/ /g' > trace-commit-release-300
#
# plot trace-commit trace-commit-release -300
if [[ $lines -ge 300 ]]; then
width=6400
plot trace-commit trace-commit-release +
fi
cd ..
done