]> err.no Git - varnish/commitdiff
Make a parameter "diag_bitflag" which can control deeper diagnostics for
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 18 Feb 2008 11:45:58 +0000 (11:45 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 18 Feb 2008 11:45:58 +0000 (11:45 +0000)
us, instead of the #ifdef DIAGNOSTICS which is always not there when you
need it or there when you don't want it.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2508 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/heritage.h
varnish-cache/bin/varnishd/mgt_param.c

index f25e59e3f1d0ec2f3f603455d6a31e6ad14241e1..5cd3ecf5db40d2d1bc53e3f85ec97d07f0a3f6f5 100644 (file)
@@ -141,6 +141,9 @@ struct params {
 
        /* CLI buffer size */
        unsigned                cli_buffer;
+
+       /* Control diagnostic code */
+       unsigned                diag_bitmap;
 };
 
 extern volatile struct params *params;
index b7ea5382136cc6db28e5f8bb3753f19b0e8df8a6..b96ae091831abab0dedaf488f14ce0f5644a2d17 100644 (file)
@@ -400,6 +400,22 @@ tweak_cc_command(struct cli *cli, const struct parspec *par, const char *arg)
 
 /*--------------------------------------------------------------------*/
 
+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 @@ static const struct parspec parspec[] = {
                "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 }
 };