6 #include <linux/sched.h>
8 #include <linux/export.h>
9 #include <asm/stacktrace.h>
14 static void save_raw_context_stack(
struct stack_trace *
trace,
17 unsigned long *
sp = (
unsigned long *)reg29;
20 while (!kstack_end(sp)) {
26 trace->entries[trace->nr_entries++] =
addr;
27 if (trace->nr_entries >= trace->max_entries)
33 static void save_context_stack(
struct stack_trace *trace,
36 unsigned long sp = regs->
regs[29];
37 #ifdef CONFIG_KALLSYMS
38 unsigned long ra = regs->
regs[31];
42 unsigned long stack_page =
44 if (stack_page && sp >= stack_page &&
46 save_raw_context_stack(trace, sp);
53 trace->entries[trace->nr_entries++] =
pc;
54 if (trace->nr_entries >= trace->max_entries)
59 save_raw_context_stack(trace, sp);
75 struct pt_regs *regs = &dummyregs;
77 WARN_ON(trace->nr_entries || !trace->max_entries);
84 prepare_frametrace(regs);
85 save_context_stack(trace, tsk, regs);