/usr/share/systemtap/examples/network
NameSizeModeActions
autofs4.meta3970644editdlrm
autofs4.stp41670755editdlrm
connect_stat.meta4040644editdlrm
connect_stat.stp10190755editdlrm
dropwatch.meta4940644editdlrm
dropwatch.stp9000755editdlrm
netdev.meta3890644editdlrm
netdev.stp14580755editdlrm
netfilter_drop.meta6300644editdlrm
netfilter_drop.stp11560755editdlrm
netfilter_summary.meta5870644editdlrm
netfilter_summary.stp5910755editdlrm
netfilter_summary.txt28730644editdlrm
netfilter_summary_json.meta5110644editdlrm
netfilter_summary_json.stp10700644editdlrm
nettop.meta5190644editdlrm
nettop.stp9890755editdlrm
nettop.txt9530644editdlrm
net_xmit_json.meta4530644editdlrm
net_xmit_json.stp18010644editdlrm
nfsd-recent.meta4230644editdlrm
nfsd-recent.stp4420755editdlrm
nfsd-trace.meta3140644editdlrm
nfsd-trace.stp7010644editdlrm
nfsd-trace.txt8760644editdlrm
nfsdtop.meta4050644editdlrm
nfsdtop.stp33850755editdlrm
nfsd_unlink.meta4790644editdlrm
nfsd_unlink.stp5230755editdlrm
packet_contents.meta5500644editdlrm
packet_contents.stp2160755editdlrm
packet_contents.txt20660644editdlrm
sk_stream_wait_memory.meta7420644editdlrm
sk_stream_wait_memory.stp9990755editdlrm
socket-trace.meta7020644editdlrm
socket-trace.stp2220755editdlrm
socktop91440755editdlrm
socktop.meta5480644editdlrm
socktop.txt41350644editdlrm
stp_dump.meta3390644editdlrm
stp_dump.stp5680644editdlrm
stp_dump.txt16320644editdlrm
tcpdumplike.meta3810644editdlrm
tcpdumplike.stp5810755editdlrm
tcpipstat.meta7250644editdlrm
tcpipstat.stp182470755editdlrm
tcpipstat.txt8980644editdlrm
tcp_connections.meta6250644editdlrm
tcp_connections.stp3610755editdlrm
tcp_init_cwnd.meta5890644editdlrm
tcp_init_cwnd.stp3430755editdlrm
tcp_retransmission.meta2860644editdlrm
tcp_retransmission.stp11820644editdlrm
tcp_trace.meta6840644editdlrm
tcp_trace.stp190950755editdlrm
tcp_trace.txt34650644editdlrm
who_sent_it.meta5830644editdlrm
who_sent_it.stp4770644editdlrm
who_sent_it.txt8030644editdlrm
Edit: /usr/share/systemtap/examples/network/nfsdtop.stp (3385B)
#!/usr/bin/stap # nfsd global counters global nfsd_lookups global nfsd_reads global nfsd_writes global nfsd_creates global nfsd_commits global nfsd_removes # nfsd client tables global nfsd_lookup_clients global nfsd_lookup_clients_last_file global nfsd_read_clients global nfsd_write_clients # Accumulate lookup stats # Keep a count of lookups globally and by client_ip # also keep track of the last file looked up by each # client_ip probe nfsd.proc.lookup { nfsd_lookups <<< 1 nfsd_lookup_clients[client_ip] <<< 1 # If no command line argument is provided, remember the last # directory name and filename ('foo/bar.c') of the lookup. If # a command line argument was provided, remember the full # pathname of the last lookup ('/home/user/foo/bar.c'). %( $# == 0 %? nfsd_lookup_clients_last_file[client_ip] = sprintf("%s/%s", d_name(fh->fh_dentry), filename) %: nfsd_lookup_clients_last_file[client_ip] = sprintf("%s/%s", task_dentry_path(task_current(), fh->fh_dentry, fh->fh_export->ex_path->mnt), filename) %) } # Accumulate read stats # Keep a count of reads globally and by client_ip # also keep track of the number of bytes read globally # and per-client_ip probe nfsd.proc.read { nfsd_reads <<< size nfsd_read_clients[client_ip] <<< size } # Accumulate write stats # Keep a count of writes globally and by client_ip # also keep track of the number of bytes writen globally # and per-client_ip probe nfsd.proc.write { nfsd_writes <<< size nfsd_write_clients[client_ip] <<< size } # Just count creates for now probe nfsd.proc.create { nfsd_creates <<< 1 } # Just count commits for now probe nfsd.proc.commit { nfsd_commits <<< 1 } # Just count removes for now probe nfsd.proc.remove { nfsd_removes <<< 1 } # This is our "main loop" executed once every $interval # We clear the terminal (top-style screen updates) and then # to write out all our stats areas as fast as possible. # Currently there are three sections: # # Global stats # Top 10 lookup clients # Top 10 reading clients # Top 10 writing clients # probe timer.ms(1000) { ansi_clear_screen() print("\n") printf("lookups : %8d\n", @count(nfsd_lookups)) printf("reads : %8d\n", @count(nfsd_reads)) printf("r/bytes : %8d KiB\n", @sum(nfsd_reads) >> 10) printf("writes : %8d\n", @count(nfsd_writes)) printf("w/bytes : %8d KiB\n", @sum(nfsd_writes) >> 10) printf("creates : %8d\n", @count(nfsd_creates)) printf("commits : %8d\n", @count(nfsd_commits)) printf("removes : %8d\n", @count(nfsd_removes)) printf("\n") print("lookups\n") printf("client\t\t\tlast file\n") foreach (ip in nfsd_lookup_clients- limit 10) printf("%s\t%s\n", ip, nfsd_lookup_clients_last_file[ip]) print("\n") print("reads\n") printf("client\t\t\treads\tbytes\n") foreach (ip in nfsd_read_clients- limit 10) printf("%s\t%d\t%d\n", ip, @count(nfsd_read_clients[ip]), @sum(nfsd_read_clients[ip])) print("\n") printf("writes\n") printf("client\t\t\twrites\tbytes\n") foreach (ip in nfsd_write_clients- limit 10) printf("%s\t%d\t%d\n", ip, @count(nfsd_write_clients[ip]), @sum(nfsd_write_clients[ip])) delete nfsd_lookups delete nfsd_reads delete nfsd_writes delete nfsd_creates delete nfsd_commits delete nfsd_removes delete nfsd_lookup_clients delete nfsd_lookup_clients_last_file delete nfsd_read_clients delete nfsd_write_clients }