Lines Matching full:stack

3  * Stack depot - a stack trace storage that avoids duplication.
5 * Stack depot is intended to be used by subsystems that need to store and
6 * later retrieve many potentially duplicated stack traces without wasting
9 * For example, KASAN needs to save allocation and free stack traces for each
10 * object. Storing two stack traces per object requires a lot of memory (e.g.
12 * stack traces often repeat, using stack depot allows to save about 100x space.
28 * Number of bits in the handle that stack depot doesn't use. Users may store
43 /* Compact structure that stores a reference to a stack. */
64 * only place a stack record onto the freelist iff its
65 * refcount is zero. Because stack records with a zero
92 * Using stack depot requires its initialization, which can be done in 3 ways:
95 * scenarios where it's known at compile time that stack depot will be used.
96 * Enabling this config makes the kernel initialize stack depot in mm_init().
108 * config is disabled. The save/fetch/print stack depot functions can only be
110 * initializes stack depot via one of the ways listed above.
128 * stack_depot_save_flags - Save a stack trace to stack depot
130 * @entries: Pointer to the stack trace
131 * @nr_entries: Number of frames in the stack
133 * @depot_flags: Stack depot flags
135 * Saves a stack trace from @entries array of size @nr_entries.
137 * If STACK_DEPOT_FLAG_CAN_ALLOC is set in @depot_flags, stack depot can
138 * replenish the stack pools in case no space is left (allocates using GFP
139 * flags of @alloc_flags). Otherwise, stack depot avoids any allocations and
140 * fails if no space is left to store the stack trace.
142 * If STACK_DEPOT_FLAG_GET is set in @depot_flags, stack depot will increment
143 * the refcount on the saved stack trace if it already exists in stack depot.
144 * Users of this flag must also call stack_depot_put() when keeping the stack
147 * If the provided stack trace comes from the interrupt context, only the part
155 * Return: Handle of the stack struct stored in depot, 0 on failure
163 * stack_depot_save - Save a stack trace to stack depot
165 * @entries: Pointer to the stack trace
166 * @nr_entries: Number of frames in the stack
169 * Does not increment the refcount on the saved stack trace; see
175 * Return: Handle of the stack trace stored in depot, 0 on failure
183 * @handle: Stack depot handle
192 * stack_depot_fetch - Fetch a stack trace from stack depot
194 * @handle: Stack depot handle returned from stack_depot_save()
195 * @entries: Pointer to store the address of the stack trace
197 * Return: Number of frames for the fetched stack
203 * stack_depot_print - Print a stack trace from stack depot
205 * @stack: Stack depot handle returned from stack_depot_save()
207 void stack_depot_print(depot_stack_handle_t stack);
210 * stack_depot_snprint - Print a stack trace from stack depot into a buffer
212 * @handle: Stack depot handle returned from stack_depot_save()
223 * stack_depot_put - Drop a reference to a stack trace from stack depot
225 * @handle: Stack depot handle returned from stack_depot_save()
227 * The stack trace is evicted from stack depot once all references to it have
230 * this stack trace).
235 * stack_depot_set_extra_bits - Set extra bits in a stack depot handle
237 * @handle: Stack depot handle returned from stack_depot_save()
240 * Return: Stack depot handle with extra bits set
242 * Stack depot handles have a few unused bits, which can be used for storing
243 * user-specific information. These bits are transparent to the stack depot.
249 * stack_depot_get_extra_bits - Retrieve extra bits from a stack depot handle
251 * @handle: Stack depot handle with extra bits saved
253 * Return: Extra bits retrieved from the stack depot handle