#probe kernel.function("unix_accept")
%{
#include <net/sock.h>
#include <net/af_unix.h>
%}
function _unix_path:long(sock:long)
%{
struct socket *sock = (struct socket *)(long) STAP_ARG_sock;
struct sock *sk = sock->sk;
struct unix_sock *u = unix_sk(sk);
char* s = NULL;
if (u->addr)
{
if (u->addr->name)
{
s = (char *)u->addr->name->sun_path;
}
}
THIS->__retvalue =(unsigned long)s;
%}
global _dvs_pid=188980
probe kernel.statement("*@net/socket.c:1634")
{
_pid= pid()
if(_dvs_pid == _pid)
{
printf(">>accept:1634 pid[%d] newsock[%x] newfd[%d]\n", _pid, $newsock, $newfd)
print_backtrace()
}
}
probe kernel.statement("*@net/socket.c:1612")
{
_pid= pid()
if(_dvs_pid == _pid)
{
printf(">>accept:1612 pid[%d] newsock[%x] newfd[%d]\n", _pid, $newsock, $newfd)
}
}
probe kernel.function("sys_accept4").return
{
_pid=pid()
if(_dvs_pid == _pid)
printf(">>%d\n", $return)
}