Conditionally compile kqueue poll debug printfs, mainly preventing them
authoranton <anton@openbsd.org>
Mon, 12 Aug 2024 19:32:05 +0000 (19:32 +0000)
committeranton <anton@openbsd.org>
Mon, 12 Aug 2024 19:32:05 +0000 (19:32 +0000)
from being included in the ramdisk kernel.

Looks sensible to deraadt@

sys/kern/sys_generic.c

index 8699daf..935962c 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: sys_generic.c,v 1.157 2024/04/10 10:05:26 claudio Exp $       */
+/*     $OpenBSD: sys_generic.c,v 1.158 2024/08/12 19:32:05 anton Exp $ */
 /*     $NetBSD: sys_generic.c,v 1.24 1996/03/29 00:25:32 cgd Exp $     */
 
 /*
  *  2 - print ppoll(2) information, somewhat verbose
  *  3 - print pselect(2) and ppoll(2) information, very verbose
  */
-int kqpoll_debug = 0;
+/* #define KQPOLL_DEBUG */
+#ifdef KQPOLL_DEBUG
+int kqpoll_debug = 1;
 #define DPRINTFN(v, x...) if (kqpoll_debug > v) {                      \
        printf("%s(%d): ", curproc->p_p->ps_comm, curproc->p_tid);      \
        printf(x);                                                      \
 }
+#else
+#define DPRINTFN(v, x...) do {} while (0);
+#endif
 
 int pselregister(struct proc *, fd_set **, fd_set **, int, int *, int *);
 int pselcollect(struct proc *, struct kevent *, fd_set **, int *);