Commit 92019e05 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add a param "log_hashstring" that controls logging of the completed

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: http://www.varnish-cache.org/svn/trunk/varnish-cache@2744 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent ab18be04
......@@ -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.
......
......@@ -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;
......
......@@ -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"
......
......@@ -97,3 +97,5 @@ SLTM(Terminate)
SLTM(ESItrace)
SLTM(ESI_xmlerror)
SLTM(Hash)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment