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

Name:parse_synth_field

Proto:static struct synth_field *parse_synth_field(int argc, const char **argv, int *consumed)

Type:struct synth_field

Parameter:

TypeParameterName
intargc
const char **argv
int *consumed
1015  prefix = NULL , field_type = argv[0]
1016  ret = 0
1018  If field_type[0] == ';' Then field_type++
1021  If Not strcmp(field_type, "unsigned") Then
1022  If argc < 3 Then Return ERR_PTR( - EINVAL)
1024  prefix = "unsigned "
1025  field_type = argv[1]
1026  field_name = argv[2]
1027  consumed = 3
1028  Else
1029  field_name = argv[1]
1030  consumed = 2
1033  field = 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).
1034  If Not field Then Return ERR_PTR( - ENOMEM)
1037  len = strlen - Find the length of a string*@s: The string to be sized
1038  array = strchr - Find the first occurrence of the character c in the string s.*@s: the string to be searched*@c: the character to search for
1039  If array Then len -= strlen - Find the length of a string*@s: The string to be sized
1041  Else if field_name[len - 1] == ';' Then len--
1044  name = kmemdup_nul(field_name, len, GFP_KERNEL)
1045  If Not name Then
1046  ret = -ENOMEM
1047  Go to free
1050  If field_type[0] == ';' Then field_type++
1052  len = strlen - Find the length of a string*@s: The string to be sized + 1
1053  If array Then len += strlen - Find the length of a string*@s: The string to be sized
1055  If prefix Then len += strlen - Find the length of a string*@s: The string to be sized
1058  type = 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).
1059  If Not type Then
1060  ret = -ENOMEM
1061  Go to free
1063  If prefix Then strcat(type, prefix)
1065  strcat(type, field_type)
1066  If array Then
1067  strcat(type, array)
1068  If type[len - 1] == ';' Then type[len - 1] = '\0'
1072  size = synth_field_size(type)
1073  If Not size Then
1074  ret = -EINVAL
1075  Go to free
1078  If synth_field_is_string(type) Then is_string = true
1081  is_signed = synth_field_signed(type)
1083  out :
1084  Return field
1085  free :
1086  free_synth_field(field)
1087  field = ERR_PTR(ret)
1088  Go to out
Caller
NameDescribe
__create_synth_event