Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\trace\trace_event_perf.c Create Date:2022-07-28 12:23:17
Last Modify:2020-03-17 20:20:33 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:perf_trace_event_reg

Proto:static int perf_trace_event_reg(struct trace_event_call *tp_event, struct perf_event *p_event)

Type:int

Parameter:

TypeParameterName
struct trace_event_call *tp_event
struct perf_event *p_event
99  __percpu * list
100  ret = -ENOMEM
103  tp_event = tp_event
104  If perf_refcount++ > 0 Then Return 0
107  list = alloc_percpu(structhlist_head)
108  If Not list Then Go to fail
111  for_each_possible_cpu(cpu)
112  INIT_HLIST_HEAD(per_cpu_ptr(list, cpu))
114  perf_events = list
116  If Not Count the events in use (per event id, not per instance) Then
117  __percpu * buf
122  If Not buf Then Go to fail
125  perf_trace_buf[i] = buf
129  ret = reg(tp_event, TRACE_REG_PERF_REGISTER, NULL)
130  If ret Then Go to fail
133  Count the events in use (per event id, not per instance) ++
134  Return 0
136  fail :
137  If Not Count the events in use (per event id, not per instance) Then
142  perf_trace_buf[i] = NULL
146  If Not --perf_refcount Then
147  free previously allocated percpu memory
148  perf_events = NULL
151  Return ret
Caller
NameDescribe
perf_trace_event_init