-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathfcrwtime.d
More file actions
executable file
·44 lines (35 loc) · 851 Bytes
/
fcrwtime.d
File metadata and controls
executable file
·44 lines (35 loc) · 851 Bytes
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
#!/usr/sbin/dtrace -s
/*
* adapted from iscsirwtime.d to show read/write data for fibre channel
*/
#pragma D option quiet
inline int TOP_TARGETS = 10;
dtrace:::BEGIN
{
printf("Tracing FC target... Hit Ctrl-C to end.\n");
}
fc:::xfer-start
{
start[arg1] = timestamp;
}
fc:::xfer-done
/start[arg1] != 0/
{
this->elapsed = timestamp - start[arg1];
@rw[arg8 ? "read" : "write"] = quantize(this->elapsed / 1000);
@host[args[0]->ci_remote] = sum(this->elapsed);
@targ[args[0]->ci_local] = sum(this->elapsed);
start[arg1] = 0;
}
dtrace:::END
{
printf("FC read/write distributions (us):\n");
printa(@rw);
printf("\nFC read/write by client (total us):\n");
normalize(@host, 1000);
printa(@host);
printf("\nFC read/write top %d targets (total us):\n", TOP_TARGETS);
normalize(@targ, 1000);
trunc(@targ, TOP_TARGETS);
printa(@targ);
}