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:09
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:expr_str

Proto:static char *expr_str(struct hist_field *field, unsigned int level)

Type:char

Parameter:

TypeParameterName
struct hist_field *field
unsigned intlevel
2355  If level > 1 Then Return NULL
2358  expr = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
2359  If Not expr Then Return NULL
2362  If Not operands[0] Then
2363  expr_field_str(field, expr)
2364  Return expr
2367  If operator == FIELD_OP_UNARY_MINUS Then
2370  strcat(expr, "-(")
2371  subexpr = expr_str(operands[0], ++level)
2372  If Not subexpr Then
2373  kfree(expr)
2374  Return NULL
2376  strcat(expr, subexpr)
2377  strcat(expr, ")")
2379  kfree(subexpr)
2381  Return expr
2384  expr_field_str(operands[0], expr)
2387  Case operator == FIELD_OP_MINUS
2388  strcat(expr, "-")
2389  Break
2390  Case operator == FIELD_OP_PLUS
2391  strcat(expr, "+")
2392  Break
2393  Default
2394  kfree(expr)
2395  Return NULL
2398  expr_field_str(operands[1], expr)
2400  Return expr
Caller
NameDescribe
expr_str
parse_unary
parse_expr