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

Add a "panic" method to stevedores, so they can dump the objcores

internal state.
parent b469b6e7
......@@ -258,6 +258,13 @@ pan_objcore(struct vsb *vsb, const char *typ, const struct objcore *oc)
if (strlen(oc->stobj->stevedore->ident))
VSB_printf(vsb, " %s", oc->stobj->stevedore->ident);
VSB_printf(vsb, ")");
if (oc->stobj->stevedore->panic) {
VSB_printf(vsb, " {\n");
VSB_indent(vsb, 2);
oc->stobj->stevedore->panic(vsb, oc);
VSB_indent(vsb, -2);
VSB_printf(vsb, "}");
}
}
VSB_printf(vsb, ",\n");
VSB_indent(vsb, -2);
......
......@@ -71,6 +71,8 @@ typedef int storage_baninfo_f(const struct stevedore *, enum baninfo event,
const uint8_t *ban, unsigned len);
typedef void storage_banexport_f(const struct stevedore *, const uint8_t *bans,
unsigned len);
typedef void storage_panic_f(struct vsb *vsb, const struct objcore *oc);
typedef struct object *sml_getobj_f(struct worker *, struct objcore *);
typedef struct storage *sml_alloc_f(const struct stevedore *, size_t size);
......@@ -97,6 +99,7 @@ struct stevedore {
storage_allocobj_f *allocobj;
storage_baninfo_f *baninfo;
storage_banexport_f *banexport;
storage_panic_f *panic;
/* Only if SML is used */
sml_alloc_f *sml_alloc;
......
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