函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\slab.c Create Date:2022-07-27 17:19:49
Last Modify:2022-05-23 17:02:55 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:__do_kmalloc - allocate memory*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).*@caller: function caller for debug tracking of the caller* Return: pointer to the allocated memory or %NULL in case of error

函数原型:static __always_inline void *__do_kmalloc(size_t size, gfp_t flags, unsigned long caller)

返回类型:void

参数:

类型参数名称
size_tsize
gfp_tflags
unsigned longcaller
3697  如果此条件成立可能性小(为编译器优化)(size > Maximum size for which we actually use a slab cache )则返回:NULL
3699  cachep等于kmalloc_slab(size, flags)
3700  如果此条件成立可能性小(为编译器优化)(ZERO_OR_NULL_PTR(cachep))则返回:cachep
3702  ret等于slab_alloc(cachep, flags, caller)
3704  ret等于kasan_kmalloc(cachep, ret, size, flags)
3705  trace_kmalloc(caller, ret, size, The size of an object including metadata , flags)
3708  返回:ret
调用者
名称描述
__kmalloc开辟内存
__kmalloc_track_caller