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") }