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

Name:create_hist_field

Proto:static struct hist_field *create_hist_field(struct hist_trigger_data *hist_data, struct ftrace_event_field *field, unsigned long flags, char *var_name)

Type:struct hist_field

Parameter:

TypeParameterName
struct hist_trigger_data *hist_data
struct ftrace_event_field *field
unsigned longflags
char *var_name
2473  If field && is_function_field(field) Then Return NULL
2476  hist_field = 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).
2477  If Not hist_field Then Return NULL
2480  ref = 1
2482  hist_data = hist_data
2484  If flags & HIST_FIELD_FL_EXPR || flags & HIST_FIELD_FL_ALIAS Then Go to out
2487  If flags & HIST_FIELD_FL_VAR_REF Then
2488  fn = hist_field_var_ref
2489  Go to out
2492  If flags & HIST_FIELD_FL_HITCOUNT Then
2493  fn = hist_field_counter
2494  size = sizeof(u64)
2495  type = kstrdup("u64", GFP_KERNEL)
2496  If Not type Then Go to free
2498  Go to out
2501  If flags & HIST_FIELD_FL_STACKTRACE Then
2502  fn = hist_field_none
2503  Go to out
2506  If flags & HIST_FIELD_FL_LOG2 Then
2507  fl = flags & ~HIST_FIELD_FL_LOG2
2508  fn = hist_field_log2
2509  operands[0] = create_hist_field(hist_data, field, fl, NULL)
2510  size = size
2511  type = kstrdup(type, GFP_KERNEL)
2512  If Not type Then Go to free
2514  Go to out
2517  If flags & HIST_FIELD_FL_TIMESTAMP Then
2518  fn = hist_field_timestamp
2519  size = sizeof(u64)
2520  type = kstrdup("u64", GFP_KERNEL)
2521  If Not type Then Go to free
2523  Go to out
2526  If flags & HIST_FIELD_FL_CPU Then
2527  fn = hist_field_cpu
2528  size = sizeof(int)
2529  type = kstrdup("unsigned int", GFP_KERNEL)
2530  If Not type Then Go to free
2532  Go to out
2535  If WARN_ON_ONCE(!field) Then Go to out
2538  If is_string_field(field) Then
2539  flags |= HIST_FIELD_FL_STRING
2541  size = Should handle KSYM_SYMBOL_LEN
2542  type = kstrdup(type, GFP_KERNEL)
2543  If Not type Then Go to free
2546  If filter_type == FILTER_STATIC_STRING Then fn = hist_field_string
2548  Else if filter_type == FILTER_DYN_STRING Then fn = hist_field_dynstring
2550  Else fn = hist_field_pstring
2552  Else
2553  size = size
2554  is_signed = is_signed
2555  type = kstrdup(type, GFP_KERNEL)
2556  If Not type Then Go to free
2559  fn = select_value_fn(size, is_signed)
2561  If Not fn Then
2563  Return NULL
2566  out :
2567  field = field
2568  flags = flags
2570  If var_name Then
2571  name = kstrdup(var_name, GFP_KERNEL)
2572  If Not name Then Go to free
2576  Return hist_field
2577  free :
2578  destroy_hist_field(hist_field, 0)
2579  Return NULL
Caller
NameDescribe
create_hist_field
create_var_refreate_var_ref - Create a variable reference and attach it to trigger*@hist_data: The trigger that will be referencing the variable*@var_field: The VAR field to create a reference to*@system: The optional system string*@event_name: The optional event_name
create_alias
parse_atom
parse_unary
parse_expr
create_hitcount_val
create_key_field