From d55e56552d7b6e8761da768067930321202e6c84 Mon Sep 17 00:00:00 2001 From: phk Date: Mon, 18 Feb 2008 11:54:30 +0000 Subject: [PATCH] Move kqueue debugging under diag_bitmap control git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2511 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- .../bin/varnishd/cache_acceptor_kqueue.c | 23 ++++++++++--------- varnish-cache/bin/varnishd/mgt_param.c | 1 + 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c b/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c index 8156f62b..11a8795d 100644 --- a/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c +++ b/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c @@ -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) { diff --git a/varnish-cache/bin/varnishd/mgt_param.c b/varnish-cache/bin/varnishd/mgt_param.c index 88593f1c..5580d76c 100644 --- a/varnish-cache/bin/varnishd/mgt_param.c +++ b/varnish-cache/bin/varnishd/mgt_param.c @@ -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" }, -- 2.39.5