Function report |
Source Code:mm\kmemleak.c |
Create Date:2022-07-28 16:21:29 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:Create the metadata (struct kmemleak_object) corresponding to an allocated* memory block and add it to the object_list and object_tree_root.
Proto:static struct kmemleak_object *create_object(unsigned long ptr, size_t size, int min_count, gfp_t gfp)
Type:struct kmemleak_object
Parameter:
| Type | Parameter | Name |
|---|---|---|
| unsigned long | ptr | |
| size_t | size | |
| int | min_count | |
| gfp_t | gfp |
| 579 | If Not object Then |
| 588 | Process spin lock initialization( & lock) |
| 596 | creation timestamp = jiffies |
| 601 | pid of the current task = 0 |
| 602 | strncpy(xecutable name , "hardirq", size of xecutable name ) |
| 603 | Else if in_serving_softirq() Then |
| 604 | pid of the current task = 0 |
| 605 | strncpy(xecutable name , "softirq", size of xecutable name ) |
| 606 | Else |
| 607 | pid of the current task = pid |
| 614 | strncpy(xecutable name , comm, size of xecutable name ) |
| 622 | untagged_ptr = kasan_reset_tag((void * )ptr) |
| 624 | max_addr = max - return maximum of two values of the same or compatible types*@x: first value*@y: second value(max_addr, untagged_ptr + size) |
| 626 | rb_parent = NULL |
| 629 | parent = rb_entry(rb_parent, structkmemleak_object, rb_node) |
| 634 | Else |
| 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 | Go to out |
| 647 | rb_link_node( & rb_node, rb_parent, link) |
| 648 | rb_insert_color( & rb_node, & search tree for object boundaries ) |
| 651 | out : |
| 652 | write_unlock_irqrestore( & w_lock protecting the access to object_list and object_tree_root , flags) |
| 653 | Return object |
| Name | Describe |
|---|---|
| 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 | Kmemleak initialization. |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |