Function report |
Source Code:mm\kmemleak.c |
Create Date:2022-07-28 16:22:17 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name: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.
Proto:static void kmemleak_scan(void)
Type:void
Parameter:Nothing
| 1403 | new_leaks = 0 |
| 1405 | jiffies_last_scan = jiffies |
| 1410 | spin_lock_irqsave( & lock, flags) |
| 1416 | If atomic_read( & bject usage count; object freed when use_count == 0 ) > 1 Then |
| 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 | If Not page Then Continue |
| 1454 | If page_to_nid(page) != i Then Continue |
| 1457 | If page_count(page) == 0 Then Continue |
| 1459 | Scan a memory block (exclusive range) for valid pointers and add those* found to the gray list. |
| 1460 | If Not (pfn & 63) Then cond_resched() |
| 1464 | put_online_mems() |
| 1469 | If ables or disables the task stacks scanning Then |
| 1472 | read_lock( & tasklist_lock) |
| 1474 | stack = try_get_task_stack(p) |
| 1475 | If stack Then |
| 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) |
| 1502 | spin_unlock_irqrestore( & lock, flags) |
| 1514 | If Memory scanning is a long process and it needs to be interruptable. This* function checks whether such interrupt condition occurred. Then Return |
| 1522 | spin_lock_irqsave( & lock, flags) |
| 1527 | If kmemleak_verbose Then 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 | If new_leaks Then |
| 1537 | If there are leaks that can be reported = true |
| Name | Describe |
|---|---|
| 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 |
| 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 |