Lines Matching +full:max +full:- +full:frame +full:- +full:size

1 // SPDX-License-Identifier: GPL-2.0
40 int size; in print_max_stack() local
42 pr_emerg(" Depth Size Location (%d entries)\n" in print_max_stack()
43 " ----- ---- --------\n", in print_max_stack()
48 size = stack_trace_index[i]; in print_max_stack()
50 size = stack_trace_index[i] - stack_trace_index[i+1]; in print_max_stack()
53 size, (void *)stack_dump_trace[i]); in print_max_stack()
60 * size. It determines the stack size from the variable passed in, which is the
62 * The stack size is calculated by the address of the local variable to the top
63 * of the current stack. If that size is smaller than the currently saved max
64 * stack size, nothing more is done.
66 * If the size of the stack is greater than the maximum recorded size, then the
74 * 0: sys call entry frame
76 * 11: start of sys_foo frame
78 * 21: start of kernel_func_bar frame
89 * Now to figure out how much each of these functions' local variable size is,
95 * ------------------ + -------------------
100 * The print_max_stack() function above, uses these values to print the size of
104 * size = i == nr_entries - 1 ? stack_trace_index[i] :
105 * stack_trace_index[i] - stack_trace_index[i+1]
106 * print "%d %d %d %s\n", i, stack_trace_index[i], size, stack_dump_trace[i]);
111 * depth size location
112 * ----- ---- --------
122 * 0: sys call entry frame
125 * 20: start of kernel_func_bar frame
134 * ------------------ + -------------------
141 * kernel_func_bar stack frame size is 29 - 19 not 30 - 29!
148 * ------------------ + -------------------
153 * will still include the stack size of it.
162 this_size = ((unsigned long)stack) & (THREAD_SIZE-1); in check_stack()
163 this_size = THREAD_SIZE - this_size; in check_stack()
164 /* Remove the frame of the tracer */ in check_stack()
165 this_size -= frame_size; in check_stack()
183 this_size -= tracer_frame; in check_stack()
192 ARRAY_SIZE(stack_dump_trace) - 1, in check_stack()
214 (((unsigned long)start & ~(THREAD_SIZE-1)) + THREAD_SIZE); in check_stack()
221 * on a new max, so it is far from a fast path. in check_stack()
232 * this is not a stack-out-of-bounds error. in check_stack()
237 (top - p) * sizeof(unsigned long); in check_stack()
244 * max stack. If we haven't figured in check_stack()
249 tracer_frame = (p - stack) * in check_stack()
251 stack_trace_max_size -= tracer_frame; in check_stack()
269 sizeof(stack_trace_index[0]) * (x - 1)); in check_stack()
270 x--; in check_stack()
327 unsigned long *ptr = filp->private_data; in stack_max_size_read()
341 long *ptr = filp->private_data; in stack_max_size_write()
378 long n = *pos - 1; in __next()
383 m->private = (void *)n; in __next()
384 return &m->private; in __next()
438 int size; in t_show() local
441 seq_printf(m, " Depth Size Location" in t_show()
443 " ----- ---- --------\n", in t_show()
458 size = stack_trace_index[i]; in t_show()
460 size = stack_trace_index[i] - stack_trace_index[i+1]; in t_show()
462 seq_printf(m, "%3ld) %8d %5d ", i, stack_trace_index[i], size); in t_show()
499 struct ftrace_ops *ops = inode->i_private; in stack_trace_filter_open()