函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

函数原型:void __ref kmemleak_alloc(const void *ptr, size_t size, int min_count, gfp_t gfp)

返回类型:void

参数:

类型参数名称
const void *ptr
size_tsize
intmin_count
gfp_tgfp
890  pr_debug("%s(0x%p, %zu, %d)\n", __func__, ptr, size, min_count)
892  如果set if tracing memory operations is enabled ptr且非是错误Create the metadata (struct kmemleak_object) corresponding to an allocated* memory block and add it to the object_list and object_tree_root.
调用者
名称描述
genradix_alloc_node
alloc_large_system_hashallocate a large system hash table from bootmem* - it is assumed that the hash table must contain an exact power-of-2* quantity of entries* - limit is the number of hash buckets, not the total allocation size
__do_kmalloc_nodeEnd of slob allocator proper. Begin kmem_cache_alloc and kmalloc frontend.
kmalloc_large_node_hookHooks for other subsystems that check memory allocations. In a typical* production configuration these hooks all should produce no code at all.
kmemleak_alloc_physkmemleak_alloc_phys - similar to kmemleak_alloc but taking a physical* address argument*@phys: physical address of the object*@size: size of the object*@min_count: minimum number of references to this object
sg_kmallocThe default behaviour of sg_alloc_table() is to use these kmalloc/kfree* helpers.
kmalloc_orderTo avoid unnecessary overhead, we pass through large allocation requests* directly to the page allocator. We use __GFP_COMP, because we will need to* know the allocation order to free the pages properly in kfree.
kmemleak_alloc_recursive
blk_mq_alloc_rqs