1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 /* 3 * A generic stack depot implementation 4 * 5 * Author: Alexander Potapenko <glider@google.com> 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, 20 gfp_t gfp_flags, bool can_alloc); 21 22 depot_stack_handle_t stack_depot_save(unsigned long *entries, 23 unsigned int nr_entries, gfp_t gfp_flags); 24 25 unsigned int stack_depot_fetch(depot_stack_handle_t handle, 26 unsigned long **entries); 27 28 #ifdef CONFIG_STACKDEPOT 29 int stack_depot_init(void); 30 #else stack_depot_init(void)31static inline int stack_depot_init(void) 32 { 33 return 0; 34 } 35 #endif /* CONFIG_STACKDEPOT */ 36 37 #endif 38