Remove kqueue-related ktrace points from poll(2) and select(2)
authorvisa <visa@openbsd.org>
Tue, 16 Aug 2022 13:32:16 +0000 (13:32 +0000)
committervisa <visa@openbsd.org>
Tue, 16 Aug 2022 13:32:16 +0000 (13:32 +0000)
These ktrace points do not seem useful any longer because the new
implementation of poll(2) and select(2) appears to work well.

OK deraadt@ mpi@

sys/kern/sys_generic.c

index 6828259..c8bba8d 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: sys_generic.c,v 1.149 2022/08/14 01:58:28 jsg Exp $   */
+/*     $OpenBSD: sys_generic.c,v 1.150 2022/08/16 13:32:16 visa Exp $  */
 /*     $NetBSD: sys_generic.c,v 1.24 1996/03/29 00:25:32 cgd Exp $     */
 
 /*
@@ -686,10 +686,7 @@ dopselect(struct proc *p, int nd, fd_set *in, fd_set *ou, fd_set *ex,
                /* Maximum number of events per iteration */
                count = MIN(nitems(kev), nevents);
                ready = kqueue_scan(&scan, count, kev, timeout, p, &error);
-#ifdef KTRACE
-               if (KTRPOINT(p, KTR_STRUCT))
-                       ktrevent(p, kev, ready);
-#endif
+
                /* Convert back events that are ready. */
                for (i = 0; i < ready && error == 0; i++)
                        error = pselcollect(p, &kev[i], pobits, &ncollected);
@@ -757,10 +754,6 @@ pselregister(struct proc *p, fd_set *pibits[3], fd_set *pobits[3], int nfd,
                                EV_SET(&kev, fd, evf[msk],
                                    EV_ADD|EV_ENABLE|__EV_SELECT,
                                    evff[msk], 0, (void *)(p->p_kq_serial));
-#ifdef KTRACE
-                               if (KTRPOINT(p, KTR_STRUCT))
-                                       ktrevent(p, &kev, 1);
-#endif
                                error = kqueue_register(p->p_kq, &kev, 0, p);
                                switch (error) {
                                case 0:
@@ -996,10 +989,7 @@ doppoll(struct proc *p, struct pollfd *fds, u_int nfds,
                /* Maximum number of events per iteration */
                count = MIN(nitems(kev), nevents);
                ready = kqueue_scan(&scan, count, kev, timeout, p, &error);
-#ifdef KTRACE
-               if (KTRPOINT(p, KTR_STRUCT))
-                       ktrevent(p, kev, ready);
-#endif
+
                /* Convert back events that are ready. */
                for (i = 0; i < ready; i++)
                        ncollected += ppollcollect(p, &kev[i], pl, nfds);
@@ -1052,10 +1042,6 @@ ppollregister_evts(struct proc *p, struct kevent *kevp, int nkev,
 
        KASSERT(pl->revents == 0);
 
-#ifdef KTRACE
-       if (KTRPOINT(p, KTR_STRUCT))
-               ktrevent(p, kevp, nkev);
-#endif
        for (i = 0; i < nkev; i++, kevp++) {
 again:
                error = kqueue_register(p->p_kq, kevp, pollid, p);