Function report |
Source Code:kernel\trace\trace_stack.c |
Create Date:2022-07-28 12:11:33 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:The stack tracer looks for a maximum stack at each call from a function. It* registers a callback from ftrace, and in that callback it examines the stack* size. It determines the stack size from the variable passed in, which is the
Proto:static void check_stack(unsigned long ip, unsigned long *stack)
Type:void
Parameter:
| Type | Parameter | Name |
|---|---|---|
| unsigned long | ip | |
| unsigned long * | stack |
| 159 | frame_size = READ_ONCE(tracer_frame) |
| 162 | this_size = stack & THREAD_SIZE - 1 |
| 163 | this_size = THREAD_SIZE - this_size |
| 165 | this_size -= frame_size |
| 167 | If this_size <= stack_trace_max_size Then Return |
| 171 | If Not object_is_on_stack(stack) Then Return |
| 175 | If in_nmi() Then Return |
| 178 | local_irq_save(flags) |
| 182 | If Value for the false possibility is greater at compile time(!frame_size) Then this_size -= tracer_frame |
| 186 | If this_size <= stack_trace_max_size Then Go to out |
| 196 | When i < stack_trace_nr_entries cycle |
| 197 | If stack_dump_trace[i] == ip Then Break |
| 205 | If i == stack_trace_nr_entries Then i = 0 |
| 211 | x = 0 |
| 213 | top = (start & ~(THREAD_SIZE - 1)) + THREAD_SIZE |
| 223 | When i < stack_trace_nr_entries cycle |
| 224 | found = 0 |
| 226 | stack_trace_index[x] = this_size |
| 229 | When p < top && i < stack_trace_nr_entries cycle |
| 235 | stack_dump_trace[x] = stack_dump_trace[i++] |
| 238 | found = 1 |
| 249 | tracer_frame = (p - stack) * sizeof(unsignedlong) |
| 251 | stack_trace_max_size -= tracer_frame |
| 274 | stack_trace_nr_entries = x |
| 276 | If task_stack_end_corrupted(current process) Then |
| 277 | print_max_stack() |
| 278 | BUG() |
| 281 | out : |
| 282 | arch_spin_unlock( & stack_trace_max_lock) |
| 283 | local_irq_restore(flags) |
| Name | Describe |
|---|---|
| stack_trace_call |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |