<div dir="ltr">Hi,<div><br></div><div>We sort of already discussed that a few months ago and sort of agreed on the first proposition (adding an vcl file index). I wanted to have a tool actually using it before pushing any changes and that got put on the backburner...</div><div><br></div><div>The VSL isn't painful, it's just a printf :-) I can help if you need a hand.</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>-- <br></div>Guillaume Quintard<br></div></div></div>
<br><div class="gmail_quote">On Mon, Aug 28, 2017 at 7:47 AM, kokoniimasu <span dir="ltr"><<a href="mailto:kokoniimasu@gmail.com" target="_blank">kokoniimasu@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I'm using VCL_trace for debugging.<br>
But, VCL_trace is not enough little info, if using multipe VCLs.<br>
<br>
<br>
  24025048 VCL_trace      c 3 14.5<br>
  24025048 VCL_trace      c 4 18.9<br>
                            |  |  |<br>
                            |  |  +- VCL program line position<br>
                            |  +---- VCL program line number<br>
                            +------- VCL trace point index<br>
<br>
<br>
VCL_trace does not have identify source file way in VSL.<br>
To identify, need to run varnishd "varnishd -C -f [file]"<br>
<br>
<br>
  $varnishd -C -f /etc/varnish/default.vcl 2>&1 |less<br>
  ...<br>
  static struct vrt_ref VGC_ref[VGC_NREFS] = {<br>
    [  1] = { 2,     1670,   66,   3,  "new" },<br>
    [  2] = { 0,      143,    7,   3,  "new" },<br>
    [  3] = { 0,      289,   14,   5,  "if" },<br>
    [  4] = { 0,      392,   18,   9,  "set" },<br>
  ...<br>
<br>
<br>
This way have a problem, because it can't be guaranteed same as a<br>
running config.<br>
<br>
I thought 2 pattern solution.<br>
<br>
- Add vcl source index in vcl_trace.<br>
<a href="https://github.com/varnishcache/varnish-cache/compare/master...xcir:patch/modify_vcl_trace?expand=1" rel="noreferrer" target="_blank">https://github.com/<wbr>varnishcache/varnish-cache/<wbr>compare/master...xcir:patch/<wbr>modify_vcl_trace?expand=1</a><br>
<br>
   32770 VCL_trace      c 1 2.3.3<br>
   32770 VCL_trace      c 2 2.4.5<br>
                          | | | |<br>
                          | | | +---- VCL program line position<br>
                          | | +------ VCL program line number<br>
                          | +-------- VCL program source index<br>
                          +---------- VCL trace point index<br>
<br>
<br>
<br>
- Add -t(trace) option in vcl.show<br>
<a href="https://github.com/varnishcache/varnish-cache/compare/master...xcir:patch/add_t_opt_cli?expand=1" rel="noreferrer" target="_blank">https://github.com/<wbr>varnishcache/varnish-cache/<wbr>compare/master...xcir:patch/<wbr>add_t_opt_cli?expand=1</a><br>
This patch dumps VGC_ref.<br>
<br>
   $ sudo varnishadm vcl.show -t boot<br>
   index src  line  pos token<br>
       1   2     3    3 "if"<br>
       2   2     4    5 "std.log"<br>
   ...<br>
      36   1   189    5 "return"<br>
      37   1   193    5 "return"<br>
<br>
I think modify to vcl_trace is better.<br>
But, VSL format change is painful.<br>
<br>
I'll like to create either pull-request.<br>
Can I get your opinion?<br>
<br>
Regards,<br>
--<br>
Shohei Tanaka(@xcir)<br>
<a href="http://blog.xcir.net/" rel="noreferrer" target="_blank">http://blog.xcir.net/</a> (JP)<br>
<br>
______________________________<wbr>_________________<br>
varnish-misc mailing list<br>
<a href="mailto:varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.org</a><br>
<a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" rel="noreferrer" target="_blank">https://www.varnish-cache.org/<wbr>lists/mailman/listinfo/<wbr>varnish-misc</a><br>
</blockquote></div><br></div>