blob: 6bb4bc1a5f5459fc06b90548558a4745d0973b05 [file] [log] [blame]
Thomas Gleixnerc942fdd2019-05-27 08:55:06 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Alexander Potapenkocd110162016-03-25 14:22:08 -07002/*
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 Potapenkocd110162016-03-25 14:22:08 -07009 */
10
11#ifndef _LINUX_STACKDEPOT_H
12#define _LINUX_STACKDEPOT_H
13
14typedef u32 depot_stack_handle_t;
15
Thomas Gleixnerc0cfc332019-04-25 11:44:56 +020016depot_stack_handle_t stack_depot_save(unsigned long *entries,
17 unsigned int nr_entries, gfp_t gfp_flags);
Alexander Potapenkocd110162016-03-25 14:22:08 -070018
Thomas Gleixnerc0cfc332019-04-25 11:44:56 +020019unsigned int stack_depot_fetch(depot_stack_handle_t handle,
20 unsigned long **entries);
Alexander Potapenkocd110162016-03-25 14:22:08 -070021
Alexander Potapenko505a0ef2020-04-06 20:10:22 -070022unsigned int filter_irq_stacks(unsigned long *entries, unsigned int nr_entries);
23
Vijayanand Jittabfed1c32021-02-12 17:14:55 +110024#ifdef CONFIG_STACKDEPOT
25int stack_depot_init(void);
26#else
27static inline int stack_depot_init(void)
28{
29 return 0;
30}
31#endif /* CONFIG_STACKDEPOT */
32
Alexander Potapenkocd110162016-03-25 14:22:08 -070033#endif