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

Name:create_field_var

Proto:static struct field_var *create_field_var(struct hist_trigger_data *hist_data, struct trace_event_file *file, char *field_name)

Type:struct field_var

Parameter:

TypeParameterName
struct hist_trigger_data *hist_data
struct trace_event_file *file
char *field_name
3525  struct hist_field * val = NULL, * var = NULL
3526  flags = HIST_FIELD_FL_VAR
3527  tr = tr
3529  ret = 0
3531  If n_field_vars >= SYNTH_FIELDS_MAX Then
3532  hist_err(tr, HIST_ERR_TOO_MANY_FIELD_VARS, errpos(field_name))
3533  ret = -EINVAL
3534  Go to err
3537  val = parse_atom(hist_data, file, field_name, & flags, NULL)
3538  If IS_ERR(val) Then
3539  hist_err(tr, HIST_ERR_FIELD_VAR_PARSE_FAIL, errpos(field_name))
3540  ret = PTR_ERR(val)
3541  Go to err
3544  var = create_var(hist_data, file, field_name, size, type)
3545  If IS_ERR(var) Then
3546  hist_err(tr, HIST_ERR_VAR_CREATE_FIND_FAIL, errpos(field_name))
3547  kfree(val)
3548  ret = PTR_ERR(var)
3549  Go to err
3552  field_var = 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).
3553  If Not field_var Then
3554  kfree(val)
3555  kfree(var)
3556  ret = -ENOMEM
3557  Go to err
3560  var = var
3561  val = val
3562  out :
3563  Return field_var
3564  err :
3565  field_var = ERR_PTR(ret)
3566  Go to out
Caller
NameDescribe
create_target_field_varreate_target_field_var - Automatically create a variable for a field*@target_hist_data: The target hist trigger*@subsys_name: Optional subsystem name*@event_name: Optional event name*@var_name: The name of the field (and the resulting variable)* Hist