函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Allocate a new object. If the pool is empty, switch off the debugger.* Must be called with interrupts disabled.

函数原型:static struct debug_obj *alloc_object(void *addr, struct debug_bucket *b, struct debug_obj_descr *descr)

返回类型:struct debug_obj

参数:

类型参数名称
void *addr
struct debug_bucket *b
struct debug_obj_descr *descr
228  percpu_pool等于this_cpu_ptr( & percpu_obj_pool)
231  如果此条件成立可能性大(为编译器优化)(obj_cache)则
232  obj等于Allocate a new object from the hlist
233  如果obj
234  obj_free自减
235  转到:init_obj
239  raw_spin_lock( & pool_lock)
240  obj等于Allocate a new object from the hlist
241  如果obj
242  obj_pool_used自加
243  WRITE_ONCE(obj_pool_free, obj_pool_free - 1)
252 i小于ODEBUG_BATCH_SIZE循环
256  如果非obj2退出
260  obj_free自加
261  obj_pool_used自加
266  如果obj_pool_used大于obj_pool_max_usedobj_pool_max_used等于obj_pool_used
269  如果obj_pool_free小于Because of the presence of percpu free pools, obj_pool_free will* under-count those in the percpu free pools. Similarly, obj_pool_used* will over-count those in the percpu free pools. Adjustments will be* made at debug_stats_show()Because of the presence of percpu free pools, obj_pool_free will* under-count those in the percpu free pools. Similarly, obj_pool_used* will over-count those in the percpu free pools. Adjustments will be* made at debug_stats_show()等于obj_pool_free
272  raw_spin_unlock( & pool_lock)
274  init_obj :
275  如果obj
276  object等于addr
277  descr等于descr
278  state等于ODEBUG_STATE_NONE
279  astate等于0
280  hlist_add_head( & node, & list)
282  返回:obj
调用者
名称描述
__debug_object_init