Lines Matching refs:state
12 unsigned long unwind_get_return_address(struct unwind_state *state) in unwind_get_return_address() argument
14 if (unwind_done(state)) in unwind_get_return_address()
16 return __kernel_text_address(state->ip) ? state->ip : 0; in unwind_get_return_address()
20 static bool outside_of_stack(struct unwind_state *state, unsigned long sp) in outside_of_stack() argument
22 return (sp <= state->sp) || in outside_of_stack()
23 (sp > state->stack_info.end - sizeof(struct stack_frame)); in outside_of_stack()
26 static bool update_stack_info(struct unwind_state *state, unsigned long sp) in update_stack_info() argument
28 struct stack_info *info = &state->stack_info; in update_stack_info()
29 unsigned long *mask = &state->stack_mask; in update_stack_info()
32 if (get_stack_info(sp, state->task, info, mask) != 0 || in update_stack_info()
39 static inline bool is_final_pt_regs(struct unwind_state *state, in is_final_pt_regs() argument
43 if (task_pt_regs(state->task) == regs) in is_final_pt_regs()
47 return state->stack_info.type == STACK_TYPE_IRQ && in is_final_pt_regs()
48 state->stack_info.end - sizeof(struct pt_regs) == (unsigned long)regs && in is_final_pt_regs()
52 bool unwind_next_frame(struct unwind_state *state) in unwind_next_frame() argument
54 struct stack_info *info = &state->stack_info; in unwind_next_frame()
60 regs = state->regs; in unwind_next_frame()
62 sp = state->sp; in unwind_next_frame()
69 state->regs = NULL; in unwind_next_frame()
70 return unwind_next_frame(state); in unwind_next_frame()
73 sf = (struct stack_frame *) state->sp; in unwind_next_frame()
77 if (unlikely(outside_of_stack(state, sp))) { in unwind_next_frame()
78 if (!update_stack_info(state, sp)) in unwind_next_frame()
86 sp = state->sp + STACK_FRAME_OVERHEAD; in unwind_next_frame()
90 if (is_final_pt_regs(state, regs)) in unwind_next_frame()
94 if (unlikely(outside_of_stack(state, sp))) { in unwind_next_frame()
95 if (!update_stack_info(state, sp)) in unwind_next_frame()
106 ip = ftrace_graph_ret_addr(state->task, &state->graph_idx, ip, (void *) sp); in unwind_next_frame()
109 state->sp = sp; in unwind_next_frame()
110 state->ip = ip; in unwind_next_frame()
111 state->regs = regs; in unwind_next_frame()
112 state->reliable = reliable; in unwind_next_frame()
116 state->error = true; in unwind_next_frame()
118 state->stack_info.type = STACK_TYPE_UNKNOWN; in unwind_next_frame()
123 void __unwind_start(struct unwind_state *state, struct task_struct *task, in __unwind_start() argument
126 struct stack_info *info = &state->stack_info; in __unwind_start()
130 memset(state, 0, sizeof(*state)); in __unwind_start()
131 state->task = task; in __unwind_start()
132 state->regs = regs; in __unwind_start()
151 if (!update_stack_info(state, sp)) { in __unwind_start()
154 state->error = true; in __unwind_start()
164 ip = ftrace_graph_ret_addr(state->task, &state->graph_idx, ip, NULL); in __unwind_start()
167 state->sp = sp; in __unwind_start()
168 state->ip = ip; in __unwind_start()
169 state->reliable = true; in __unwind_start()
174 while (!unwind_done(state)) { in __unwind_start()
175 if (on_stack(&state->stack_info, first_frame, sizeof(struct stack_frame))) { in __unwind_start()
176 if (state->sp >= first_frame) in __unwind_start()
179 unwind_next_frame(state); in __unwind_start()