函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\stackdepot.c Create Date:2022-07-27 08:19:40
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:depot_alloc_stack

函数原型:static struct stack_record *depot_alloc_stack(unsigned long *entries, int size, u32 hash, void **prealloc, gfp_t alloc_flags)

返回类型:struct stack_record

参数:

类型参数名称
unsigned long *entries
intsize
u32hash
void **prealloc
gfp_talloc_flags
106  required_size等于offsetof(structstack_record, entries)加sizeof(unsignedlong)乘size
110  required_size等于@a is a power of 2 value (required_size, 1 << STACK_ALLOC_ALIGN)
112  如果此条件成立可能性小(为编译器优化)(depot_offset + required_size > STACK_ALLOC_SIZE)则
114  WARN_ONCE(1, "Stack depot reached limit capacity")
115  返回:NULL
117  depot_index自加
118  depot_offset等于0
124  如果depot_index加1小于STACK_ALLOC_MAX_SLABSsmp_store_release( & next_slab_inited, 0)
127  init_stack_slab(prealloc)
128  如果(stack_slabs[depot_index] == NULL)则返回:NULL
131  stack等于stack_slabs[depot_index]加depot_offset
133  Hash in the hastable 等于hash
134  Number of frames in the stack 等于size
135  slabindex等于depot_index
136  offset等于depot_offset右移STACK_ALLOC_ALIGN
137  valid等于1
138  内存复制( Variable-sized array of entries. , entries, size * sizeof(unsignedlong))
139  depot_offset加等于required_size
141  返回:stack
调用者
名称描述
stack_depot_savestack_depot_save - Save a stack trace from an array*@entries: Pointer to storage array*@nr_entries: Size of the storage array*@alloc_flags: Allocation gfp flags* Return: The handle of the stack struct stored in depot