[master] 7e35c20 Add vcl configname and source index in vcl_trace

Federico G. Schwindt fgsch at lodoss.net
Mon Sep 4 12:21:07 CEST 2017


commit 7e35c209ddae77cf6205135f00aa919f6c81b159
Author: Shohei Tanaka(@xcir) <kokoniimasu+git at gmail.com>
Date:   Thu Aug 31 13:54:37 2017 +0900

    Add vcl configname and source index in vcl_trace
    
    Fixes #2403.

diff --git a/bin/varnishd/cache/cache_vcl.c b/bin/varnishd/cache/cache_vcl.c
index 1ff9428..09bdca5 100644
--- a/bin/varnishd/cache/cache_vcl.c
+++ b/bin/varnishd/cache/cache_vcl.c
@@ -519,11 +519,11 @@ VRT_count(VRT_CTX, unsigned u)
 	CHECK_OBJ_NOTNULL(ctx->vcl->conf, VCL_CONF_MAGIC);
 	assert(u < ctx->vcl->conf->nref);
 	if (ctx->vsl != NULL)
-		VSLb(ctx->vsl, SLT_VCL_trace, "%u %u.%u", u,
-		    ctx->vcl->conf->ref[u].line, ctx->vcl->conf->ref[u].pos);
+		VSLb(ctx->vsl, SLT_VCL_trace, "%s %u %u.%u.%u",
+		    ctx->vcl->loaded_name, u, ctx->vcl->conf->ref[u].source, ctx->vcl->conf->ref[u].line, ctx->vcl->conf->ref[u].pos);
 	else
-		VSL(SLT_VCL_trace, 0, "%u %u.%u", u,
-		    ctx->vcl->conf->ref[u].line, ctx->vcl->conf->ref[u].pos);
+		VSL(SLT_VCL_trace, 0, "%s %u %u.%u.%u",
+		    ctx->vcl->loaded_name, u, ctx->vcl->conf->ref[u].source, ctx->vcl->conf->ref[u].line, ctx->vcl->conf->ref[u].pos);
 }
 
 VCL_VCL
diff --git a/include/tbl/vsl_tags.h b/include/tbl/vsl_tags.h
index a40205c..6463636 100644
--- a/include/tbl/vsl_tags.h
+++ b/include/tbl/vsl_tags.h
@@ -251,11 +251,13 @@ SLTM(VCL_call, 0, "VCL method called",
 SLTM(VCL_trace, 0, "VCL trace data",
 	"Logs VCL execution trace data.\n\n"
 	"The format is::\n\n"
-	"\t%u %u.%u\n"
-	"\t|  |  |\n"
-	"\t|  |  +- VCL program line position\n"
-	"\t|  +---- VCL program line number\n"
-	"\t+------- VCL trace point index\n"
+	"\t%s %u %u.%u.%u\n"
+	"\t|  |  |  |  |\n"
+	"\t|  |  |  |  +- VCL program line position\n"
+	"\t|  |  |  +---- VCL program line number\n"
+	"\t|  |  +------- VCL program source index\n"
+	"\t|  +---------- VCL trace point index\n"
+	"\t+------------- VCL configname\n"
 	"\n"
 	NODEF_NOTICE
 )



More information about the varnish-commit mailing list