Commit e1a4672e authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Make the shmlog'ing of vcl execution a parameter.

VCL tracing is responsible for a very large fraction of the shmlog
records and will generally only be used for debugging of VCL code.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@997 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 3c34b097
......@@ -10,6 +10,7 @@
#include <stdlib.h>
#include "shmlog.h"
#include "heritage.h"
#include "vrt.h"
#include "vrt_obj.h"
#include "vcl.h"
......@@ -34,9 +35,9 @@ VRT_count(struct sess *sp, unsigned u)
{
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
VSL(SLT_VCL_trace, sp->fd, "%u %d.%d", u,
sp->vcl->ref[u].line,
sp->vcl->ref[u].pos);
if (params->vcl_trace)
VSL(SLT_VCL_trace, sp->fd, "%u %d.%d", u,
sp->vcl->ref[u].line, sp->vcl->ref[u].pos);
}
/*--------------------------------------------------------------------*/
......
......@@ -54,8 +54,8 @@ struct params {
/* Sendfile object minimum size */
unsigned sendfile_threshold;
/* Session dispostion grace period */
unsigned session_grace;
/* VCL traces */
unsigned vcl_trace;
};
extern struct params *params;
......
......@@ -226,6 +226,34 @@ tweak_sendfile_threshold(struct cli *cli, struct parspec *par, const char *arg)
/*--------------------------------------------------------------------*/
static void
tweak_vcl_trace(struct cli *cli, struct parspec *par, const char *arg)
{
(void)par;
if (arg != NULL) {
if (!strcasecmp(arg, "off"))
params->vcl_trace = 0;
else if (!strcasecmp(arg, "disable"))
params->vcl_trace = 0;
else if (!strcasecmp(arg, "no"))
params->vcl_trace = 0;
else if (!strcasecmp(arg, "on"))
params->vcl_trace = 1;
else if (!strcasecmp(arg, "enable"))
params->vcl_trace = 1;
else if (!strcasecmp(arg, "yes"))
params->vcl_trace = 1;
else {
cli_out(cli, "use \"on\" or \"off\"\n");
cli_result(cli, CLIS_PARAM);
return;
}
}
cli_out(cli, params->vcl_trace ? "on" : "off");
}
/*--------------------------------------------------------------------*/
/*
* Make sure to end all lines with either a space or newline of the
* formatting will go haywire.
......@@ -301,6 +329,9 @@ static struct parspec parspec[] = {
"The minimum size of objects transmitted with sendfile.\n"
"Default is 8192 bytes.", "8192" },
#endif /* HAVE_SENDFILE */
{ "vcl_trace", tweak_vcl_trace,
"Trace VCL execution in the shmlog\n"
"Default is off", "off" },
{ NULL, NULL, NULL }
};
......
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