Lines Matching full:stack
3 * Generic stack depot for storing stack traces.
5 * Some debugging tools need to save stack traces of certain events which can
7 * free stacks for each object, but storing two stack traces per object
11 * Instead, stack depot maintains a hashtable of unique stacktraces. Since alloc
39 #define STACK_ALLOC_ORDER 2 /* 'Slab' size order for stack depot, 4 pages */
64 u32 size; /* Number of frames in the stack */
104 /* Allocation of a new stack in raw storage */
108 struct stack_record *stack; in depot_alloc_stack() local
109 size_t required_size = struct_size(stack, entries, size); in depot_alloc_stack()
115 WARN_ONCE(1, "Stack depot reached limit capacity"); in depot_alloc_stack()
132 stack = stack_slabs[depot_index] + depot_offset; in depot_alloc_stack()
134 stack->hash = hash; in depot_alloc_stack()
135 stack->size = size; in depot_alloc_stack()
136 stack->handle.slabindex = depot_index; in depot_alloc_stack()
137 stack->handle.offset = depot_offset >> STACK_ALLOC_ALIGN; in depot_alloc_stack()
138 stack->handle.valid = 1; in depot_alloc_stack()
139 memcpy(stack->entries, entries, flex_array_size(stack, entries, size)); in depot_alloc_stack()
142 return stack; in depot_alloc_stack()
158 pr_info("Stack Depot is disabled\n"); in is_stack_depot_disabled()
178 /* Calculate hash for a stack */
201 /* Find a stack that is equal to the one stored in entries in the hash */
218 * stack_depot_fetch - Fetch stack entries from a depot
220 * @handle: Stack depot handle which was returned from
232 struct stack_record *stack; in stack_depot_fetch() local
236 WARN(1, "slab index %d out of bounds (%d) for stack id %08x\n", in stack_depot_fetch()
243 stack = slab + offset; in stack_depot_fetch()
245 *entries = stack->entries; in stack_depot_fetch()
246 return stack->size; in stack_depot_fetch()
251 * stack_depot_save - Save a stack trace from an array
257 * Return: The handle of the stack struct stored in depot
277 * Fast path: look the stack trace up without locking. in stack_depot_save()
287 * Check if the current or the next stack slab need to be initialized. in stack_depot_save()
326 * We didn't need to store this stack trace, but let's keep in stack_depot_save()
360 /* Include the irqentry function into the stack. */ in filter_irq_stacks()