|
18 | 18 | #include <asm/stack_pointer.h>
|
19 | 19 | #include <asm/stacktrace.h>
|
20 | 20 |
|
| 21 | +/* |
| 22 | + * A snapshot of a frame record or fp/lr register values, along with some |
| 23 | + * accounting information necessary for robust unwinding. |
| 24 | + * |
| 25 | + * @fp: The fp value in the frame record (or the real fp) |
| 26 | + * @pc: The lr value in the frame record (or the real lr) |
| 27 | + * |
| 28 | + * @stacks_done: Stacks which have been entirely unwound, for which it is no |
| 29 | + * longer valid to unwind to. |
| 30 | + * |
| 31 | + * @prev_fp: The fp that pointed to this frame record, or a synthetic value |
| 32 | + * of 0. This is used to ensure that within a stack, each |
| 33 | + * subsequent frame record is at an increasing address. |
| 34 | + * @prev_type: The type of stack this frame record was on, or a synthetic |
| 35 | + * value of STACK_TYPE_UNKNOWN. This is used to detect a |
| 36 | + * transition from one stack to another. |
| 37 | + * |
| 38 | + * @kr_cur: When KRETPROBES is selected, holds the kretprobe instance |
| 39 | + * associated with the most recently encountered replacement lr |
| 40 | + * value. |
| 41 | + */ |
| 42 | +struct stackframe { |
| 43 | + unsigned long fp; |
| 44 | + unsigned long pc; |
| 45 | + DECLARE_BITMAP(stacks_done, __NR_STACK_TYPES); |
| 46 | + unsigned long prev_fp; |
| 47 | + enum stack_type prev_type; |
| 48 | +#ifdef CONFIG_KRETPROBES |
| 49 | + struct llist_node *kr_cur; |
| 50 | +#endif |
| 51 | +}; |
| 52 | + |
21 | 53 | static notrace void start_backtrace(struct stackframe *frame, unsigned long fp,
|
22 | 54 | unsigned long pc)
|
23 | 55 | {
|
|
0 commit comments