socket: Add KTR_SOWAKEUP
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Thu, 25 Dec 2014 11:16:46 +0000 (19:16 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 27 Dec 2014 07:00:33 +0000 (15:00 +0800)
Define 2 pairs of children nodes for this KTR, which are used to tracking
extra IPIs for accept(2).

Note:
The tracked sorwakeup() and the wakeup(so_timeo) does not generate extra
(wakeup) IPIs.

sys/conf/options
sys/config/LINT64
sys/kern/uipc_socket2.c

index b67d179..011abcc 100644 (file)
@@ -577,6 +577,7 @@ KTR_USCHED_DFLY                     opt_ktr.h
 KTR_VERBOSE                    opt_ktr.h
 KTR_IF_POLL                    opt_ktr.h
 KTR_UDP                                opt_ktr.h
+KTR_SOWAKEUP                   opt_ktr.h
 
 # NTFS options
 NTFS_DEBUG                     opt_ntfs.h
index 9ddb32a..8df428c 100644 (file)
@@ -2280,6 +2280,7 @@ options   KTR_VERBOSE=1
 #options KTR_KERNENTRY
 #options KTR_MEMORY
 #options KTR_SERIALIZER
+#options KTR_SOWAKEUP
 #options KTR_SPIN_CONTENTION
 #options KTR_TESTLOG
 #options KTR_TOKENS
index f24ee15..7ad2c51 100644 (file)
@@ -38,6 +38,7 @@
 #include <sys/domain.h>
 #include <sys/file.h>  /* for maxfiles */
 #include <sys/kernel.h>
+#include <sys/ktr.h>
 #include <sys/proc.h>
 #include <sys/malloc.h>
 #include <sys/mbuf.h>
 
 #include <net/netisr2.h>
 
+#ifndef KTR_SOWAKEUP
+#define KTR_SOWAKEUP   KTR_ALL
+#endif
+KTR_INFO_MASTER(sowakeup);
+KTR_INFO(KTR_SOWAKEUP, sowakeup, nconn_start, 0, "newconn sorwakeup start");
+KTR_INFO(KTR_SOWAKEUP, sowakeup, nconn_end, 1, "newconn sorwakeup end");
+KTR_INFO(KTR_SOWAKEUP, sowakeup, nconn_wakeupstart, 2, "newconn wakeup start");
+KTR_INFO(KTR_SOWAKEUP, sowakeup, nconn_wakeupend, 3, "newconn wakeup end");
+#define logsowakeup(name)      KTR_LOG(sowakeup_ ## name)
+
 int    maxsockets;
 
 /*
@@ -440,8 +451,14 @@ sonewconn_faddr(struct socket *head, int connstatus,
                 * XXX head may be on a different protocol thread.
                 *     sorwakeup()->sowakeup() is hacked atm.
                 */
+               logsowakeup(nconn_start);
                sorwakeup(head);
+               logsowakeup(nconn_end);
+
+               logsowakeup(nconn_wakeupstart);
                wakeup((caddr_t)&head->so_timeo);
+               logsowakeup(nconn_wakeupend);
+
                sosetstate(so, connstatus);
        }
        soclrstate(so, SS_ASSERTINPROG);