From d17ca09b77726f7783ac2a4effe08492ea96e069 Mon Sep 17 00:00:00 2001 From: phk Date: Sun, 18 Jun 2006 10:28:11 +0000 Subject: [PATCH] Output line+pos for counts. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@206 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_vcl.c | 6 ++++-- varnish-cache/include/vcl_lang.h | 2 +- varnish-cache/lib/libvcl/vcl_compile.c | 2 +- varnish-cache/lib/libvcl/vcl_fixed_token.c | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/varnish-cache/bin/varnishd/cache_vcl.c b/varnish-cache/bin/varnishd/cache_vcl.c index 8d710bb6..a5ee57b6 100644 --- a/varnish-cache/bin/varnishd/cache_vcl.c +++ b/varnish-cache/bin/varnishd/cache_vcl.c @@ -198,10 +198,12 @@ VCL_error(VCL_FARGS, unsigned err, const char *str) } void -VCL_count(unsigned u) +VCL_count(struct sess *sp, unsigned u) { - VSL(SLT_VCL, 0, "%u", u); + VSL(SLT_VCL, 0, "%u %d.%d", u, + sp->vcl->ref[u].line, + sp->vcl->ref[u].pos); } /*--------------------------------------------------------------------*/ diff --git a/varnish-cache/include/vcl_lang.h b/varnish-cache/include/vcl_lang.h index 10c786e7..6c783138 100644 --- a/varnish-cache/include/vcl_lang.h +++ b/varnish-cache/include/vcl_lang.h @@ -91,7 +91,7 @@ struct backend { #define VCL_FARGS struct sess *sess #define VCL_PASS_ARGS sess -void VCL_count(unsigned); +void VCL_count(struct sess *, unsigned); void VCL_no_cache(VCL_FARGS); void VCL_no_new_cache(VCL_FARGS); int ip_match(unsigned, struct vcl_acl *); diff --git a/varnish-cache/lib/libvcl/vcl_compile.c b/varnish-cache/lib/libvcl/vcl_compile.c index 10734b50..cd6406dc 100644 --- a/varnish-cache/lib/libvcl/vcl_compile.c +++ b/varnish-cache/lib/libvcl/vcl_compile.c @@ -272,7 +272,7 @@ _Expect(struct tokenlist *tl, unsigned tok, int line) #define C(tl, sep) do { \ I(tl); \ - sbuf_printf(tl->fc, "VCL_count(%u)%s\n", ++tl->cnt, sep); \ + sbuf_printf(tl->fc, "VCL_count(sess, %u)%s\n", ++tl->cnt, sep); \ tl->t->cnt = tl->cnt; \ } while (0) diff --git a/varnish-cache/lib/libvcl/vcl_fixed_token.c b/varnish-cache/lib/libvcl/vcl_fixed_token.c index 20ace698..6e36bae2 100644 --- a/varnish-cache/lib/libvcl/vcl_fixed_token.c +++ b/varnish-cache/lib/libvcl/vcl_fixed_token.c @@ -490,7 +490,7 @@ vcl_output_lang_h(FILE *f) fputs("#define VCL_FARGS struct sess *sess\n", f); fputs("#define VCL_PASS_ARGS sess\n", f); fputs("\n", f); - fputs("void VCL_count(unsigned);\n", f); + fputs("void VCL_count(struct sess *, unsigned);\n", f); fputs("void VCL_no_cache(VCL_FARGS);\n", f); fputs("void VCL_no_new_cache(VCL_FARGS);\n", f); fputs("int ip_match(unsigned, struct vcl_acl *);\n", f); -- 2.39.5