xref: /linux-6.15/include/linux/stackdepot.h (revision 7857ccdf)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  * A generic stack depot implementation
4  *
5  * Author: Alexander Potapenko <[email protected]>
6  * Copyright (C) 2016 Google, Inc.
7  *
8  * Based on code by Dmitry Chernenkov.
9  */
10 
11 #ifndef _LINUX_STACKDEPOT_H
12 #define _LINUX_STACKDEPOT_H
13 
14 #include <linux/gfp.h>
15 
16 typedef u32 depot_stack_handle_t;
17 
18 depot_stack_handle_t stack_depot_save(unsigned long *entries,
19 				      unsigned int nr_entries, gfp_t gfp_flags);
20 
21 unsigned int stack_depot_fetch(depot_stack_handle_t handle,
22 			       unsigned long **entries);
23 
24 unsigned int filter_irq_stacks(unsigned long *entries, unsigned int nr_entries);
25 
26 #ifdef CONFIG_STACKDEPOT
27 int stack_depot_init(void);
28 #else
29 static inline int stack_depot_init(void)
30 {
31 	return 0;
32 }
33 #endif	/* CONFIG_STACKDEPOT */
34 
35 #endif
36