Debian Codegraph @

testsuite/systemtap.examples/network/nfsd-recent.stp

raw
1 #! /usr/bin/env stap
2
3 global times%,op% /* arrays indexed by client-ip */
4 global maxage=300 /* seconds */
5
6 probe nfsd.proc.entries, nfsd.entries {
7 times[client_ip] = gettimeofday_s()
8 op[client_ip] = name /* operation name */
9 }
10 probe end, error, timer.s(10) {
11 printf("\n")
12 foreach (ip in times-)
13 if (times[ip] > (gettimeofday_s()-maxage)) /* recent enough */
14 printf("%s %s %s\n", ctime(times[ip]), ip, op[ip])
15 }