#define pr_fmt(fmt) …
#include <linux/debugfs.h>
#include <linux/gfp.h>
#include <linux/jhash.h>
#include <linux/kernel.h>
#include <linux/kmsan.h>
#include <linux/list.h>
#include <linux/mm.h>
#include <linux/mutex.h>
#include <linux/poison.h>
#include <linux/printk.h>
#include <linux/rculist.h>
#include <linux/rcupdate.h>
#include <linux/refcount.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/stacktrace.h>
#include <linux/stackdepot.h>
#include <linux/string.h>
#include <linux/types.h>
#include <linux/memblock.h>
#include <linux/kasan-enabled.h>
#define DEPOT_POOLS_CAP …
#define DEPOT_MAX_POOLS …
static bool stack_depot_disabled;
static bool __stack_depot_early_init_requested __initdata = … IS_ENABLED(…);
static bool __stack_depot_early_init_passed __initdata;
#define STACK_HASH_TABLE_SCALE …
#define STACK_BUCKET_NUMBER_ORDER_MIN …
#define STACK_BUCKET_NUMBER_ORDER_MAX …
#define STACK_HASH_SEED …
static struct list_head *stack_table;
static unsigned int stack_bucket_number_order;
static unsigned int stack_hash_mask;
static void *stack_pools[DEPOT_MAX_POOLS];
static void *new_pool;
static int pools_num;
static size_t pool_offset = …;
static LIST_HEAD(free_stacks);
static DEFINE_RAW_SPINLOCK(pool_lock);
enum depot_counter_id { … };
static long counters[DEPOT_COUNTER_COUNT];
static const char *const counter_names[] = …;
static_assert(…);
static int __init disable_stack_depot(char *str)
{ … }
early_param(…);
void __init stack_depot_request_early_init(void)
{ … }
static void init_stack_table(unsigned long entries)
{ … }
int __init stack_depot_early_init(void)
{ … }
int stack_depot_init(void)
{ … }
EXPORT_SYMBOL_GPL(…);
static bool depot_init_pool(void **prealloc)
{ … }
static void depot_keep_new_pool(void **prealloc)
{ … }
static struct stack_record *depot_pop_free_pool(void **prealloc, size_t size)
{ … }
static struct stack_record *depot_pop_free(void)
{ … }
static inline size_t depot_stack_record_size(struct stack_record *s, unsigned int nr_entries)
{ … }
static struct stack_record *
depot_alloc_stack(unsigned long *entries, unsigned int nr_entries, u32 hash, depot_flags_t flags, void **prealloc)
{ … }
static struct stack_record *depot_fetch_stack(depot_stack_handle_t handle)
{ … }
static void depot_free_stack(struct stack_record *stack)
{ … }
static inline u32 hash_stack(unsigned long *entries, unsigned int size)
{ … }
static inline
int stackdepot_memcmp(const unsigned long *u1, const unsigned long *u2,
unsigned int n)
{ … }
static inline struct stack_record *find_stack(struct list_head *bucket,
unsigned long *entries, int size,
u32 hash, depot_flags_t flags)
{ … }
depot_stack_handle_t stack_depot_save_flags(unsigned long *entries,
unsigned int nr_entries,
gfp_t alloc_flags,
depot_flags_t depot_flags)
{ … }
EXPORT_SYMBOL_GPL(…);
depot_stack_handle_t stack_depot_save(unsigned long *entries,
unsigned int nr_entries,
gfp_t alloc_flags)
{ … }
EXPORT_SYMBOL_GPL(…);
struct stack_record *__stack_depot_get_stack_record(depot_stack_handle_t handle)
{ … }
unsigned int stack_depot_fetch(depot_stack_handle_t handle,
unsigned long **entries)
{ … }
EXPORT_SYMBOL_GPL(…);
void stack_depot_put(depot_stack_handle_t handle)
{ … }
EXPORT_SYMBOL_GPL(…);
void stack_depot_print(depot_stack_handle_t stack)
{ … }
EXPORT_SYMBOL_GPL(…);
int stack_depot_snprint(depot_stack_handle_t handle, char *buf, size_t size,
int spaces)
{ … }
EXPORT_SYMBOL_GPL(…);
depot_stack_handle_t __must_check stack_depot_set_extra_bits(
depot_stack_handle_t handle, unsigned int extra_bits)
{ … }
EXPORT_SYMBOL(…);
unsigned int stack_depot_get_extra_bits(depot_stack_handle_t handle)
{ … }
EXPORT_SYMBOL(…);
static int stats_show(struct seq_file *seq, void *v)
{ … }
DEFINE_SHOW_ATTRIBUTE(…);
static int depot_debugfs_init(void)
{ … }
late_initcall(depot_debugfs_init);