-
Notifications
You must be signed in to change notification settings - Fork 3
/
smb_kstat.d
executable file
·40 lines (33 loc) · 818 Bytes
/
smb_kstat.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
#!/usr/sbin/dtrace -qs
/*
* smb_kstat.d
*
* This script prints SMB kstats.
*
* Tony Nguyen <[email protected]>
*
*/
dtrace:::BEGIN
{
/*
r_iops = 1;
rtask = 0;
rqtime = 0;
r_lu_xfer = 0;
r_lport_xfer = 0;
*/
users=0; files=0; pipes=0; nreq1=0; nreq2=0;
printf("users files pipes nreqs");
}
fbt::smb_server_kstat_update:entry
{
self->sv = (smb_server_t *) args[0]->ks_private;
/* self->ksd = (smbsrv_kstat_t *) args[0]->ks_data; */
/*@[self->sv->sv_users, self->sv->sv_files, self->sv->sv_pipes,
self->sv->nreqs] = count(); */
users = self->sv->sv_users;
files = self->sv->sv_files;
pipes = self->sv->sv_pipes;
nreq1 = nreq2; nreq2 = self->sv->sv_nreq;
}
profile:::tick-2sec {printf("\n%-7d %-7d %-7d %-10d", users, files, pipes, nreq2 - nreq1);}