函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Look up an object in the object search tree and increase its use_count.

函数原型:static struct kmemleak_object *find_and_get_object(unsigned long ptr, int alias)

返回类型:struct kmemleak_object

参数:

类型参数名称
unsigned longptr
intalias
516  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
517  read_lock_irqsave( & w_lock protecting the access to object_list and object_tree_root , flags)
518  object等于Look-up a memory block metadata (kmemleak_object) in the object search* tree based on a pointer value. If alias is 0, only values pointing to the* beginning of the memory block are allowed. The kmemleak_lock must be held* when calling this function.
519  read_unlock_irqrestore( & w_lock protecting the access to object_list and object_tree_root , flags)
522  如果object且非Increment the object use_count. Return 1 if successful or 0 otherwise. Note* that once an object's use_count reached 0, the RCU freeing was already* registered and the object should no longer be used. This function must beobject = NULL
524  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
526  返回:object
调用者
名称描述
paint_ptr
add_scan_areaAdd 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.
object_set_excess_refAny surplus references (object already gray) to 'ptr' are passed to* 'excess_ref'. This is used in the vmalloc() case where a pointer to* vm_struct may be used as an alternative reference to the vmalloc'ed object* (see free_thread_stack()).
object_no_scanSet the OBJECT_NO_SCAN flag for the object corresponding to the give* pointer. Such object will not be scanned by kmemleak but references to it* are searched.
kmemleak_update_tracekmemleak_update_trace - update object allocation stack trace*@ptr: pointer to beginning of the object* Override the object allocation stack trace for cases where the actual* allocation place is not always useful.
dump_str_object_info