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

Name:create_key_field

Proto:static int create_key_field(struct hist_trigger_data *hist_data, unsigned int key_idx, unsigned int key_offset, struct trace_event_file *file, char *field_str)

Type:int

Parameter:

TypeParameterName
struct hist_trigger_data *hist_data
unsigned intkey_idx
unsigned intkey_offset
struct trace_event_file *file
char *field_str
4584  tr = tr
4585  struct hist_field * hist_field = NULL
4586  flags = 0
4588  ret = 0
4590  If WARN_ON(key_idx >= HIST_FIELDS_MAX) Then Return -EINVAL
4593  flags |= HIST_FIELD_FL_KEY
4595  If strcmp(field_str, "stacktrace") == 0 Then
4596  flags |= HIST_FIELD_FL_STACKTRACE
4597  key_size = sizeof(unsignedlong) * HIST_STACKTRACE_DEPTH
4598  hist_field = create_hist_field(hist_data, NULL, flags, NULL)
4599  Else
4600  hist_field = parse_expr(hist_data, file, field_str, flags, NULL, 0)
4602  If IS_ERR(hist_field) Then
4603  ret = PTR_ERR(hist_field)
4604  Go to out
4607  If field_has_hist_vars(hist_field, 0) Then
4610  ret = -EINVAL
4611  Go to out
4614  key_size = size
4617  fields[key_idx] = hist_field
4619  key_size = @a is a power of 2 value (key_size, sizeof(u64))
4620  size = key_size
4621  offset = key_offset
4623  key_size += key_size
4625  If key_size > HIST_KEY_SIZE_MAX Then
4626  ret = -EINVAL
4627  Go to out
4630  n_keys++
4631  n_fields++
4633  If WARN_ON(n_keys > TRACING_MAP_KEYS_MAX) Then Return -EINVAL
4636  ret = key_size
4637  out :
4638  Return ret
Caller
NameDescribe
create_key_fields