Commit 8dfa782a authored by Federico G. Schwindt's avatar Federico G. Schwindt

Dump loaded VMODs and related details under panic

parent 95d8b34e
......@@ -398,6 +398,7 @@ pan_busyobj(struct vsb *vsb, const struct busyobj *bo)
if (bo->stale_oc)
pan_objcore(vsb, "ims", bo->stale_oc);
VCL_Panic(vsb, bo->vcl);
VMOD_Panic(vsb);
VSB_indent(vsb, -2);
VSB_printf(vsb, "},\n");
}
......@@ -462,6 +463,7 @@ pan_req(struct vsb *vsb, const struct req *req)
pan_http(vsb, "resp", req->resp);
VCL_Panic(vsb, req->vcl);
VMOD_Panic(vsb);
if (req->body_oc != NULL)
pan_objcore(vsb, "BODY", req->body_oc);
......@@ -622,7 +624,8 @@ pan_ic(const char *func, const char *file, int line, const char *cond,
if (q != NULL)
VSB_printf(pan_vsb, "thread = (%s)\n", q);
VSB_printf(pan_vsb, "version = %s\n", VCS_version);
VSB_printf(pan_vsb, "version = %s, vrt api = %d.%d\n",
VCS_version, VRT_MAJOR_VERSION, VRT_MINOR_VERSION);
VSB_printf(pan_vsb, "ident = %s,%s\n",
VSB_data(vident) + 1, Waiter_GetName());
VSB_printf(pan_vsb, "now = %f (mono), %f (real)\n",
......
......@@ -120,6 +120,7 @@ void VRTPRIV_dynamic_kill(struct vrt_privs *privs, uintptr_t id);
/* cache_vrt_vmod.c */
void VMOD_Init(void);
void VMOD_Panic(struct vsb *);
/* http1/cache_http1_pipe.c */
void V1P_Init(void);
......
......@@ -61,6 +61,9 @@ struct vmod {
void *hdl;
const void *funcs;
int funclen;
const char *abi;
int vrt_major;
int vrt_minor;
};
static VTAILQ_HEAD(,vmod) vmods = VTAILQ_HEAD_INITIALIZER(vmods);
......@@ -179,6 +182,9 @@ VRT_Vmod_Init(VRT_CTX, struct vmod **hdl, void *ptr, int len, const char *nm,
v->funclen = d->func_len;
v->funcs = d->func;
v->abi = d->abi;
v->vrt_major = d->vrt_major;
v->vrt_minor = d->vrt_minor;
REPLACE(v->nm, nm);
REPLACE(v->path, path);
......@@ -223,6 +229,20 @@ VRT_Vmod_Fini(struct vmod **hdl)
FREE_OBJ(v);
}
void
VMOD_Panic(struct vsb *vsb)
{
struct vmod *v;
VSB_printf(vsb, "vmods = {\n");
VSB_indent(vsb, 2);
VTAILQ_FOREACH(v, &vmods, list)
VSB_printf(vsb, "%s = {%s, %d.%d},\n",
v->nm, v->abi, v->vrt_major, v->vrt_minor);
VSB_indent(vsb, -2);
VSB_printf(vsb, "},\n");
}
/*---------------------------------------------------------------------*/
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment