Commit 6a242e5c authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Improve shm-logging of VCL activity


git-svn-id: http://www.varnish-cache.org/svn/trunk@267 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 03a8ad5e
......@@ -227,9 +227,10 @@ VCL_##func##_method(struct sess *sp) \
{ \
\
sp->handling = 0; \
VSL(SLT_VCL_call, sp->fd, "%s", #func); \
sp->vcl->func##_func(sp); \
CheckHandling(sp, #func, (bitmap)); \
VSL(SLT_vcl_##func, sp->fd, "0x%x %s", sp->handling, HandlingName(sp->handling)); \
VSL(SLT_VCL_return, sp->fd, "%s", HandlingName(sp->handling)); \
}
#define VCL_RET_MAC(l,u,b)
......
......@@ -36,7 +36,7 @@ void
VRT_count(struct sess *sp, unsigned u)
{
VSL(SLT_VCL, sp->fd, "%u %d.%d", u,
VSL(SLT_VCL_trace, sp->fd, "%u %d.%d", u,
sp->vcl->ref[u].line,
sp->vcl->ref[u].pos);
}
......
......@@ -46,14 +46,39 @@ order(unsigned char *p)
ob[u] = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
assert(ob[u] != NULL);
}
sbuf_printf(ob[u], "%02x %3d %4d %-12s",
p[0], p[1], u, tagnames[p[0]]);
if (p[1] > 0) {
sbuf_cat(ob[u], " <");
sbuf_bcat(ob[u], p + 4, p[1]);
sbuf_cat(ob[u], ">");
switch (p[0]) {
case SLT_VCL_call:
sbuf_printf(ob[u], "%02x %3d %4d %-12s",
p[0], p[1], u, tagnames[p[0]]);
if (p[1] > 0) {
sbuf_cat(ob[u], " <");
sbuf_bcat(ob[u], p + 4, p[1]);
}
break;
case SLT_VCL_trace:
if (p[1] > 0) {
sbuf_cat(ob[u], " ");
sbuf_bcat(ob[u], p + 4, p[1]);
}
break;
case SLT_VCL_return:
if (p[1] > 0) {
sbuf_cat(ob[u], " ");
sbuf_bcat(ob[u], p + 4, p[1]);
sbuf_cat(ob[u], ">\n");
}
break;
default:
sbuf_printf(ob[u], "%02x %3d %4d %-12s",
p[0], p[1], u, tagnames[p[0]]);
if (p[1] > 0) {
sbuf_cat(ob[u], " <");
sbuf_bcat(ob[u], p + 4, p[1]);
sbuf_cat(ob[u], ">");
}
sbuf_cat(ob[u], "\n");
break;
}
sbuf_cat(ob[u], "\n");
if (u == 0) {
sbuf_finish(ob[u]);
printf("%s", sbuf_data(ob[u]));
......
......@@ -18,11 +18,6 @@ SLTM(BackendReuse)
SLTM(BackendClose)
SLTM(HttpError)
SLTM(ClientAddr)
#define VCL_RET_MAC(l,u,b)
#define VCL_MET_MAC(l,u,b) SLTM(vcl_##l)
#include "vcl_returns.h"
#undef VCL_MET_MAC
#undef VCL_RET_MAC
SLTM(Backend)
SLTM(Request)
SLTM(Response)
......@@ -32,7 +27,9 @@ SLTM(Protocol)
SLTM(Header)
SLTM(BldHdr)
SLTM(LostHeader)
SLTM(VCL)
SLTM(VCL_call)
SLTM(VCL_trace)
SLTM(VCL_return)
SLTM(XID)
SLTM(ExpPick)
SLTM(ExpKill)
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