Thomas Gleixner | c942fdd | 2019-05-27 08:55:06 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Alexander Potapenko | cd11016 | 2016-03-25 14:22:08 -0700 | [diff] [blame] | 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. |
Alexander Potapenko | cd11016 | 2016-03-25 14:22:08 -0700 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | #ifndef _LINUX_STACKDEPOT_H |
| 12 | #define _LINUX_STACKDEPOT_H |
| 13 | |
| 14 | typedef u32 depot_stack_handle_t; |
| 15 | |
Thomas Gleixner | c0cfc33 | 2019-04-25 11:44:56 +0200 | [diff] [blame] | 16 | depot_stack_handle_t stack_depot_save(unsigned long *entries, |
| 17 | unsigned int nr_entries, gfp_t gfp_flags); |
Alexander Potapenko | cd11016 | 2016-03-25 14:22:08 -0700 | [diff] [blame] | 18 | |
Thomas Gleixner | c0cfc33 | 2019-04-25 11:44:56 +0200 | [diff] [blame] | 19 | unsigned int stack_depot_fetch(depot_stack_handle_t handle, |
| 20 | unsigned long **entries); |
Alexander Potapenko | cd11016 | 2016-03-25 14:22:08 -0700 | [diff] [blame] | 21 | |
Alexander Potapenko | 505a0ef | 2020-04-06 20:10:22 -0700 | [diff] [blame] | 22 | unsigned int filter_irq_stacks(unsigned long *entries, unsigned int nr_entries); |
| 23 | |
Vijayanand Jitta | bfed1c3 | 2021-02-12 17:14:55 +1100 | [diff] [blame] | 24 | #ifdef CONFIG_STACKDEPOT |
| 25 | int stack_depot_init(void); |
| 26 | #else |
| 27 | static inline int stack_depot_init(void) |
| 28 | { |
| 29 | return 0; |
| 30 | } |
| 31 | #endif /* CONFIG_STACKDEPOT */ |
| 32 | |
Alexander Potapenko | cd11016 | 2016-03-25 14:22:08 -0700 | [diff] [blame] | 33 | #endif |