diff options
author | William Cohen <wcohen@localhost.localdomain> | 2008-04-24 12:20:13 -0400 |
---|---|---|
committer | William Cohen <wcohen@localhost.localdomain> | 2008-04-24 12:20:13 -0400 |
commit | 7f79ea13a0f64573ce13353257d322ae49ef0c27 (patch) | |
tree | 60de8da5af4c2bcc26abfb9430fdca66bdc20b98 /examples/nettop.stp | |
parent | f90f92615df6ff2a62282359281889597e5dbf17 (diff) | |
download | systemtap-steved-7f79ea13a0f64573ce13353257d322ae49ef0c27.tar.gz systemtap-steved-7f79ea13a0f64573ce13353257d322ae49ef0c27.tar.xz systemtap-steved-7f79ea13a0f64573ce13353257d322ae49ef0c27.zip |
Move examples to testsuite/systemtap.examples
Diffstat (limited to 'examples/nettop.stp')
-rwxr-xr-x | examples/nettop.stp | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/examples/nettop.stp b/examples/nettop.stp deleted file mode 100755 index 96db413a..00000000 --- a/examples/nettop.stp +++ /dev/null @@ -1,42 +0,0 @@ -#! /usr/bin/env stap - -global ifxmit, ifrecv - -probe netdev.transmit -{ - ifxmit[pid(), dev_name, execname(), uid()] <<< length -} - -probe netdev.receive -{ - ifrecv[pid(), dev_name, execname(), uid()] <<< length -} - - -function print_activity() -{ - printf("%5s %5s %-7s %7s %7s %7s %7s %-15s\n", - "PID", "UID", "DEV", "XMIT_PK", "RECV_PK", - "XMIT_KB", "RECV_KB", "COMMAND") - - foreach ([pid, dev, exec, uid] in ifrecv-) { - n_xmit = @count(ifxmit[pid, dev, exec, uid]) - n_recv = @count(ifrecv[pid, dev, exec, uid]) - printf("%5d %5d %-7s %7d %7d %7d %7d %-15s\n", - pid, uid, dev, n_xmit, n_recv, - n_xmit ? @sum(ifxmit[pid, dev, exec, uid])/1024 : 0, - n_recv ? @sum(ifrecv[pid, dev, exec, uid])/1024 : 0, - exec) - } - - print("\n") - - delete ifxmit - delete ifrecv -} - -probe timer.ms(5000), end, error -{ - print_activity() -} - |