-
Nils Goroll authored
To potentially emit VCL_trace VSL records, we called VPI_count() from VGC for, in the extreme, every line of VCL. For a normal setup, VPI_count() would call into VSL only to find out that VCL_trace is masked and not have any effect. Issuing two additional function calls for each line of VCL obviously is something we should avoid unless there is a real benefit. To avoid the overhead, we move the check for the tracing flag to VGC and decorate it with UNLIKELY(), which has no effect for now but is expected to become a branch prediction hint soon. This should bring the cost down close to zero. Being at it, we also add VCL control over tracing through req.trace and bereq.trace. req.trace gets initialized from feature +trace, and bereq.trace inherits the value from req.trace. For now, tracing of the housekeeping subs vcl_init and vcl_fini can only be controlled through feature +trace.