| Server IP : 104.21.25.180 / Your IP : 104.23.197.122 Web Server : Apache/2.4.37 System : Linux almalinux.duckdns.org 4.18.0-553.111.1.el8_10.x86_64 #1 SMP Sun Mar 8 20:06:07 EDT 2026 x86_64 User : ricodeal ( 1046) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/systemtap/examples/network/ |
Upload File : |
#!/usr/bin/stap
global ifxmit, ifrecv
global ifmerged
probe netdev.transmit
{
ifxmit[pid(), dev_name, execname(), uid()] <<< length
ifmerged[pid(), dev_name, execname(), uid()] <<< 1
}
probe netdev.receive
{
ifrecv[pid(), dev_name, execname(), uid()] <<< length
ifmerged[pid(), dev_name, execname(), uid()] <<< 1
}
function print_activity()
{
printf("%5s %5s %-12s %7s %7s %7s %7s %-15s\n",
"PID", "UID", "DEV", "XMIT_PK", "RECV_PK",
"XMIT_KB", "RECV_KB", "COMMAND")
foreach ([pid, dev, exec, uid] in ifmerged-) {
n_xmit = @count(ifxmit[pid, dev, exec, uid])
n_recv = @count(ifrecv[pid, dev, exec, uid])
printf("%5d %5d %-12s %7d %7d %7d %7d %-15s\n",
pid, uid, dev, n_xmit, n_recv,
@sum(ifxmit[pid, dev, exec, uid])/1024,
@sum(ifrecv[pid, dev, exec, uid])/1024,
exec)
}
print("\n")
delete ifxmit
delete ifrecv
delete ifmerged
}
probe timer.ms(5000), end, error
{
print_activity()
}