Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\debugobjects.c Create Date:2022-07-28 06:55:03
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

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

Proto:static struct debug_obj *alloc_object(void *addr, struct debug_bucket *b, struct debug_obj_descr *descr)

Type:struct debug_obj

Parameter:

TypeParameterName
void *addr
struct debug_bucket *b
struct debug_obj_descr *descr
228  percpu_pool = this_cpu_ptr( & percpu_obj_pool)
231  If Value is more likely to compile time(obj_cache) Then
232  obj = Allocate a new object from the hlist
233  If obj Then
234  obj_free--
235  Go to init_obj
239  raw_spin_lock( & pool_lock)
240  obj = Allocate a new object from the hlist
241  If obj Then
242  obj_pool_used++
243  WRITE_ONCE(obj_pool_free, obj_pool_free - 1)
252  When i < ODEBUG_BATCH_SIZE cycle
266  If obj_pool_used > obj_pool_max_used Then obj_pool_max_used = obj_pool_used
269  If 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() Then 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  If obj Then
276  object = addr
277  descr = descr
278  state = ODEBUG_STATE_NONE
279  astate = 0
280  hlist_add_head( & node, & list)
282  Return obj
Caller
NameDescribe
__debug_object_init