函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\debug\kdb\kdb_support.c Create Date:2022-07-27 12:47:52
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:debug_kmalloc

函数原型:void *debug_kmalloc(size_t size, gfp_t flags)

返回类型:void

参数:

类型参数名称
size_tsize
gfp_tflags
749  void * p = NULL
750  如果非get_dap_lock()则
751  __release(Locking is awkward. The debug code is called from all contexts,* including non maskable interrupts. A normal spinlock is not safe* in NMI context. Try to get the debug allocator lock, if it cannot* be obtained after a second then give up)
752  返回:NULL
754  h等于debug_alloc_pooldah_first
755  如果dah_first_call
756  size等于debug_alloc_pool_aligned的长度减dah_overhead
757  dah_first_call等于0
759  size等于@a is a power of 2 value (size, The memory returned by this allocator must be aligned, which means* so must the header size)
760  prev = best = bestprev = NULL
761  当1循环
762  如果size大于等于size且非bestsize小于size的值则
763  best等于h
764  bestprev等于prev
765  如果size恒等于size退出
768  如果非ffset of next header from start of pool 退出
770  prev等于h
771  h等于debug_alloc_poolffset of next header from start of pool
773  如果非best则转到:out
775  rem等于sizesize
777  如果ffset of next header from start of pool 恒等于0且bestprev恒等于NULLrem小于dah_overhead则转到:out
779  如果rem大于等于dah_overhead
780  size等于size
781  h_offset等于bestdebug_alloc_pooldah_overheadsize
783  h等于debug_alloc_poolh_offset
784  size等于remdah_overhead
785  ffset of next header from start of pool 等于ffset of next header from start of pool
786  否则h_offset等于ffset of next header from start of pool
788  caller等于__builtin_return_address(0)
789  dah_used加等于size
790  dah_used_max等于两数取大(dah_used, dah_used_max)
791  如果bestprevffset of next header from start of pool 等于h_offset
793  否则dah_first等于h_offset
795  p等于bestdah_overhead
796  memset(p, r use-uninitialised poisoning , size - 1)
797  *psize减1的差等于d-byte of poisoning
798  out :
799  自旋锁解锁
800  返回:p
调用者
名称描述
kdbnearsymkdbnearsym - Return the name of the symbol with the nearest address* less than 'addr'