void stacktrace_print(void) { stacktrace_prepare(); stacktrace_print_fp_pc(stacktrace_fp_get(), stacktrace_pc_get()); /* * Prevent the tail call optimization of the previous call by * making it a non-tail call. */ printf("-- end of stack trace --\n"); }
static void print_deadlock(fibril_owner_info_t *oi) { fibril_t *f = (fibril_t *) fibril_get_id(); printf("Deadlock detected.\n"); stacktrace_print(); printf("Fibril %p waits for primitive %p.\n", f, oi); while (oi && oi->owned_by) { printf("Primitive %p is owned by fibril %p.\n", oi, oi->owned_by); if (oi->owned_by == f) break; stacktrace_print_fp_pc(context_get_fp(&oi->owned_by->ctx), oi->owned_by->ctx.pc); printf("Fibril %p waits for primitive %p.\n", oi->owned_by, oi->owned_by->waits_for); oi = oi->owned_by->waits_for; } }