函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\trace\trace_events_inject.c Create Date:2022-07-27 13:35:39
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:parse_field

函数原型:static int parse_field(char *str, struct trace_event_call *call, struct ftrace_event_field **pf, u64 *pv)

返回类型:int

参数:

类型参数名称
char *str
struct trace_event_call *call
struct ftrace_event_field **pf
u64 *pv
41  i等于0
45  如果非str[i]则返回:0
48 Note: isspace() must return false for %NUL-terminator (str[i])循环
49  i自加
50  s等于i
51 isalnum(str[i])或str[i]恒等于'_'循环
52  i自加
53  len等于is
54  如果非len则返回:负EINVAL
57  field_name等于kmemdup_nul(str + s, len, GFP_KERNEL)
58  如果非field_name则返回:负ENOMEM
60  field等于trace_find_event_field(call, field_name)
61  kfree(field_name)
62  如果非field则返回:负ENOENT
65  pf等于field
66 Note: isspace() must return false for %NUL-terminator (str[i])循环
67  i自加
68  如果str[i]不等于'='则返回:负EINVAL
70  i自加
71 Note: isspace() must return false for %NUL-terminator (str[i])循环
72  i自加
73  s等于i
74  如果是数字str[i]恒等于'-'则
79  如果is_string_field(field)则返回:负EINVAL
82  如果str[i]恒等于'-'则i自加
86 isalnum(str[i])循环
87  i自加
88  num等于strs
89  c等于str[i]
90  如果c不等于'\0'且非Note: isspace() must return false for %NUL-terminator (c)则返回:负EINVAL
92  str[i]等于'\0'
94  如果is_signedret等于kstrtoll - convert a string to a long 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 or a minus sign.
96  否则ret等于kstrtoull - convert a string to an unsigned long 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.
98  str[i]等于c
99  如果ret则返回:ret
102  pv等于val
103  返回:i
104  否则如果str[i]恒等于'\''或str[i]恒等于'"'则
105  q等于str[i]
108  如果非is_string_field(field)则返回:负EINVAL
111 str[i]循环
112  如果str[i]恒等于'\\'且str[i + 1]则
113  i自加
114  继续下一循环
116  如果str[i]恒等于q退出
119  如果非str[i]则返回:负EINVAL
123  s自加
124  len等于is
125  如果len大于等于Should handle KSYM_SYMBOL_LEN 则返回:负EINVAL
128  pv等于strs
129  str[i]等于0
131  i自加
132  返回:i
135  返回:负EINVAL
调用者
名称描述
parse_entryCaller is responsible to free the *pentry.