Mailing List Archive

r2508 - trunk/varnish-cache/bin/varnishd
Author: phk
Date: 2008-02-18 12:45:58 +0100 (Mon, 18 Feb 2008)
New Revision: 2508

Modified:
trunk/varnish-cache/bin/varnishd/heritage.h
trunk/varnish-cache/bin/varnishd/mgt_param.c
Log:
Make a parameter "diag_bitflag" which can control deeper diagnostics for
us, instead of the #ifdef DIAGNOSTICS which is always not there when you
need it or there when you don't want it.


Modified: trunk/varnish-cache/bin/varnishd/heritage.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/heritage.h 2008-02-18 11:04:35 UTC (rev 2507)
+++ trunk/varnish-cache/bin/varnishd/heritage.h 2008-02-18 11:45:58 UTC (rev 2508)
@@ -141,6 +141,9 @@

/* CLI buffer size */
unsigned cli_buffer;
+
+ /* Control diagnostic code */
+ unsigned diag_bitmap;
};

extern volatile struct params *params;

Modified: trunk/varnish-cache/bin/varnishd/mgt_param.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_param.c 2008-02-18 11:04:35 UTC (rev 2507)
+++ trunk/varnish-cache/bin/varnishd/mgt_param.c 2008-02-18 11:45:58 UTC (rev 2508)
@@ -400,6 +400,22 @@

/*--------------------------------------------------------------------*/

+static void
+tweak_diag_bitmap(struct cli *cli, const struct parspec *par, const char *arg)
+{
+ unsigned u;
+
+ (void)par;
+ if (arg != NULL) {
+ u = strtoul(arg, NULL, 0);
+ master.diag_bitmap = u;
+ } else {
+ cli_out(cli, "0x%x", master.diag_bitmap);
+ }
+}
+
+/*--------------------------------------------------------------------*/
+
/*
* Make sure to end all lines with either a space or newline of the
* formatting will go haywire.
@@ -620,6 +636,12 @@
"NB: Must be specified with -p to have effect.\n",
0,
"8192", "bytes" },
+ { "diag_bitmap", tweak_diag_bitmap, 0, 0, 0,
+ "Bitmap controlling DIAGNOSTICS code:\n"
+ " 0x00000001 - CNT_Session states.\n"
+ "Use 0x notation and do the bitor in your head :-)\n",
+ 0,
+ "0", "bitmap" },
{ NULL, NULL, NULL }
};