Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\kmemleak.c Create Date:2022-07-28 16:21:13
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

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

Proto:static struct kmemleak_object *lookup_object(unsigned long ptr, int alias)

Type:struct kmemleak_object

Parameter:

TypeParameterName
unsigned longptr
intalias
381  rb = rb_node
383  When rb cycle
384  object = rb_entry(rb, structkmemleak_object, rb_node)
386  If ptr < pointer Then rb = rb_left
388  Else if pointer + size <= ptr Then rb = rb_right
390  Else if pointer == ptr || alias Then Return object
392  Else
393  Print a warning and dump the stack trace.("Found object by alias at 0x%08lx\n", ptr)
396  Break
399  Return NULL
Caller
NameDescribe
find_and_get_objectLook up an object in the object search tree and increase its use_count.
find_and_remove_objectLook up an object in the object search tree and remove it from both* object_tree_root and object_list. The returned object's use_count should be* at least 1, as initially set by create_object().
scan_blockScan a memory block (exclusive range) for valid pointers and add those* found to the gray list.