函数逻辑报告 | 
Source Code:kernel\trace\trace_probe.c | 
Create Date:2022-07-27 13:54:19 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| 首页 | 函数Tree | 
| 注解内核,赢得工具 | 下载SCCT | English | 
函数名称:String length checking wrapper
函数原型:static int traceprobe_parse_probe_arg_body(char *arg, ssize_t *size, struct probe_arg *parg, unsigned int flags, int offset)
返回类型:int
参数:
| 类型 | 参数 | 名称 | 
|---|---|---|
| char * | arg | |
| ssize_t * | size | |
| struct probe_arg * | parg | |
| unsigned int | flags | |
| int | offset | 
| 546 | struct fetch_insn * code, * scode, * tmp = NULL | 
| 551 | 如果len大于MAX_ARGSTR_LEN则 | 
| 553 | 返回:负EINVAL | 
| 554 | 否则如果len恒等于0则 | 
| 556 | 返回:负EINVAL | 
| 559 | Command of this argument 等于kstrdup(arg, GFP_KERNEL) | 
| 560 | 如果非 Command of this argument 则返回:负ENOMEM | 
| 563 | t等于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 | 
| 564 | 如果t则 | 
| 565 | t等于'\0' | 
| 566 | t2等于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 | 
| 567 | 如果t2则 | 
| 568 | t2自加等于'\0' | 
| 569 | t3等于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 | 
| 570 | 如果非t3则 | 
| 574 | 返回:负EINVAL | 
| 575 | 否则如果t3[1]不等于'\0'则 | 
| 576 | trace_probe_log_err(offset + t3 + 1 - arg, BAD_ARRAY_SUFFIX) | 
| 578 | 返回:负EINVAL | 
| 580 | t3等于'\0' | 
| 582 | trace_probe_log_err(offset + t2 - arg, BAD_ARRAY_NUM) | 
| 584 | 返回:负EINVAL | 
| 586 | 如果 Array count 大于MAX_ARRAY_LEN则 | 
| 587 | trace_probe_log_err(offset + t2 - arg, ARRAY_TOO_BIG) | 
| 589 | 返回:负EINVAL | 
| 600 | 如果 Array count 或t且字符串比较则返回:负EINVAL | 
| 602 | Type of this argument 等于find_fetch_type("string") | 
| 603 | 否则 Type of this argument 等于find_fetch_type(t) | 
| 605 | 如果非 Type of this argument 则 | 
| 610 | size加等于Byte size of type 乘如果 Array count 否则1 | 
| 612 | 如果 Array count 则 | 
| 614 | Format string if needed 等于开辟内存 | 
| 615 | 如果非 Format string if needed 则返回:负ENOMEM | 
| 624 | op等于FETCH_OP_END | 
| 634 | 如果op不等于 Dereference: .offset 且op不等于 User-space Dereference: .offset 且op不等于 Immediate : .immediate 且op不等于 Current comm 且op不等于 Allocated data: .data 则 | 
| 642 | 如果op恒等于 Immediate : .immediate 或op恒等于 Current comm 或 Array count 则 | 
| 650 | code自加 | 
| 651 | 如果op不等于FETCH_OP_NOP则 | 
| 658 | 如果非字符串比较或op恒等于 User-space Dereference: .offset 则op等于 User String: .offset, .size | 
| 661 | 否则op等于 String: .offset, .size | 
| 663 | size等于Byte size of type | 
| 664 | Dynamic array (string) is used = true | 
| 665 | 否则如果op恒等于 Dereference: .offset 则 | 
| 666 | op等于 Mem: .offset, .size | 
| 667 | size等于Byte size of type | 
| 668 | 否则如果op恒等于 User-space Dereference: .offset 则 | 
| 669 | op等于 Mem: .offset, .size | 
| 670 | size等于Byte size of type | 
| 671 | 否则 | 
| 683 | 如果(t != NULL)则 | 
| 685 | 如果ret则 | 
| 686 | trace_probe_log_err(offset + t - arg, BAD_BITFIELD) | 
| 687 | 转到:fail | 
| 691 | 如果 Array count 则 | 
| 692 | 如果op不等于 Mem: .offset, .size 且op不等于 String: .offset, .size 且op不等于 User String: .offset, .size 则 | 
| 700 | code自加 | 
| 701 | 如果op不等于FETCH_OP_NOP则 | 
| 706 | op等于 Array: .param = loop count | 
| 707 | param等于 Array count | 
| 709 | code自加 | 
| 710 | op等于FETCH_OP_END | 
| 719 | fail : | 
| 720 | 如果ret则 | 
| 728 | 返回:ret | 
| 名称 | 描述 | 
|---|---|
| traceprobe_parse_probe_arg | 
| 源代码转换工具 开放的插件接口  | X | 
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码  |