summaryrefslogtreecommitdiffstats
path: root/nfs/nfs-slowness.stp
blob: e1132689c61cbc955ee37d0e1389b0ba5ed8b5b7 (plain)
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
global time
global threshold=2 /* milliseconds */
global nesting
probe nfs.fop.entries { 
	tid=tid()
	n=nesting[tid]++
	time[tid,n] = gettimeofday_ms()
}
probe nfs.fop.return { 
	tid=tid()
	n = (nesting[tid] = nesting[tid]-1)
	if (n < 0) { 
		nesting[tid]=0; next 
	} // missed entry event
	if (! ([tid,n] in time)) next // missed entry event
	dt = gettimeofday_ms()-time[tid,n]
	delete time[tid,n]
	if (dt>threshold) { 
		printf("%s(%d) %s took too long (%d > %d)\n",
		execname(), tid, name, dt, threshold)
	} 
}

probe begin { log("starting nfs-slowness probe") }
probe end { log("ending nfs-slowness probe") }