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

Name:create_var

Proto:static struct hist_field *create_var(struct hist_trigger_data *hist_data, struct trace_event_file *file, char *name, int size, const char *type)

Type:struct hist_field

Parameter:

TypeParameterName
struct hist_trigger_data *hist_data
struct trace_event_file *file
char *name
intsize
const char *type
3487  If find_var(hist_data, file, name) && Not remove Then
3488  var = ERR_PTR( - EINVAL)
3489  Go to out
3492  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).
3493  If Not var Then
3494  var = ERR_PTR( - ENOMEM)
3495  Go to out
3498  idx = racing_map_add_var - Add a field describing a tracing_map var*@map: The tracing_map* Add a var to the map and return the index identifying it in the map* and associated tracing_map_elts
3499  If idx < 0 Then
3500  kfree(var)
3501  var = ERR_PTR( - EINVAL)
3502  Go to out
3505  flags = HIST_FIELD_FL_VAR
3506  idx = idx
3507  hist_data = hist_data = hist_data
3508  size = size
3509  name = kstrdup(name, GFP_KERNEL)
3510  type = kstrdup(type, GFP_KERNEL)
3511  If Not name || Not type Then
3512  kfree(name)
3513  kfree(type)
3514  kfree(var)
3515  var = ERR_PTR( - ENOMEM)
3517  out :
3518  Return var
Caller
NameDescribe
create_field_var
track_data_create