18 #include <linux/kernel.h>
19 #include <linux/export.h>
20 #include <linux/sched.h>
23 #include <asm/stacktrace.h>
41 unsigned long fp = frame->
fp;
46 if (fp < low || fp > high || fp & 0xf)
49 frame->
sp = fp + 0x10;
50 frame->
fp = *(
unsigned long *)(fp);
51 frame->
pc = *(
unsigned long *)(fp + 8);
71 #ifdef CONFIG_STACKTRACE
72 struct stack_trace_data {
73 struct stack_trace *
trace;
74 unsigned int no_sched_functions;
78 static int save_trace(
struct stackframe *frame,
void *
d)
80 struct stack_trace_data *
data =
d;
81 struct stack_trace *
trace = data->trace;
82 unsigned long addr = frame->
pc;
91 trace->entries[trace->nr_entries++] =
addr;
93 return trace->nr_entries >= trace->max_entries;
98 struct stack_trace_data data;
102 data.skip = trace->skip;
105 data.no_sched_functions = 1;
106 frame.
fp = thread_saved_fp(tsk);
107 frame.
sp = thread_saved_sp(tsk);
110 register unsigned long current_sp
asm(
"sp");
111 data.no_sched_functions = 0;
112 frame.
fp = (
unsigned long)__builtin_frame_address(0);
113 frame.
sp = current_sp;
118 if (trace->nr_entries < trace->max_entries)
119 trace->entries[trace->nr_entries++] =
ULONG_MAX;