函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:parse_unary

函数原型:static struct hist_field *parse_unary(struct hist_trigger_data *hist_data, struct trace_event_file *file, char *str, unsigned long flags, char *var_name, unsigned int level)

返回类型:struct hist_field

参数:

类型参数名称
struct hist_trigger_data *hist_data
struct trace_event_file *file
char *str
unsigned longflags
char *var_name
unsigned intlevel
2949  struct hist_field * operand1, * expr = NULL
2951  ret等于0
2956  如果level大于3则
2957  hist_err(tr, HIST_ERR_TOO_MANY_SUBEXPR, errpos(str))
2958  ret等于负EINVAL
2959  转到:free
2962  str自加
2964  s等于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
2965  如果sstr自加
2967  否则
2968  ret等于负EINVAL
2969  转到:free
2972  s等于strrchr - Find the last occurrence of a character in a string*@s: The string to be searched*@c: The character to search for
2973  如果ss等于'\0'
2975  否则
2976  ret等于负EINVAL
2977  转到:free
2980  flags或等于HIST_FIELD_FL_EXPR
2981  expr等于create_hist_field(hist_data, NULL, flags, var_name)
2982  如果非expr
2983  ret等于负ENOMEM
2984  转到:free
2987  operand_flags等于0
2988  operand1等于parse_expr(hist_data, file, str, operand_flags, NULL, ++level)
2989  如果是错误
2990  ret等于错误
2991  转到:free
2994  flags或等于flags按位与HIST_FIELD_FL_TIMESTAMP按位或HIST_FIELD_FL_TIMESTAMP_USECS的值
2996  fn等于hist_field_unary_minus
2997  operands[0]等于operand1
2998  operator等于FIELD_OP_UNARY_MINUS
2999  * The name field is used for EXPR and VAR_REF fields. VAR * fields contain the variable name in var.name.等于expr_str(expr, 0)
3000  type等于kstrdup(type, GFP_KERNEL)
3001  如果非type
3002  ret等于负ENOMEM
3003  转到:free
3006  返回:expr
3007  free :
3008  destroy_hist_field(expr, 0)
3009  返回:错误号
调用者
名称描述
parse_expr