Supondo que você tenha o SystemTap instalado
probe begin {
printf("ok\n");
}
probe syscall.connect {
# connect however may fail or flail around in a EINPROGRESS state;
# this log only indicates that a connect was attempted
if (uaddr_af == "AF_INET" || uaddr_af == "AF_INET6")
printf("%s[%d]: %s\n", execname(), pid(), argstr);
}
probe syscall.connect.return {
printf(" -> %s[%d]: %s\n", execname(), pid(), retstr);
}
salvo como whomakeconnect.stp
mostrará connect
chamadas quando executado com stap
as root
# stap-prep
... fix anything reported, it requires debug kernels ...
# stap whomakeconnect.stp