函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: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.

函数原型:static int stat_seq_init(struct stat_session *session)

返回类型:int

参数:

类型参数名称
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  如果非Compare two entries for stats sorting 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  如果非stat则转到:exit
141  ret等于insert_stat(root, stat, Compare two entries for stats sorting )
142  如果ret则转到:exit
148  循环
149  stat等于stat_next(stat, i)
152  如果非stat退出
155  ret等于insert_stat(root, stat, Compare two entries for stats sorting )
156  如果ret则转到: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  返回: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  返回:ret
调用者
名称描述
tracing_stat_openThe session stat is refilled and resorted at each stat file opening