]> err.no Git - varnish/commitdiff
Move kqueue debugging under diag_bitmap control
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 18 Feb 2008 11:54:30 +0000 (11:54 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 18 Feb 2008 11:54:30 +0000 (11:54 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2511 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_acceptor_kqueue.c
varnish-cache/bin/varnishd/mgt_param.c

index 8156f62bfa660565a0e670821794f7edc98dc1eb..11a8795d62e2b42f576242d6f90e6cd229a4247e 100644 (file)
@@ -207,23 +207,24 @@ vca_kev(const struct kevent *kp)
                return;
        }
        if (!vbit_test(vca_kqueue_bits, kp->ident)) {
-               VSL(SLT_Debug, kp->ident,
-                   "KQ: not my fd %d, sp %p kev data %lu flags 0x%x%s",
-                   kp->ident, kp->udata, (unsigned long)kp->data, kp->flags,
-                   (kp->flags & EV_EOF) ? " EOF" : "");
+               if (params->diag_bitmap & 0x4)
+                       VSL(SLT_Debug, kp->ident,
+                           "KQ: not my fd %d, sp %p kev data %lu flags 0x%x%s",
+                           kp->ident, kp->udata, (unsigned long)kp->data,
+                           kp->flags, (kp->flags & EV_EOF) ? " EOF" : "");
                return;
        }
        CAST_OBJ_NOTNULL(sp, kp->udata, SESS_MAGIC);
-#ifdef DIAGNOSTICS
-       VSL(SLT_Debug, sp->id, "sp %p kev data %lu flags 0x%x%s",
-           sp, (unsigned long)kp->data, kp->flags,
-           (kp->flags & EV_EOF) ? " EOF" : "");
-#endif
+       if (params->diag_bitmap & 0x4)
+               VSL(SLT_Debug, sp->id, "sp %p kev data %lu flags 0x%x%s",
+                   sp, (unsigned long)kp->data, kp->flags,
+                   (kp->flags & EV_EOF) ? " EOF" : "");
        spassert(sp->id == kp->ident);
        spassert(sp->fd == sp->id || sp->fd == -1);
        if (sp->fd == -1 || kp->fflags == 0) {
-               VSL(SLT_Debug, sp->id, "%s(): got event 0x%04x on fd %d",
-                   __func__, kp->fflags, sp->fd);
+               if (params->diag_bitmap & 0x4)
+                       VSL(SLT_Debug, sp->id, "KQ: got event 0x%04x on fd %d",
+                           kp->fflags, sp->fd);
                return;
        }
        if (kp->data > 0) {
index 88593f1c273e4b744e48ff2d9ce19abf0cb21a2a..5580d76c34406863c6710834e6e00f6ddca958b2 100644 (file)
@@ -640,6 +640,7 @@ static const struct parspec parspec[] = {
                "Bitmap controlling DIAGNOSTICS code:\n"
                "  0x00000001 - CNT_Session states.\n"
                "  0x00000002 - workspace debugging.\n"
+               "  0x00000004 - kqueue debugging.\n"
                "Use 0x notation and do the bitor in your head :-)\n",
                0,
                "0", "bitmap" },