mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
filter_irq_stacks() has little to do with the stackdepot implementation, except that it is usually used by users (such as KASAN) of stackdepot to reduce the stack trace. However, filter_irq_stacks() itself is not useful without a stack trace as obtained by stack_trace_save() and friends. Therefore, move filter_irq_stacks() to kernel/stacktrace.c, so that new users of filter_irq_stacks() do not have to start depending on STACKDEPOT only for filter_irq_stacks(). Link: https://lkml.kernel.org/r/20210923104803.2620285-1-elver@google.com Signed-off-by: Marco Elver <elver@google.com> Acked-by: Dmitry Vyukov <dvyukov@google.com> Cc: Alexander Potapenko <glider@google.com> Cc: Jann Horn <jannh@google.com> Cc: Aleksandr Nogikh <nogikh@google.com> Cc: Taras Madan <tarasmadan@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
37 lines
844 B
C
37 lines
844 B
C
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
/*
|
|
* A generic stack depot implementation
|
|
*
|
|
* Author: Alexander Potapenko <glider@google.com>
|
|
* Copyright (C) 2016 Google, Inc.
|
|
*
|
|
* Based on code by Dmitry Chernenkov.
|
|
*/
|
|
|
|
#ifndef _LINUX_STACKDEPOT_H
|
|
#define _LINUX_STACKDEPOT_H
|
|
|
|
#include <linux/gfp.h>
|
|
|
|
typedef u32 depot_stack_handle_t;
|
|
|
|
depot_stack_handle_t __stack_depot_save(unsigned long *entries,
|
|
unsigned int nr_entries,
|
|
gfp_t gfp_flags, bool can_alloc);
|
|
|
|
depot_stack_handle_t stack_depot_save(unsigned long *entries,
|
|
unsigned int nr_entries, gfp_t gfp_flags);
|
|
|
|
unsigned int stack_depot_fetch(depot_stack_handle_t handle,
|
|
unsigned long **entries);
|
|
|
|
#ifdef CONFIG_STACKDEPOT
|
|
int stack_depot_init(void);
|
|
#else
|
|
static inline int stack_depot_init(void)
|
|
{
|
|
return 0;
|
|
}
|
|
#endif /* CONFIG_STACKDEPOT */
|
|
|
|
#endif
|