函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\trace\trace_events_filter.c Create Date:2022-07-27 13:33:25
Last Modify:2022-05-22 20:19:57 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Called when a predicate is encountered by predicate_parse()

函数原型:static int parse_pred(const char *str, void *data, int pos, struct filter_parse_error *pe, struct filter_pred **pred_ptr)

返回类型:int

参数:

类型参数名称
const char *str
void *data
intpos
struct filter_parse_error *pe
struct filter_pred **pred_ptr
1156  call等于data
1158  struct filter_pred * pred = NULL
1167  i等于0
1170 Note: isspace() must return false for %NUL-terminator (str[i])循环
1171  i自加
1172  s等于i
1174 isalnum(str[i])或str[i]恒等于'_'循环
1175  i自加
1177  len等于is
1179  如果非len则返回:负1
1182  field_name等于kmemdup_nul(str + s, len, GFP_KERNEL)
1183  如果非field_name则返回:负ENOMEM
1188  field等于trace_find_event_field(call, field_name)
1189  kfree(field_name)
1190  如果非field
1191  parse_error(pe, FILT_ERR_FIELD_NOT_FOUND, pos + i)
1192  返回:负EINVAL
1195 Note: isspace() must return false for %NUL-terminator (str[i])循环
1196  i自加
1199 ops[op]循环
1201  如果字符串指定长度比较恒等于0则退出
1205  如果非ops[op]则
1206  parse_error(pe, FILT_ERR_INVALID_OP, pos + i)
1207  转到:err_free
1210  i加等于strlen - Find the length of a string*@s: The string to be sized
1212 Note: isspace() must return false for %NUL-terminator (str[i])循环
1213  i自加
1215  s等于i
1217  pred等于分配内存并置零
1218  如果非pred则返回:负ENOMEM
1221  field等于field
1222  offset等于offset
1223  op等于op
1225  如果ftrace_event_is_function(call)则
1233  如果字符串比较不等于0则
1235  转到:err_free
1237  fn等于filter_pred_none
1243  如果str[i]恒等于'\''或str[i]恒等于'"'则q等于str[i]
1245  否则q等于0
1248 str[i]循环
1249  如果qstr[i]恒等于q退出
1251  如果非qstr[i]恒等于')'或str[i]恒等于'&'或str[i]恒等于'|'的值则退出
1256  如果qs自加
1258  len等于is
1259  如果len大于等于Should handle KSYM_SYMBOL_LEN
1261  转到:err_free
1264  len等于len
1265  strncpy(pattern, str + s, len)
1266  pattern[len]等于0
1269  否则如果str[i]恒等于'\''或str[i]恒等于'"'则
1270  q等于str[i]
1274  :op恒等于OP_NE
1275  not等于1
1277  :op恒等于OP_GLOB
1278  :op恒等于OP_EQ
1279  退出
1280  默认
1282  转到:err_free
1286  如果非is_string_field(field)则
1288  转到:err_free
1291 str[i]循环
1292  如果str[i]恒等于q退出
1295  如果非str[i]则
1297  转到:err_free
1301  s自加
1302  len等于is
1303  如果len大于等于Should handle KSYM_SYMBOL_LEN
1305  转到:err_free
1308  len等于len
1309  strncpy(pattern, str + s, len)
1310  pattern[len]等于0
1312  filter_build_regex(pred)
1314  如果filter_type恒等于FILTER_COMM
1317  否则如果filter_type恒等于FILTER_STATIC_STRING
1319  field_len等于size
1321  否则如果filter_type恒等于FILTER_DYN_STRINGfn等于Filter predicate for dynamic sized arrays of characters
1323  否则fn等于Filter predicate for char * pointers
1326  i自加
1328  否则如果是数字str[i]恒等于'-'则
1331  如果is_string_field(field)则
1333  转到:err_free
1336  如果op恒等于OP_GLOB
1338  转到:err_free
1341  如果str[i]恒等于'-'则i自加
1345 isalnum(str[i])循环
1346  i自加
1348  len等于is
1350  如果len大于等于num_buf的长度则
1352  转到:err_free
1355  strncpy(num_buf, str + s, len)
1356  num_buf[len]等于0
1359  如果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.
1361  否则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.
1363  如果ret
1365  转到:err_free
1368  val等于val
1370  如果filter_type恒等于FILTER_CPUfn等于Filter predicate for CPUs.
1372  否则
1375  如果op恒等于OP_NEnot等于1
1379  否则
1380  parse_error(pe, FILT_ERR_INVALID_VALUE, pos + i)
1381  转到:err_free
1384  pred_ptr等于pred
1385  返回:i
1387  err_free :
1388  kfree(pred)
1389  返回:负EINVAL