You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add VMOD version information to Panic output, debug.vmod and ELF
This commit adds a facility which I had wanted for a very long time, and should
have added much earlier: Analyzing bug reports with VMODs involved used to be
complicated by the fact that they typically did not contain reliable version
information.
We add to vmodtool.py the generic code to create version information from
generate.py with minor modifications. It adds the version set for autotools and,
if possible, the git revision to the vmodtool-generated interface code. We copy
that to struct vrt and output it for panics and the debug.vmod CLI command. For
builds from distributions, save the git revision to a file.
Being at it, we polish the panic output slightly for readability.
There are two elements to the version information:
- "version", which is intended to be user-friendly and
- "vcs" (for version control system) which is intended to represent a commit id
from the scm.
The VCC file Stanza $Version overrides "version".
As an example, the output from a panic now might look like this:
vmods = {
debug = {p=0x7f5b19c2c600, abi=\"Varnish trunk 172e7b43a49bdf43d82cc6b10ab08362939fc8a5\", vrt=19.1,
vcs=\"172e7b43a49bdf43d82cc6b10ab08362939fc8a5\", version=\"Varnish trunk\"},
},
The debug.vmod CLI outout is, for example:
1 vtc (path="/home/slink/Devel/varnish-git/varnish-cache/vmod/.libs/libvmod_vtc.so", version="Varnish trunk", vcs="172e7b43a49bdf43d82cc6b10ab08362939fc8a5")
And, finally, a readelf example to extract the vcs string:
$ readelf -p.vmod_vcs ./vmod/.libs/libvmod_std.so
String dump of section '.vmod_vcs':
[ 0] 172e7b43a49bdf43d82cc6b10ab08362939fc8a5
0 commit comments