函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: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.

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

返回类型:struct kmemleak_object

参数:

类型参数名称
unsigned longptr
intalias
381  rb等于rb_node
383 rb循环
384  object等于rb_entry(rb, structkmemleak_object, rb_node)
386  如果ptr小于pointerrb等于rb_left
388  否则如果pointersize小于等于ptrrb等于rb_right
390  否则如果pointer恒等于ptralias则返回:object
392  否则
393  Print a warning and dump the stack trace.("Found object by alias at 0x%08lx\n", ptr)
396  退出
399  返回:NULL
调用者
名称描述
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.