| Function report | 
| Source Code: kernel\trace\trace_events_filter.c | Create Date:2022-07-28 12:25:10 | 
| Last Modify:2022-05-22 20:19:57 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:Called when a predicate is encountered by predicate_parse()
Proto:static int parse_pred(const char *str, void *data, int pos, struct filter_parse_error *pe, struct filter_pred **pred_ptr)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| const char * | str | |
| void * | data | |
| int | pos | |
| struct filter_parse_error * | pe | |
| struct filter_pred ** | pred_ptr | 
| 1158 | struct filter_pred * pred = NULL | 
| 1167 | i = 0 | 
| 1170 | When Note: isspace() must return false for %NUL-terminator (str[i]) cycle | 
| 1171 | i++ | 
| 1175 | i++ | 
| 1179 | If Not len Then Return -1 | 
| 1182 | field_name = kmemdup_nul(str + s, len, GFP_KERNEL) | 
| 1183 | If Not field_name Then Return -ENOMEM | 
| 1188 | field = trace_find_event_field(call, field_name) | 
| 1189 | kfree(field_name) | 
| 1190 | If Not field Then | 
| 1191 | parse_error(pe, FILT_ERR_FIELD_NOT_FOUND, pos + i) | 
| 1192 | Return -EINVAL | 
| 1195 | When Note: isspace() must return false for %NUL-terminator (str[i]) cycle | 
| 1196 | i++ | 
| 1206 | parse_error(pe, FILT_ERR_INVALID_OP, pos + i) | 
| 1207 | Go to err_free | 
| 1212 | When Note: isspace() must return false for %NUL-terminator (str[i]) cycle | 
| 1213 | i++ | 
| 1217 | pred = 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). | 
| 1225 | If ftrace_event_is_function(call) Then | 
| 1234 | parse_error(pe, FILT_ERR_IP_FIELD_ONLY, pos + i) | 
| 1235 | Go to err_free | 
| 1237 | fn = filter_pred_none | 
| 1245 | Else q = 0 | 
| 1259 | If len >= Should handle KSYM_SYMBOL_LEN Then | 
| 1260 | parse_error(pe, FILT_ERR_OPERAND_TOO_LONG, pos + i) | 
| 1261 | Go to err_free | 
| 1275 | not = 1 | 
| 1279 | Break | 
| 1280 | Default | 
| 1281 | parse_error(pe, FILT_ERR_ILLEGAL_FIELD_OP, pos + i) | 
| 1282 | Go to err_free | 
| 1286 | If Not is_string_field(field) Then | 
| 1287 | parse_error(pe, FILT_ERR_EXPECT_DIGIT, pos + i) | 
| 1288 | Go to err_free | 
| 1296 | parse_error(pe, FILT_ERR_MISSING_QUOTE, pos + i) | 
| 1297 | Go to err_free | 
| 1301 | s++ | 
| 1303 | If len >= Should handle KSYM_SYMBOL_LEN Then | 
| 1304 | parse_error(pe, FILT_ERR_OPERAND_TOO_LONG, pos + i) | 
| 1305 | Go to err_free | 
| 1312 | filter_build_regex(pred) | 
| 1314 | If filter_type == FILTER_COMM Then | 
| 1315 | fn = Filter predicate for COMM. | 
| 1317 | Else if filter_type == FILTER_STATIC_STRING Then | 
| 1321 | Else if filter_type == FILTER_DYN_STRING Then fn = Filter predicate for dynamic sized arrays of characters | 
| 1323 | Else fn = Filter predicate for char * pointers | 
| 1326 | i++ | 
| 1331 | If is_string_field(field) Then | 
| 1332 | parse_error(pe, FILT_ERR_EXPECT_STRING, pos + i) | 
| 1333 | Go to err_free | 
| 1337 | parse_error(pe, FILT_ERR_ILLEGAL_FIELD_OP, pos + i) | 
| 1338 | Go to err_free | 
| 1346 | i++ | 
| 1351 | parse_error(pe, FILT_ERR_OPERAND_TOO_LONG, pos + i) | 
| 1352 | Go to err_free | 
| 1363 | If ret Then | 
| 1364 | parse_error(pe, FILT_ERR_ILLEGAL_INTVAL, pos + s) | 
| 1365 | Go to err_free | 
| 1370 | If filter_type == FILTER_CPU Then fn = Filter predicate for CPUs. | 
| 1372 | Else | 
| 1379 | Else | 
| 1380 | parse_error(pe, FILT_ERR_INVALID_VALUE, pos + i) | 
| 1381 | Go to err_free | 
| 1385 | Return i | 
| 1387 | err_free : | 
| 1389 | Return -EINVAL | 
| Source code conversion tool public plug-in interface | X | 
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |