]> err.no Git - varnish/commitdiff
Add a param "log_hashstring" that controls logging of the completed
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 20 Jun 2008 13:08:52 +0000 (13:08 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 20 Jun 2008 13:08:52 +0000 (13:08 +0000)
hash string in SHM log under the "Hash" tag.

Enabling this increases pressure on the SHM log considerably, so don't
enable it, unless you need it.

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

varnish-cache/bin/varnishd/cache_hash.c
varnish-cache/bin/varnishd/heritage.h
varnish-cache/bin/varnishd/mgt_param.c
varnish-cache/include/shmlog_tags.h

index 46e00e6628c1585e741e6999bf53a0b06c7adeb6..99a0526854a104999e4a2050b9a31b6c4daa3c1b 100644 (file)
@@ -248,6 +248,8 @@ HSH_Lookup(struct sess *sp)
                /* We found an object we like */
                o->refcnt++;
                UNLOCK(&oh->mtx);
+               if (params->log_hash)
+                       WSP(sp, SLT_Hash, "%s", oh->hash);
                (void)hash->deref(oh);
                return (o);
        }
@@ -273,6 +275,8 @@ HSH_Lookup(struct sess *sp)
                grace_o->refcnt++;
        }
        UNLOCK(&oh->mtx);
+       if (params->log_hash)
+               WSP(sp, SLT_Hash, "%s", oh->hash);
        /*
         * XXX: This may be too early, relative to pass objects.
         * XXX: possibly move to when we commit to have it in the cache.
index 41d8a73de1502966b2572870af92a720e961f1b7..3e8926186d9eff4cfaa3de29195386f1074a86c0 100644 (file)
@@ -159,6 +159,9 @@ struct params {
 
        /* Default grace period */
        unsigned                default_grace;
+
+       /* Log hash string to shm */
+       unsigned                log_hash;
 };
 
 extern volatile struct params *params;
index 091c30abc45f79e0661a1562bacebd0719cd331a..cb27e4f49c388ad6627a6b74eb2066c282f6cc2d 100644 (file)
@@ -743,6 +743,10 @@ static const struct parspec parspec[] = {
                "NB: Must be specified with -p to have effect.\n",
                0,
                "8192", "bytes" },
+       { "log_hashstring", tweak_bool, &master.log_hash, 0, 0,
+               "Log the hash string to shared memory log.\n",
+               0,
+               "off", "bool" },
        { "diag_bitmap", tweak_diag_bitmap, 0, 0, 0,
                "Bitmap controlling diagnostics code:\n"
                "  0x00000001 - CNT_Session states.\n"
index 11ca9e885ee3d34365a61ceb4c2ac2d39d3cc4ce..55022b81e6cd46ceb1a694466928a031d771ab88 100644 (file)
@@ -97,3 +97,5 @@ SLTM(Terminate)
 
 SLTM(ESItrace)
 SLTM(ESI_xmlerror)
+
+SLTM(Hash)