函数逻辑报告 |
Source Code:mm\kmemleak.c |
Create Date:2022-07-27 17:56:13 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| 首页 | 函数Tree |
| 注解内核,赢得工具 | 下载SCCT | English |
函数名称:Create the metadata (struct kmemleak_object) corresponding to an allocated* memory block and add it to the object_list and object_tree_root.
函数原型:static struct kmemleak_object *create_object(unsigned long ptr, size_t size, int min_count, gfp_t gfp)
返回类型:struct kmemleak_object
参数:
| 类型 | 参数 | 名称 |
|---|---|---|
| unsigned long | ptr | |
| size_t | size | |
| int | min_count | |
| gfp_t | gfp |
| 579 | 如果非object则 |
| 585 | 初始化链表头 |
| 586 | 初始化链表头 |
| 588 | spin_lock_init( & lock) |
| 596 | creation timestamp 等于jiffies |
| 601 | pid of the current task 等于0 |
| 602 | strncpy(xecutable name , "hardirq", xecutable name 的长度) |
| 603 | 否则如果in_serving_softirq()则 |
| 604 | pid of the current task 等于0 |
| 605 | strncpy(xecutable name , "softirq", xecutable name 的长度) |
| 606 | 否则 |
| 607 | pid of the current task 等于pid |
| 614 | strncpy(xecutable name , comm, xecutable name 的长度) |
| 622 | untagged_ptr等于kasan_reset_tag((void * )ptr) |
| 623 | minimum and maximum address that may be valid pointers 等于两数取小(minimum and maximum address that may be valid pointers , untagged_ptr) |
| 624 | max_addr等于两数取大(max_addr, untagged_ptr + size) |
| 626 | rb_parent = NULL |
| 629 | parent等于rb_entry(rb_parent, structkmemleak_object, rb_node) |
| 634 | 否则 |
| 635 | Macro invoked when a serious kmemleak condition occurred and cannot be* recovered from. Kmemleak will be disabled and further allocation/freeing* tracing no longer available.("Cannot insert 0x%lx into the object search tree (overlaps existing)\n", ptr) |
| 643 | object = NULL |
| 644 | 转到:out |
| 647 | rb_link_node( & rb_node, rb_parent, link) |
| 648 | rb_insert_color( & rb_node, & search tree for object boundaries ) |
| 650 | 添加RCU链表项 |
| 651 | out : |
| 652 | write_unlock_irqrestore( & w_lock protecting the access to object_list and object_tree_root , flags) |
| 653 | 返回:object |
| 名称 | 描述 |
|---|---|
| delete_object_part | Look up the metadata (struct kmemleak_object) corresponding to ptr and* delete it. If the memory block is partially freed, the function may create* additional metadata for the remaining parts of the block. |
| kmemleak_alloc | kmemleak_alloc - register a newly allocated object*@ptr: pointer to beginning of the object*@size: size of the object*@min_count: minimum number of references to this object. If during memory* scanning a number of references less than @min_count is found, |
| kmemleak_alloc_percpu | kmemleak_alloc_percpu - register a newly allocated __percpu object*@ptr: __percpu pointer to beginning of the object*@size: size of the object*@gfp: flags used for kmemleak internal memory allocations* This function is called from the kernel percpu |
| kmemleak_vmalloc | kmemleak_vmalloc - register a newly vmalloc'ed object*@area: pointer to vm_struct*@size: size of the object*@gfp: __vmalloc() flags used for kmemleak internal memory allocations* This function is called from the vmalloc() kernel allocator when a new |
| kmemleak_init | 内存泄漏检测机制的初始化 |
| 源代码转换工具 开放的插件接口 | X |
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |