TH_EX_CTX_NONE = 0, /* context not filled */
TH_EX_CTX_OTHER, /* context only known by a generic pointer */
TH_EX_CTX_INITCALL, /* the pointer is an initcall providing file:line */
+ TH_EX_CTX_CALLER, /* the pointer is an ha_caller of the caller providing file:line etc */
};
struct thread_exec_ctx {
union {
const void *pointer; /* generic pointer (for other) */
const struct initcall *initcall; /* used with TH_EX_CTX_INITCALL */
+ const struct ha_caller *ha_caller; /* used with TH_EX_CTX_CALLER */
};
};
chunk_appendf(output,"ctx registered at %s:%d", slash, ctx->initcall->loc_line);
break;
}
+ case TH_EX_CTX_CALLER: {
+ const char *file = ctx->ha_caller->file;
+ const char *slash = strrchr(file, '/');
+ slash = slash ? slash + 1 : file;
+ chunk_appendf(output,"ctx registered at %s@%s:%d", ctx->ha_caller->func, slash, ctx->ha_caller->line);
+ break;
+ }
default:
chunk_appendf(output,"other ctx %p", ctx->pointer);
break;