Function report |
Source Code:kernel\trace\trace_probe.c |
Create Date:2022-07-28 12:42:49 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:Recursive argument parser
Proto:static int parse_probe_arg(char *arg, const struct fetch_type *type, struct fetch_insn **pcode, struct fetch_insn *end, unsigned int flags, int offs)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
char * | arg | |
const struct fetch_type * | type | |
struct fetch_insn ** | pcode | |
struct fetch_insn * | end | |
unsigned int | flags | |
int | offs |
360 | deref = Dereference: .offset |
361 | offset = 0 |
363 | ret = 0 |
366 | Case arg[0] == '$' |
370 | Case arg[0] == '%' |
372 | If ret >= 0 Then |
376 | Else trace_probe_log_err(offs, BAD_REG_NAME) |
378 | Break |
380 | Case arg[0] == '@' |
383 | If ret Then |
385 | Break |
388 | op = Immediate : .immediate |
390 | Else if arg[1] == '+' Then |
392 | If flags & TPARG_FL_KERNEL Then |
394 | Return -EINVAL |
397 | If ret Then |
399 | Break |
402 | op = File offset: .immediate |
404 | Else |
406 | If Not (flags & TPARG_FL_KERNEL) Then |
408 | Return -EINVAL |
411 | op = Unresolved Symbol holder |
412 | data = kstrdup(arg + 1, GFP_KERNEL) |
417 | Return -EINVAL |
419 | op = Immediate : .immediate |
420 | immediate = 0 |
425 | Return -EINVAL |
428 | op = Dereference: .offset |
430 | Break |
432 | Case arg[0] == '+' |
433 | Case arg[0] == '-' |
434 | If arg[1] == 'u' Then |
441 | tmp = 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 |
442 | If Not tmp Then |
444 | Return -EINVAL |
446 | tmp = '\0' |
448 | If ret Then |
450 | Break |
454 | tmp = strrchr - Find the last occurrence of a character in a string*@s: The string to be searched*@c: The character to search for |
455 | If Not tmp Then |
456 | trace_probe_log_err(offs + strlen - Find the length of a string*@s: The string to be sized, DEREF_OPEN_BRACE) |
458 | Return -EINVAL |
459 | Else |
460 | t2 = find_fetch_type(NULL) |
462 | tmp = '\0' |
463 | ret = Recursive argument parser |
464 | If ret Then Break |
466 | If op == Current comm || op == Allocated data: .data Then |
469 | Return -EINVAL |
473 | Return -EINVAL |
480 | Break |
481 | Case arg[0] == '\\' |
482 | If arg[1] == '"' Then |
483 | ret = __parse_imm_string(arg + 2, & tmp, offs + 2) |
484 | If ret Then Break |
486 | op = Allocated data: .data |
488 | Else |
489 | ret = str_to_immediate(arg + 1, & immediate) |
490 | If ret Then trace_probe_log_err(offs + 1, BAD_IMM) |
492 | Else op = Immediate : .immediate |
495 | Break |
497 | If Not ret && op == FETCH_OP_NOP Then |
502 | Return ret |
Name | Describe |
---|---|
parse_probe_arg | Recursive argument parser |
traceprobe_parse_probe_arg_body | String length checking wrapper |
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 |