[dtrace-discuss] DTrace: Printing pid of the process when tcpListenDrop is incremented

Amer Ather Amer.Ather at Sun.COM
Thu Nov 16 12:41:25 PST 2006


IHAC who is seeing high number of tcpListenDrop events. There are
multiple servers are running on the system. He likes to know the pid of
the process that has its listen backlog full and responsible for
triggering the tcpListenDrop event. tcpListenDrop counter is logged in


tcp_conn_request(void *arg, mblk_t *mp, void *arg2)
{
....
if (tcp->tcp_conn_req_cnt_q >= tcp->tcp_conn_req_max) {
                mutex_exit(&tcp->tcp_eager_lock);
                TCP_STAT(tcp_listendrop);  <<<<<<
                BUMP_MIB(&tcp_mib, tcpListenDrop);
...
}

My question is how one can get pid from conn_t or tcp_t structure so
that we know which process backlog size execeeds the max size.

#!/usr/sbin/dtrace -s

#pragma D option quiet

fbt:ip:tcp_conn_request:entry
{
        self->connp = (conn_t *)arg0;
        self->tcp   = (tcp_t *)self->connp->conn_tcp;


@backlog[self->tcp->tcp_conn_req_cnt_q,self->tcp->tcp_conn_req_max]=count();

printf("\ntcp_conn_req_cnt_q: %d\n", self->tcp->tcp_conn_req_cnt_q);
printf("\ntcp_conn_req_max: %d\n", self->tcp->tcp_conn_req_max);

}

Thanks,
-- 
Amer Ather	
PTS-KERNEL     			
amer.ather at Sun.COM		
408-276-9780 (x19780)				
Pager: 888-242-1324
email-pager: 8882421324 at archwireless.net

	" In theory, there is no difference between theory and practice,
	  but in practice, there is."
					-Jan L.A. van de Snepscheut


More information about the dtrace-discuss mailing list