函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\trace\trace_event_perf.c Create Date:2022-07-27 13:30:44
Last Modify:2020-03-17 20:20:33 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:perf_trace_event_reg

函数原型:static int perf_trace_event_reg(struct trace_event_call *tp_event, struct perf_event *p_event)

返回类型:int

参数:

类型参数名称
struct trace_event_call *tp_event
struct perf_event *p_event
99  __percpulist
100  ret等于负ENOMEM
103  tp_event等于tp_event
104  如果perf_refcount自加大于0则返回:0
107  list等于alloc_percpu(structhlist_head)
108  如果非list则转到:fail
111  遍历可用CPU(cpu)
112  INIT_HLIST_HEAD(per_cpu_ptr(list, cpu))
114  perf_events等于list
116  如果非Count the events in use (per event id, not per instance)
117  __percpubuf
122  如果非buf则转到:fail
125  perf_trace_buf[i]等于buf
129  ret等于reg(tp_event, TRACE_REG_PERF_REGISTER, NULL)
130  如果ret则转到:fail
133  Count the events in use (per event id, not per instance) 自加
134  返回:0
136  fail :
137  如果非Count the events in use (per event id, not per instance)
141  释放内存
142  perf_trace_buf[i] = NULL
146  如果非perf_refcount先自减则
147  释放内存
148  perf_events = NULL
151  返回:ret
调用者
名称描述
perf_trace_event_init