函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:stack_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

函数原型:depot_stack_handle_t stack_depot_save(unsigned long *entries, unsigned int nr_entries, gfp_t alloc_flags)

返回类型:depot_stack_handle_t

参数:

类型参数名称
unsigned long *entries
unsigned intnr_entries
gfp_talloc_flags
227  found等于NULL
228  retval等于0
229  struct page * page = NULL
230  void * prealloc = NULL
234  如果此条件成立可能性小(为编译器优化)(nr_entries == 0)则转到:fast_exit
237  hash等于Calculate hash for a stack
238  bucket等于stack_table[hash & STACK_HASH_MASK]
245  found等于find_stack(smp_load_acquire(bucket), entries, nr_entries, hash)
247  如果found则转到:exit
258  如果此条件成立可能性小(为编译器优化)(!smp_load_acquire( & next_slab_inited))则
264  alloc_flags与等于GFP_ZONEMASK的反
265  alloc_flags与等于DOC: Useful GFP flag combinations* Useful GFP flag combinations* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~* Useful GFP flag combinations that are commonly used. It is recommended* that subsystems start with one of these combinations and then set/clear按位或GFP_KERNEL
266  alloc_flags或等于DOC: Action modifiers* Action modifiers* ~~~~~~~~~~~~~~~~* %__GFP_NOWARN suppresses allocation failure reports.* %__GFP_COMP address compound page metadata.* %__GFP_ZERO returns a zeroed page on success.
267  page等于alloc_pages(alloc_flags, 'Slab' size order for stack depot, 4 pages )
268  如果pageprealloc等于page_address(page)
272  spin_lock_irqsave( & depot_lock, flags)
274  found等于find_stack( * bucket, entries, nr_entries, hash)
275  如果非found
276  new等于depot_alloc_stack(entries, nr_entries, hash, & prealloc, alloc_flags)
279  如果new
286  found等于new
288  否则如果prealloc
293  WARN_ON(!init_stack_slab( & prealloc))
296  spin_unlock_irqrestore( & depot_lock, flags)
297  exit :
298  如果prealloc
300  free_pages((unsignedlong)prealloc, 'Slab' size order for stack depot, 4 pages )
302  如果foundretval等于handle
304  fast_exit :
305  返回:retval
调用者
名称描述
create_dummy_stack
save_stack
save_stack