函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\events\core.c Create Date:2022-07-27 14:50:58
Last Modify:2022-05-20 07:50:19 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Insert @event into @groups' tree; using {@event->cpu, ++@groups->index} for* key (see perf_event_groups_less). This places it last inside the CPU* subtree.

函数原型:static void perf_event_groups_insert(struct perf_event_groups *groups, struct perf_event *event)

返回类型:void

参数:

类型参数名称
struct perf_event_groups *groups
struct perf_event *event
1555  group_index等于index先自加
1557  node等于rb_node
1558  parent等于node
1560 node循环
1561  parent等于node
1562  node_event等于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.( * node, structperf_event, group_node)
1564  如果Compare function for event groups;* Implements complex key that first sorts by CPU and then by virtual index* which provides ordering when rotating groups for the same CPU.node等于rb_left
1566  否则node等于rb_right
1570  rb_link_node( & group_node, parent, node)
1571  rb_insert_color( & group_node, & tree)
调用者
名称描述
add_event_to_groupsHelper function to insert event into the pinned or flexible groups.
rotate_ctxMove @event to the tail of the @ctx's elegible events.