Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:register_stat_tracer

Proto:int register_stat_tracer(struct tracer_stat *trace)

Type:int

Parameter:

TypeParameterName
struct tracer_stat *trace
311  ret = -EINVAL
313  If Not trace Then Return -EINVAL
316  If Not stat_start || Not stat_next || Not stat_show Then Return -EINVAL
320  mutex_lock( & all_stat_sessions_mutex)
322  If ts == trace Then Go to out
326  ret = -ENOMEM
328  session = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
329  If Not session Then Go to out
332  ts = trace
333  Initialization list head
334  mutex_init - initialize the mutex*@mutex: the mutex to be initialized* Initialize the mutex to unlocked state.* It is not allowed to initialize an already locked mutex.( & stat_mutex)
336  ret = init_stat_file(session)
337  If ret Then
338  destroy_session(session)
339  Go to out
342  ret = 0
344  list_add_tail - add a new entry*@new: new entry to be added*@head: list head to add it before* Insert a new entry before the specified head.* This is useful for implementing queues.
345  out :
346  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
348  Return ret
Caller
NameDescribe
init_annotated_branch_stats