-
Notifications
You must be signed in to change notification settings - Fork 5
/
nfsv3rwsnoop-2.d
executable file
·33 lines (32 loc) · 1.04 KB
/
nfsv3rwsnoop-2.d
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
#!/usr/sbin/dtrace -s
#pragma D option quiet
#pragma D option switchrate=10hz
dtrace:::BEGIN
{
printf("%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n",
"time(us)", "time",
"client", "r/w", "offset", "end", "bytes",
"4K-aligned", "4K-size", "filename");
}
nfsv3:::op-read-start
{
printf("%d\t%Y\t%s\t%s\t%d\t%d\t%d\t%s\t%s\t%s\n",
timestamp / 1000, walltimestamp,
args[0]->ci_remote, "R", args[2]->offset,
args[2]->offset + args[2]->count,
args[2]->count,
(args[2]->offset % 4096) == 0 ? "1" : "0",
(args[2]->count % 4096) == 0 ? "1" : "0",
args[1]->noi_curpath);
}
nfsv3:::op-write-start
{
printf("%d\t%Y\t%s\t%s\t%d\t%d\t%d\t%s\t%s\t%s\n",
timestamp / 1000, walltimestamp,
args[0]->ci_remote, "W", args[2]->offset,
args[2]->offset + args[2]->data.data_len,
args[2]->data.data_len,
(args[2]->offset % 4096) == 0 ? "1" : "0",
(args[2]->data.data_len % 4096) == 0 ? "1" : "0",
args[1]->noi_curpath);
}