Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\trace\trace_events_hist.c Create Date:2022-07-28 12:30:45
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:parse_unary

Proto: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)

Type:struct hist_field

Parameter:

TypeParameterName
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  If level > 3 Then
2957  hist_err(tr, HIST_ERR_TOO_MANY_SUBEXPR, errpos(str))
2958  ret = -EINVAL
2959  Go to 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  If s Then str++
2967  Else
2968  ret = -EINVAL
2969  Go to 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  If s Then s = '\0'
2975  Else
2976  ret = -EINVAL
2977  Go to free
2980  flags |= HIST_FIELD_FL_EXPR
2981  expr = create_hist_field(hist_data, NULL, flags, var_name)
2982  If Not expr Then
2983  ret = -ENOMEM
2984  Go to free
2987  operand_flags = 0
2988  operand1 = parse_expr(hist_data, file, str, operand_flags, NULL, ++level)
2989  If IS_ERR(operand1) Then
2990  ret = PTR_ERR(operand1)
2991  Go to 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  If Not type Then
3002  ret = -ENOMEM
3003  Go to free
3006  Return expr
3007  free :
3008  destroy_hist_field(expr, 0)
3009  Return ERR_PTR(ret)
Caller
NameDescribe
parse_expr