函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:parse_expr

函数原型:static struct hist_field *parse_expr(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
3053  struct hist_field * operand1 = NULL, * operand2 = NULL, * expr = NULL
3055  ret等于负EINVAL
3058  如果level大于3则
3059  hist_err(tr, HIST_ERR_TOO_MANY_SUBEXPR, errpos(str))
3060  返回:错误号
3063  field_op等于contains_operator(str)
3065  如果field_op恒等于FIELD_OP_NONE则返回:parse_atom(hist_data, file, str, & flags, var_name)
3068  如果field_op恒等于FIELD_OP_UNARY_MINUS则返回:parse_unary(hist_data, file, str, flags, var_name, ++level)
3072  :field_op恒等于FIELD_OP_MINUS
3073  sep等于"-"
3074  退出
3075  :field_op恒等于FIELD_OP_PLUS
3076  sep等于"+"
3077  退出
3078  默认
3079  转到:free
3082  operand1_str等于分割字符串
3083  如果非operand1_str或非str则转到:free
3086  operand_flags等于0
3087  operand1等于parse_atom(hist_data, file, operand1_str, & operand_flags, NULL)
3089  如果是错误
3090  ret等于错误
3091  operand1 = NULL
3092  转到:free
3096  operand_flags等于0
3097  operand2等于parse_expr(hist_data, file, str, operand_flags, NULL, ++level)
3098  如果是错误
3099  ret等于错误
3100  operand2 = NULL
3101  转到:free
3104  ret等于check_expr_operands(tr, operand1, operand2)
3105  如果ret则转到:free
3108  flags或等于HIST_FIELD_FL_EXPR
3110  flags或等于flags按位与HIST_FIELD_FL_TIMESTAMP按位或HIST_FIELD_FL_TIMESTAMP_USECS的值
3113  expr等于create_hist_field(hist_data, NULL, flags, var_name)
3114  如果非expr
3115  ret等于负ENOMEM
3116  转到:free
3119  read_once = true
3120  read_once = true
3122  operands[0]等于operand1
3123  operands[1]等于operand2
3124  operator等于field_op
3125  * The name field is used for EXPR and VAR_REF fields. VAR * fields contain the variable name in var.name.等于expr_str(expr, 0)
3126  type等于kstrdup(type, GFP_KERNEL)
3127  如果非type
3128  ret等于负ENOMEM
3129  转到:free
3133  :field_op恒等于FIELD_OP_MINUS
3134  fn等于hist_field_minus
3135  退出
3136  :field_op恒等于FIELD_OP_PLUS
3137  fn等于hist_field_plus
3138  退出
3139  默认
3140  ret等于负EINVAL
3141  转到:free
3144  返回:expr
3145  free :
3146  destroy_hist_field(operand1, 0)
3147  destroy_hist_field(operand2, 0)
3148  destroy_hist_field(expr, 0)
3150  返回:错误号
调用者
名称描述
parse_unary
parse_expr
__create_val_field
create_key_field