Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\stackdepot.c Create Date:2022-07-28 07:20:55
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:depot_alloc_stack

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

Type:struct stack_record

Parameter:

TypeParameterName
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  If Value for the false possibility is greater at compile time(depot_offset + required_size > STACK_ALLOC_SIZE) Then
114  WARN_ONCE(1, "Stack depot reached limit capacity")
115  Return NULL
117  depot_index++
118  depot_offset = 0
124  If depot_index + 1 < STACK_ALLOC_MAX_SLABS Then smp_store_release( & next_slab_inited, 0)
127  init_stack_slab(prealloc)
128  If (stack_slabs[depot_index] == NULL) Then Return 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  No 3D Now!( Variable-sized array of entries. , entries, size * sizeof(unsignedlong))
139  depot_offset += required_size
141  Return stack
Caller
NameDescribe
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