forked from kdavyd/dtrace
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsvc_flowcontrol.d
48 lines (41 loc) · 1001 Bytes
/
svc_flowcontrol.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/sbin/dtrace
#pragma D option quiet
/* Description: Track amount of times NFS QoS has throttled clients. */
/* USAGE: dtrace -p `pgrep rpcbind` -s svc_flowcontrol.d */
/* Author: [email protected] */
/* Copyright 2015, Nexenta Systems, Inc. All rights reserved. */
/* Version: 0.1 */
dtrace:::BEGIN
/`svc_flowcontrol_disable == 1/
{
trace("NFS flow control is disabled on this system, no point in tracing. Exiting.");
exit(0);
}
dtrace:::BEGIN
{
@thr=count();
clear(@thr);
}
fbt:rpcmod:svc_flowcontrol:entry
{
self->in = 1;
self->xprt = args[0];
}
fbt:rpcmod:svc_flowcontrol:return
/self->in && self->xprt->xp_full/
{
self->in = 0;
@thr = count();
self->xprt = NULL;
}
fbt:rpcmod:svc_flowcontrol:return
/self->in && !self->xprt->xp_full/
{
self->in = 0;
self->xprt = NULL;
}
tick-5sec
{
printf("%Y ",walltimestamp);
printa("NFS QoS Throttles: %@d\n",@thr);clear(@thr);
}