Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:event_enable_trigger_func

Proto:int event_enable_trigger_func(struct event_command *cmd_ops, struct trace_event_file *file, char *glob, char *cmd, char *param)

Type:int

Parameter:

TypeParameterName
struct event_command *cmd_ops
struct trace_event_file *file
char *glob
char *cmd
char *param
1359  tr = tr
1362  bool hist = false
1368  If Not param Then Return -EINVAL
1372  trigger = 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
1373  If Not trigger Then Return -EINVAL
1376  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
1377  If Not trigger Then Return -EINVAL
1380  event = 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
1382  ret = -EINVAL
1383  event_enable_file = Returns valid trace event files that match system and event
1384  If Not event_enable_file Then Go to out
1394  enable = strcmp(cmd, Avoid typos ) == 0
1396  trigger_ops = get_trigger_ops(cmd, trigger)
1398  ret = -ENOMEM
1399  trigger_data = 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).
1400  If Not trigger_data Then Go to out
1403  enable_data = 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).
1404  If Not enable_data Then
1405  kfree(trigger_data)
1406  Go to out
1409  count = -1
1410  ops = trigger_ops
1411  cmd_ops = cmd_ops
1412  Initialization list head
1413  RCU_INIT_POINTER() - initialize an RCU protected pointer*@p: The pointer to be initialized.*@v: The value to initialized the pointer to.* Initialize an RCU-protected pointer in special cases where readers(filter, NULL)
1415  hist = hist
1416  enable = enable
1417  file = event_enable_file
1418  private_data = enable_data
1420  If glob[0] == '!' Then
1421  unreg(glob + 1, trigger_ops, trigger_data, file)
1422  kfree(trigger_data)
1423  kfree(enable_data)
1424  ret = 0
1425  Go to out
1429  vent_trigger_init - Generic event_trigger_ops @init implementation*@ops: The trigger ops associated with the trigger*@data: Trigger-specific data* Common implementation of event trigger initialization
1431  If trigger Then
1432  number = 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
1434  ret = -EINVAL
1435  If Not strlen - Find the length of a string*@s: The string to be sized Then Go to out_free
1442  ret = kstrtoul - convert a string to an unsigned long*@s: The start of the string. The string must be null-terminated, and may also* include a single newline before its terminating null. The first character* may also be a plus sign, but not a minus sign.
1443  If ret Then Go to out_free
1447  If Not param Then Go to out_reg
1450  If Not set_filter Then Go to out_reg
1453  ret = set_filter(param, trigger_data, file)
1454  If ret < 0 Then Go to out_free
1457  out_reg :
1459  ret = try_module_get(mod)
1460  If Not ret Then
1461  ret = -EBUSY
1462  Go to out_free
1465  ret = trace_event_enable_disable(event_enable_file, 1, 1)
1466  If ret < 0 Then Go to out_put
1468  ret = reg(glob, trigger_ops, trigger_data, file)
1474  If Not ret Then
1475  ret = -ENOENT
1476  Go to out_disable
1477  Else if ret < 0 Then Go to out_disable
1480  ret = 0
1481  vent_trigger_free - Generic event_trigger_ops @free implementation*@ops: The trigger ops associated with the trigger*@data: Trigger-specific data* Common implementation of event trigger de-initialization
1482  out :
1483  Return ret
1485  out_disable :
1486  trace_event_enable_disable(event_enable_file, 0, 1)
1487  out_put :
1488  module_put(mod)
1489  out_free :
1490  If set_filter Then set_filter(NULL, trigger_data, NULL)
1492  vent_trigger_free - Generic event_trigger_ops @free implementation*@ops: The trigger ops associated with the trigger*@data: Trigger-specific data* Common implementation of event trigger de-initialization
1493  kfree(enable_data)
1494  Go to out