函数逻辑报告 |
Source Code:mm\kmemleak.c |
Create Date:2022-07-27 17:57:04 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:Scan data sections and all the referenced memory blocks allocated via the* kernel's standard allocators. This function must be called with the* scan_mutex held.
函数原型:static void kmemleak_scan(void)
返回类型:void
参数:无
1403 | new_leaks等于0 |
1405 | jiffies_last_scan等于jiffies |
1410 | spin_lock_irqsave( & lock, flags) |
1416 | 如果atomic_read( & bject usage count; object freed when use_count == 0 )大于1则 |
1417 | pr_debug("object->use_count = %d\n", atomic_read( & bject usage count; object freed when use_count == 0 )) |
1427 | spin_unlock_irqrestore( & lock, flags) |
1441 | get_online_mems() |
1442 | for_each_online_node(i) |
1443 | start_pfn等于node_start_pfn(i) |
1444 | end_pfn等于node_end_pfn(i) |
1450 | 如果非page则继续下一循环 |
1454 | 如果page_to_nid(page)不等于i则继续下一循环 |
1457 | 如果page_count(page)恒等于0则继续下一循环 |
1459 | Scan a memory block (exclusive range) for valid pointers and add those* found to the gray list. |
1460 | 如果非pfn按位与63的值则cond_resched() |
1464 | put_online_mems() |
1472 | read_lock( & tasklist_lock) |
1474 | stack等于try_get_task_stack(p) |
1475 | 如果stack则 |
1476 | Scan a memory block (exclusive range) for valid pointers and add those* found to the gray list. |
1477 | put_task_stack(p) |
1480 | read_unlock( & tasklist_lock) |
1495 | spin_lock_irqsave( & lock, flags) |
1499 | he total number of pointers found pointing to this object 等于minimum number of a pointers found before it is considered leak |
1500 | 添加链表项 |
1502 | spin_unlock_irqrestore( & lock, flags) |
1522 | spin_lock_irqsave( & lock, flags) |
1527 | 如果kmemleak_verbose则Printing of the unreferenced objects information to the seq file. The* print_unreferenced function must be called with the object->lock held. |
1530 | new_leaks自加 |
1532 | spin_unlock_irqrestore( & lock, flags) |
1536 | 如果new_leaks则 |
1537 | If there are leaks that can be reported = true |
名称 | 描述 |
---|---|
kmemleak_scan_thread | Thread function performing automatic memory scanning. Unreferenced objects* at the end of a memory scan are reported but only the first time. |
kmemleak_write | File write operation to configure kmemleak at run-time |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |