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:10
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Initialize the stat rbtree at each trace_stat file opening.* All of these copies and sorting are required on all opening* since the stats could have changed between two file sessions.

Proto:static int stat_seq_init(struct stat_session *session)

Type:int

Parameter:

TypeParameterName
struct stat_session *session
125  ts = ts
126  root = stat_root
128  ret = 0
131  mutex_lock( & stat_mutex)
132  __reset_stat_session(session)
134  If Not Compare two entries for stats sorting Then Compare two entries for stats sorting = For tracers that don't provide a stat_cmp callback.* This one will force an insertion as right-most node* in the rbtree.
137  stat = stat_start(ts)
138  If Not stat Then Go to exit
141  ret = insert_stat(root, stat, Compare two entries for stats sorting )
142  If ret Then Go to exit
148  cycle
149  stat = stat_next(stat, i)
152  If Not stat Then Break
155  ret = insert_stat(root, stat, Compare two entries for stats sorting )
156  If ret Then Go to exit_free_rbtree
160  exit :
161  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.
162  Return ret
164  exit_free_rbtree :
165  __reset_stat_session(session)
166  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.
167  Return ret
Caller
NameDescribe
tracing_stat_openThe session stat is refilled and resorted at each stat file opening