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

Name:trace_action_create

Proto:static int trace_action_create(struct hist_trigger_data *hist_data, struct action_data *data)

Type:int

Parameter:

TypeParameterName
struct hist_trigger_data *hist_data
struct action_data *data
4242  tr = tr
4243  char * event_name, * param, * system = NULL
4246  field_pos = 0
4249  ret = 0
4251  lockdep_assert_held( & event_mutex)
4253  If use_trace_keyword Then synth_event_name = synth_event_name
4255  Else synth_event_name = action_name
4258  event = find_synth_event(synth_event_name)
4259  If Not event Then
4260  hist_err(tr, HIST_ERR_SYNTH_EVENT_NOT_FOUND, errpos(synth_event_name))
4261  Return -EINVAL
4264  ref++
4266  When i < n_params cycle
4269  p = param = kstrdup(params[i], GFP_KERNEL)
4270  If Not param Then
4271  ret = -ENOMEM
4272  Go to err
4275  system = strsep - Split a string into tokens*@s: The string to be searched*@ct: The characters to search for* strsep() updates @s to point after the token, ready for the next call.* It returns empty tokens, too, behaving exactly like the libc function
4276  If Not param Then
4277  param = system
4278  system = event_name = NULL
4279  Else
4281  If Not param Then
4282  kfree(p)
4283  ret = -EINVAL
4284  Go to err
4288  If param[0] == '$' Then hist_field = trace_action_find_var(hist_data, data, system, event_name, param)
4292  Else hist_field = trace_action_create_field_var(hist_data, data, system, event_name, param)
4299  If Not hist_field Then
4300  kfree(p)
4301  ret = -EINVAL
4302  Go to err
4305  If check_synth_field(event, hist_field, field_pos) == 0 Then
4308  If Not var_ref Then
4309  kfree(p)
4310  ret = -ENOMEM
4311  Go to err
4315  If WARN_ON(var_ref_idx < 0) Then
4316  ret = var_ref_idx
4317  Go to err
4322  field_pos++
4323  kfree(p)
4324  Continue
4327  hist_err(tr, HIST_ERR_SYNTH_TYPE_MISMATCH, errpos(param))
4328  kfree(p)
4329  ret = -EINVAL
4330  Go to err
4333  If field_pos != n_fields Then
4334  hist_err(tr, HIST_ERR_SYNTH_COUNT_MISMATCH, errpos(name))
4335  ret = -EINVAL
4336  Go to err
4339  synth_event = event
4340  out :
4341  Return ret
4342  err :
4343  ref--
4345  Go to out
Caller
NameDescribe
action_create