函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:insert_stat

函数原型:static int insert_stat(struct rb_root *root, void *stat, cmp_func_t cmp)

返回类型:int

参数:

类型参数名称
struct rb_root *root
void *stat
cmp_func_tcmp
77  struct rb_node * * new = & (rb_node), * parent = NULL
80  data等于分配内存并置零
81  如果非data则返回:负ENOMEM
83  stat等于stat
89 new循环
93  this等于container_of - cast a member of a structure out to the containing structure*@ptr: the pointer to the member.*@type: the type of the container struct this is embedded in.*@member: the name of the member within the struct.( * new, structstat_node, node)
94  result等于cmp(stat, stat)
96  parent等于new
97  如果result大于等于0则new等于rb_left的地址
99  否则new等于rb_right的地址
103  rb_link_node( & node, parent, new)
104  rb_insert_color( & node, root)
105  返回:0
调用者
名称描述
stat_seq_initInitialize 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.