Предполагая, что у вас установлен SystemTap
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);
}
, сохраненный как whomakeconnect.stp
будет показывать вызовы connect
при запуске с stap
как корень
# stap-prep
... fix anything reported, it requires debug kernels ...
# stap whomakeconnect.stp