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

Name:__create_synth_event

Proto:static int __create_synth_event(int argc, const char *name, const char **argv)

Type:int

Parameter:

TypeParameterName
intargc
const char *name
const char **argv
1295  struct synth_event * event = NULL
1296  consumed = 0 , n_fields = 0 , ret = 0
1305  If name[0] == '\0' || argc < 1 Then Return -EINVAL
1308  mutex_lock( & event_mutex)
1310  event = find_synth_event(name)
1311  If event Then
1312  ret = -EEXIST
1313  Go to out
1316  When i < argc - 1 cycle
1317  If strcmp(argv[i], ";") == 0 Then Continue
1319  If n_fields == SYNTH_FIELDS_MAX Then
1320  ret = -EINVAL
1321  Go to err
1324  field = parse_synth_field(argc - i, & argv[i], & consumed)
1325  If IS_ERR(field) Then
1326  ret = PTR_ERR(field)
1327  Go to err
1329  fields[n_fields++] = field
1330  i += consumed - 1
1333  If i < argc && strcmp(argv[i], ";") != 0 Then
1334  ret = -EINVAL
1335  Go to err
1338  event = alloc_synth_event(name, n_fields, fields)
1339  If IS_ERR(event) Then
1340  ret = PTR_ERR(event)
1341  event = NULL
1342  Go to err
1344  ret = register_synth_event(event)
1345  If Not ret Then dyn_event_add( & devent)
1347  Else free_synth_event(event)
1349  out :
1350  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
1352  Return ret
1353  err :
1354  When i < n_fields cycle free_synth_field(fields[i])
1357  Go to out
Caller
NameDescribe
create_or_delete_synth_event
synth_event_create