From 4e6c4551e842b2c79860569cd9a923f76e6375a2 Mon Sep 17 00:00:00 2001 From: phk Date: Tue, 3 Feb 2009 12:45:06 +0000 Subject: [PATCH] Make it possible (at great performance loss) to force straight time sequencing of shmlog records for debugging purposes. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3570 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/mgt_param.c | 1 + varnish-cache/bin/varnishd/shmlog.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/varnish-cache/bin/varnishd/mgt_param.c b/varnish-cache/bin/varnishd/mgt_param.c index 1a9e03b0..8205a96a 100644 --- a/varnish-cache/bin/varnishd/mgt_param.c +++ b/varnish-cache/bin/varnishd/mgt_param.c @@ -745,6 +745,7 @@ static const struct parspec input_parspec[] = { #ifdef HAVE_ABORT2 " 0x00008000 - panic to abort2().\n" #endif + " 0x00010000 - synchronize shmlog.\n" "Use 0x notation and do the bitor in your head :-)\n", 0, "0", "bitmap" }, diff --git a/varnish-cache/bin/varnishd/shmlog.c b/varnish-cache/bin/varnishd/shmlog.c index 7794a334..0cc9ad99 100644 --- a/varnish-cache/bin/varnishd/shmlog.c +++ b/varnish-cache/bin/varnishd/shmlog.c @@ -231,6 +231,8 @@ WSLR(struct worker *w, enum shmlogtag tag, int id, txt t) memcpy(p + SHMLOG_DATA, t.b, l); vsl_hdr(tag, p, l, id); w->wlr++; + if (params->diag_bitmap & 0x10000) + WSL_Flush(w, 0); } /*--------------------------------------------------------------------*/ @@ -269,6 +271,8 @@ WSL(struct worker *w, enum shmlogtag tag, int id, const char *fmt, ...) w->wlr++; } va_end(ap); + if (params->diag_bitmap & 0x10000) + WSL_Flush(w, 0); } /*--------------------------------------------------------------------*/ -- 2.39.5