函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Some very simple testing. This function needs to be extended for* proper testing.

函数原型:static int __init kmemleak_test_init(void)

返回类型:int

参数:

40  打印信息("Kmemleak testing\n")
43  打印信息("kmalloc(32) = %p\n", kmalloc(32, GFP_KERNEL))
44  打印信息("kmalloc(32) = %p\n", kmalloc(32, GFP_KERNEL))
45  打印信息("kmalloc(1024) = %p\n", kmalloc(1024, GFP_KERNEL))
46  打印信息("kmalloc(1024) = %p\n", kmalloc(1024, GFP_KERNEL))
47  打印信息("kmalloc(2048) = %p\n", kmalloc(2048, GFP_KERNEL))
48  打印信息("kmalloc(2048) = %p\n", kmalloc(2048, GFP_KERNEL))
49  打印信息("kmalloc(4096) = %p\n", kmalloc(4096, GFP_KERNEL))
50  打印信息("kmalloc(4096) = %p\n", kmalloc(4096, GFP_KERNEL))
57  打印信息("vmalloc(64) = %p\n", vmalloc - allocate virtually contiguous memory*@size: allocation size* Allocate enough pages to cover @size from the page level* allocator and map them into contiguous kernel virtual space.* For tight control over page level allocator and protection flags)
58  打印信息("vmalloc(64) = %p\n", vmalloc - allocate virtually contiguous memory*@size: allocation size* Allocate enough pages to cover @size from the page level* allocator and map them into contiguous kernel virtual space.* For tight control over page level allocator and protection flags)
59  打印信息("vmalloc(64) = %p\n", vmalloc - allocate virtually contiguous memory*@size: allocation size* Allocate enough pages to cover @size from the page level* allocator and map them into contiguous kernel virtual space.* For tight control over page level allocator and protection flags)
60  打印信息("vmalloc(64) = %p\n", vmalloc - allocate virtually contiguous memory*@size: allocation size* Allocate enough pages to cover @size from the page level* allocator and map them into contiguous kernel virtual space.* For tight control over page level allocator and protection flags)
61  打印信息("vmalloc(64) = %p\n", vmalloc - allocate virtually contiguous memory*@size: allocation size* Allocate enough pages to cover @size from the page level* allocator and map them into contiguous kernel virtual space.* For tight control over page level allocator and protection flags)
67 i小于10循环
68  elem等于分配内存并置零
69  打印信息("kzalloc(sizeof(*elem)) = %p\n", elem)
70  如果非elem则返回:负ENOMEM
72  初始化链表头
73  添加链表项
76  遍历可用CPU(i)
77  per_cpu(kmemleak_test_pointer, i)等于kmalloc(129, GFP_KERNEL)
78  打印信息("kmalloc(129) = %p\n", per_cpu(kmemleak_test_pointer, i))
82  返回:0