kernel_optimize_test/arch/sh/include/asm/unwinder.h
Matt Fleming b344e24a8e sh: unwinder: Introduce UNWINDER_BUG() and UNWINDER_BUG_ON()
We can't assume that if we execute the unwinder code and the unwinder
was already running that it has faulted. Clearly two kernel threads can
invoke the unwinder at the same time and may be running simultaneously.

The previous approach used BUG() and BUG_ON() in the unwinder code to
detect whether the unwinder was incapable of unwinding the stack, and
that the next available unwinder should be used instead. A better
approach is to explicitly invoke a trap handler to switch unwinders when
the current unwinder cannot continue.

Signed-off-by: Matt Fleming <matt@console-pimps.org>
2009-08-21 13:02:44 +01:00

32 lines
817 B
C

#ifndef _LINUX_UNWINDER_H
#define _LINUX_UNWINDER_H
#include <asm/stacktrace.h>
struct unwinder {
const char *name;
struct list_head list;
int rating;
void (*dump)(struct task_struct *, struct pt_regs *,
unsigned long *, const struct stacktrace_ops *, void *);
};
extern int unwinder_init(void);
extern int unwinder_register(struct unwinder *);
extern void unwind_stack(struct task_struct *, struct pt_regs *,
unsigned long *, const struct stacktrace_ops *,
void *);
extern void stack_reader_dump(struct task_struct *, struct pt_regs *,
unsigned long *, const struct stacktrace_ops *,
void *);
/*
* Used by fault handling code to signal to the unwinder code that it
* should switch to a different unwinder.
*/
extern int unwinder_faulted;
#endif /* _LINUX_UNWINDER_H */