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

Name:vent_trigger_callback - Generic event_command @func implementation*@cmd_ops: The command ops, used for trigger registration*@file: The trace_event_file associated with the event*@glob: The raw string used to register the trigger*@cmd: The cmd portion of

Proto:static int event_trigger_callback(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
628  char * trigger = NULL
633  If param && isdigit(param[0]) Then 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
636  trigger_ops = get_trigger_ops(cmd, trigger)
638  ret = -ENOMEM
639  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).
640  If Not trigger_data Then Go to out
643  count = -1
644  ops = trigger_ops
645  cmd_ops = cmd_ops
646  private_data = file
647  Initialization list head
648  Initialization list head
650  If glob[0] == '!' Then
651  unreg(glob + 1, trigger_ops, trigger_data, file)
652  kfree(trigger_data)
653  ret = 0
654  Go to out
657  If trigger Then
658  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
660  ret = -EINVAL
661  If Not strlen - Find the length of a string*@s: The string to be sized Then Go to out_free
668  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.
669  If ret Then Go to out_free
673  If Not param Then Go to out_reg
676  If Not set_filter Then Go to out_reg
679  ret = set_filter(param, trigger_data, file)
680  If ret < 0 Then Go to out_free
683  out_reg :
685  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
686  ret = reg(glob, trigger_ops, trigger_data, file)
692  If Not ret Then
693  unreg(glob, trigger_ops, trigger_data, file)
694  ret = -ENOENT
695  Else if ret > 0 Then ret = 0
699  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
700  out :
701  Return ret
703  out_free :
704  If set_filter Then set_filter(NULL, trigger_data, NULL)
706  kfree(trigger_data)
707  Go to out