Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\trace\trace_events_hist.c Create Date:2022-07-28 12:29:04
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:alloc_synth_event

Proto:static struct synth_event *alloc_synth_event(const char *name, int n_fields, struct synth_field **fields)

Type:struct synth_event

Parameter:

TypeParameterName
const char *name
intn_fields
struct synth_field **fields
1247  event = 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).
1248  If Not event Then
1249  event = ERR_PTR( - ENOMEM)
1250  Go to out
1253  name = kstrdup(name, GFP_KERNEL)
1254  If Not name Then
1255  kfree(event)
1256  event = ERR_PTR( - ENOMEM)
1257  Go to out
1260  fields = kcalloc - allocate memory for an array. The memory is set to zero.*@n: number of elements.*@size: element size.*@flags: the type of memory to allocate (see kmalloc).
1261  If Not fields Then
1262  free_synth_event(event)
1263  event = ERR_PTR( - ENOMEM)
1264  Go to out
1267  dyn_event_init( & devent, & synth_event_ops)
1269  When i < n_fields cycle fields[i] = fields[i]
1272  n_fields = n_fields
1273  out :
1274  Return event
Caller
NameDescribe
__create_synth_event