函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Recursive argument parser

函数原型: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)

返回类型:int

参数:

类型参数名称
char *arg
const struct fetch_type *type
struct fetch_insn **pcode
struct fetch_insn *end
unsigned intflags
intoffs
358  code等于pcode
360  deref等于 Dereference: .offset
361  offset等于0
363  ret等于0
366  :arg[0]恒等于'$'
367  ret等于parse_probe_vars(arg + 1, type, code, flags, offs)
368  退出
370  :arg[0]恒等于'%'
371  ret等于gs_query_register_offset() - query register offset from its name*@name: the name of a register* regs_query_register_offset() returns the offset of a register in struct* pt_regs from its name. If the name is invalid, this returns -EINVAL;
372  如果ret大于等于0则
374  param等于ret
375  ret等于0
376  否则trace_probe_log_err(offs, BAD_REG_NAME)
378  退出
380  :arg[0]恒等于'@'
381  如果是数字
383  如果ret
389  immediate等于param
390  否则如果arg[1]恒等于'+'则
392  如果flags按位与TPARG_FL_KERNEL
394  返回:负EINVAL
397  如果ret
403  immediate等于offset
404  否则
406  如果非flags按位与TPARG_FL_KERNEL的值则
408  返回:负EINVAL
412  data等于kstrdup(arg + 1, GFP_KERNEL)
413  如果非data则返回:负ENOMEM
415  如果code先自加恒等于end
417  返回:负EINVAL
420  immediate等于0
423  如果code先自加恒等于end
425  返回:负EINVAL
427  pcode等于code
428  op等于 Dereference: .offset
429  offset等于offset
430  退出
432  :arg[0]恒等于'+'
433  :arg[0]恒等于'-'
434  如果arg[1]恒等于'u'则
436  arg[1]等于arg[0]
437  arg自加
439  如果arg[0]恒等于'+'则arg自加
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  如果非tmp
444  返回:负EINVAL
446  tmp等于'\0'
447  ret等于kstrtol - convert a string to a 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.
448  如果ret
450  退出
452  offs加等于tmp加1减arg加如果arg[0]不等于'-'则1否则0
453  arg等于tmp加1
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  如果非tmp
458  返回:负EINVAL
459  否则
460  t2等于find_fetch_type(NULL)
462  tmp等于'\0'
464  如果ret退出
466  如果op恒等于 Current comm op恒等于 Allocated data: .data
471  如果code先自加恒等于end
473  返回:负EINVAL
475  pcode等于code
477  op等于deref
478  offset等于offset
480  退出
481  :arg[0]恒等于'\\'
482  如果arg[1]恒等于'"'则
483  ret等于__parse_imm_string(arg + 2, & tmp, offs + 2)
484  如果ret退出
487  data等于tmp
488  否则
489  ret等于str_to_immediate(arg + 1, & immediate)
490  如果rettrace_probe_log_err(offs + 1, BAD_IMM)
492  否则op等于 Immediate : .immediate
495  退出
497  如果非retop恒等于FETCH_OP_NOP
499  trace_probe_log_err(offs, BAD_FETCH_ARG)
500  ret等于负EINVAL
502  返回:ret
调用者
名称描述
parse_probe_argRecursive argument parser
traceprobe_parse_probe_arg_bodyString length checking wrapper