Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\debug\kdb\kdb_support.c Create Date:2022-07-28 11:43:38
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:debug_kusage

Proto:void debug_kusage(void)

Type:void

Parameter:Nothing

872  debug_kusage_one_time = 1
874  If Not get_dap_lock() Then
875  __release(Locking is awkward. The debug code is called from all contexts,* including non maskable interrupts. A normal spinlock is not safe* in NMI context. Try to get the debug allocator lock, if it cannot* be obtained after a second then give up)
876  Return
878  h_free = debug_alloc_pool + dah_first
879  If dah_first == 0 && ( size == size of debug_alloc_pool_aligned - dah_overhead || dah_first_call) Then Go to out
883  If Not debug_kusage_one_time Then Go to out
885  debug_kusage_one_time = 0
886  kdb_printf("%s: debug_kmalloc memory leak dah_first %d\n", __func__, dah_first)
888  If dah_first Then
889  h_used = debug_alloc_pool
890  kdb_printf("%s: h_used %px size %d\n", __func__, h_used, size)
893  Do
894  h_used = h_free + dah_overhead + size
896  kdb_printf("%s: h_used %px size %d caller %px\n", __func__, h_used, size, caller)
898  h_free = debug_alloc_pool + ffset of next header from start of pool
900  When ffset of next header from start of pool cycle
901  h_used = h_free + dah_overhead + size
903  If h_used - debug_alloc_pool != size of debug_alloc_pool_aligned Then kdb_printf("%s: h_used %px size %d caller %px\n", __func__, h_used, size, caller)
907  out :
908  spin_unlock( & Locking is awkward. The debug code is called from all contexts,* including non maskable interrupts. A normal spinlock is not safe* in NMI context. Try to get the debug allocator lock, if it cannot* be obtained after a second then give up)