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

Name:insert_stat

Proto:static int insert_stat(struct rb_root *root, void *stat, cmp_func_t cmp)

Type:int

Parameter:

TypeParameterName
struct rb_root *root
void *stat
cmp_func_tcmp
77  struct rb_node * * new = & (rb_node), * parent = NULL
80  data = 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).
81  If Not data Then Return -ENOMEM
83  stat = stat
89  When new cycle
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  If result >= 0 Then new = &rb_left
99  Else new = &rb_right
103  rb_link_node( & node, parent, new)
104  rb_insert_color( & node, root)
105  Return 0
Caller
NameDescribe
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.