函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Add a scanning area to the object. If at least one such area is added,* kmemleak will only scan these ranges rather than the whole memory block.

函数原型:static void add_scan_area(unsigned long ptr, size_t size, gfp_t gfp)

返回类型:void

参数:

类型参数名称
unsigned longptr
size_tsize
gfp_tgfp
789  struct kmemleak_scan_area * area = NULL
791  object等于Look up an object in the object search tree and increase its use_count.
792  如果非object
793  Print a warning and dump the stack trace.("Adding scan area to unknown object at 0x%08lx\n", ptr)
795  返回
798  如果scan_area_cachearea等于分配高速缓存区
801  spin_lock_irqsave( & lock, flags)
802  如果非area
803  pr_warn_once("Cannot allocate a scan area, scanning the full object\n")
805  bject status flags 或等于lag set to fully scan the object when scan_area allocation failed
806  转到:out_unlock
808  如果size恒等于SIZE_MAX
809  size等于pointersizeptr
810  否则如果ptrsize大于pointersize
811  Print a warning and dump the stack trace.("Scan area larger than object 0x%08lx\n", ptr)
812  Print the kmemleak_object information. This function is used mainly for* debugging special cases when kmemleak operations. It must be called with* the object->lock held.
813  kmem_cache_free(scan_area_cache, area)
814  转到:out_unlock
817  INIT_HLIST_NODE( & node)
818  start等于ptr
819  size等于size
821  hlist_add_head( & node, & memory ranges to be scanned inside an object (empty for all) )
822  out_unlock :
823  spin_unlock_irqrestore( & lock, flags)
824  Decrement the object use_count. Once the count is 0, free the object using* an RCU callback. Since put_object() may be called via the kmemleak_free() ->* delete_object() path, the delayed RCU freeing ensures that there is no
调用者
名称描述
kmemleak_scan_areakmemleak_scan_area - limit the range to be scanned in an allocated object*@ptr: pointer to beginning or inside the object