Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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

Proto:depot_stack_handle_t stack_depot_save(unsigned long *entries, unsigned int nr_entries, gfp_t alloc_flags)

Type:depot_stack_handle_t

Parameter:

TypeParameterName
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  If Value for the false possibility is greater at compile time(nr_entries == 0) Then Go to 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  If found Then Go to exit
258  If Value for the false possibility is greater at compile time(!smp_load_acquire( & next_slab_inited)) Then
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  If page Then prealloc = page_address(page)
272  spin_lock_irqsave( & depot_lock, flags)
274  found = find_stack( * bucket, entries, nr_entries, hash)
275  If Not found Then
276  new = depot_alloc_stack(entries, nr_entries, hash, & prealloc, alloc_flags)
279  If new Then
286  found = new
288  Else if prealloc Then
293  WARN_ON(!init_stack_slab( & prealloc))
296  spin_unlock_irqrestore( & depot_lock, flags)
297  exit :
298  If prealloc Then
300  free_pages((unsignedlong)prealloc, 'Slab' size order for stack depot, 4 pages )
302  If found Then retval = handle
304  fast_exit :
305  Return retval
Caller
NameDescribe
create_dummy_stack
save_stack