Commit 21653426 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add panic dump facility for threads which have a busyobj rather than a req.

parent 43b4bec0
......@@ -913,6 +913,8 @@ uint32_t VXID_Get(struct vxid_pool *v);
extern volatile struct params * cache_param;
void THR_SetName(const char *name);
const char* THR_GetName(void);
void THR_SetBusyobj(const struct busyobj *);
struct busyobj * THR_GetBusyobj(void);
void THR_SetRequest(const struct req *);
struct req * THR_GetRequest(void);
......
......@@ -52,6 +52,21 @@ volatile struct params *cache_param;
*/
static pthread_key_t req_key;
static pthread_key_t bo_key;
void
THR_SetBusyobj(const struct busyobj *bo)
{
AZ(pthread_setspecific(bo_key, bo));
}
struct busyobj *
THR_GetBusyobj(void)
{
return (pthread_getspecific(bo_key));
}
void
THR_SetRequest(const struct req *req)
......
......@@ -396,6 +396,7 @@ pan_ic(const char *func, const char *file, int line, const char *cond,
{
const char *q;
struct req *req;
struct busyobj *bo;
AZ(pthread_mutex_lock(&panicstr_mtx)); /* Won't be released,
we're going to die
......@@ -446,6 +447,11 @@ pan_ic(const char *func, const char *file, int line, const char *cond,
pan_req(req);
VSL_Flush(req->vsl, 0);
}
bo = THR_GetBusyobj();
if (bo != NULL) {
pan_busyobj(bo);
VSL_Flush(bo->vsl, 0);
}
}
VSB_printf(pan_vsp, "\n");
VSB_bcat(pan_vsp, "", 1); /* NUL termination */
......
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