Lines Matching refs:hist_field
85 struct hist_field;
87 typedef u64 (*hist_field_fn_t) (struct hist_field *field,
157 struct hist_field { struct
162 struct hist_field *operands[HIST_FIELD_OPERANDS_MAX]; argument
203 static u64 hist_fn_call(struct hist_field *hist_field, argument
209 static u64 hist_field_const(struct hist_field *field, in hist_field_const()
218 static u64 hist_field_counter(struct hist_field *field, in hist_field_counter()
227 static u64 hist_field_string(struct hist_field *hist_field, in hist_field_string() argument
233 char *addr = (char *)(event + hist_field->field->offset); in hist_field_string()
238 static u64 hist_field_dynstring(struct hist_field *hist_field, in hist_field_dynstring() argument
244 u32 str_item = *(u32 *)(event + hist_field->field->offset); in hist_field_dynstring()
251 static u64 hist_field_reldynstring(struct hist_field *hist_field, in hist_field_reldynstring() argument
257 u32 *item = event + hist_field->field->offset; in hist_field_reldynstring()
265 static u64 hist_field_pstring(struct hist_field *hist_field, in hist_field_pstring() argument
271 char **addr = (char **)(event + hist_field->field->offset); in hist_field_pstring()
276 static u64 hist_field_log2(struct hist_field *hist_field, in hist_field_log2() argument
282 struct hist_field *operand = hist_field->operands[0]; in hist_field_log2()
289 static u64 hist_field_bucket(struct hist_field *hist_field, in hist_field_bucket() argument
295 struct hist_field *operand = hist_field->operands[0]; in hist_field_bucket()
296 unsigned long buckets = hist_field->buckets; in hist_field_bucket()
310 static u64 hist_field_plus(struct hist_field *hist_field, in hist_field_plus() argument
316 struct hist_field *operand1 = hist_field->operands[0]; in hist_field_plus()
317 struct hist_field *operand2 = hist_field->operands[1]; in hist_field_plus()
325 static u64 hist_field_minus(struct hist_field *hist_field, in hist_field_minus() argument
331 struct hist_field *operand1 = hist_field->operands[0]; in hist_field_minus()
332 struct hist_field *operand2 = hist_field->operands[1]; in hist_field_minus()
340 static u64 hist_field_div(struct hist_field *hist_field, in hist_field_div() argument
346 struct hist_field *operand1 = hist_field->operands[0]; in hist_field_div()
347 struct hist_field *operand2 = hist_field->operands[1]; in hist_field_div()
363 static u64 div_by_power_of_two(struct hist_field *hist_field, in div_by_power_of_two() argument
369 struct hist_field *operand1 = hist_field->operands[0]; in div_by_power_of_two()
370 struct hist_field *operand2 = hist_field->operands[1]; in div_by_power_of_two()
377 static u64 div_by_not_power_of_two(struct hist_field *hist_field, in div_by_not_power_of_two() argument
383 struct hist_field *operand1 = hist_field->operands[0]; in div_by_not_power_of_two()
384 struct hist_field *operand2 = hist_field->operands[1]; in div_by_not_power_of_two()
391 static u64 div_by_mult_and_shift(struct hist_field *hist_field, in div_by_mult_and_shift() argument
397 struct hist_field *operand1 = hist_field->operands[0]; in div_by_mult_and_shift()
398 struct hist_field *operand2 = hist_field->operands[1]; in div_by_mult_and_shift()
425 static u64 hist_field_mult(struct hist_field *hist_field, in hist_field_mult() argument
431 struct hist_field *operand1 = hist_field->operands[0]; in hist_field_mult()
432 struct hist_field *operand2 = hist_field->operands[1]; in hist_field_mult()
440 static u64 hist_field_unary_minus(struct hist_field *hist_field, in hist_field_unary_minus() argument
446 struct hist_field *operand = hist_field->operands[0]; in hist_field_unary_minus()
455 static u64 hist_field_##type(struct hist_field *hist_field, \
461 type *addr = (type *)(event + hist_field->field->offset); \
540 struct hist_field *var;
541 struct hist_field *val;
550 struct hist_field *fields[HIST_FIELDS_MAX];
564 struct hist_field *var_refs[TRACING_MAP_VARS_MAX];
647 struct hist_field *var_ref;
654 struct hist_field *track_var;
690 static enum hist_field_fn hist_field_get_div_fn(struct hist_field *divisor) in hist_field_get_div_fn()
867 static u64 hist_field_timestamp(struct hist_field *hist_field, in hist_field_timestamp() argument
873 struct hist_trigger_data *hist_data = hist_field->hist_data; in hist_field_timestamp()
884 static u64 hist_field_cpu(struct hist_field *hist_field, in hist_field_cpu() argument
906 static struct hist_field *
907 check_field_for_var_ref(struct hist_field *hist_field, in check_field_for_var_ref() argument
911 WARN_ON(!(hist_field && hist_field->flags & HIST_FIELD_FL_VAR_REF)); in check_field_for_var_ref()
913 if (hist_field && hist_field->var.idx == var_idx && in check_field_for_var_ref()
914 hist_field->var.hist_data == var_data) in check_field_for_var_ref()
915 return hist_field; in check_field_for_var_ref()
932 static struct hist_field *find_var_ref(struct hist_trigger_data *hist_data, in find_var_ref()
936 struct hist_field *hist_field; in find_var_ref() local
940 hist_field = hist_data->var_refs[i]; in find_var_ref()
941 if (check_field_for_var_ref(hist_field, var_data, var_idx)) in find_var_ref()
942 return hist_field; in find_var_ref()
962 static struct hist_field *find_any_var_ref(struct hist_trigger_data *hist_data, in find_any_var_ref()
966 struct hist_field *found = NULL; in find_any_var_ref()
995 struct hist_field *field; in check_var_refs()
1027 static bool field_has_hist_vars(struct hist_field *hist_field, in field_has_hist_vars() argument
1035 if (!hist_field) in field_has_hist_vars()
1038 if (hist_field->flags & HIST_FIELD_FL_VAR || in field_has_hist_vars()
1039 hist_field->flags & HIST_FIELD_FL_VAR_REF) in field_has_hist_vars()
1043 struct hist_field *operand; in field_has_hist_vars()
1045 operand = hist_field->operands[i]; in field_has_hist_vars()
1055 struct hist_field *hist_field; in has_hist_vars() local
1059 hist_field = hist_data->fields[i]; in has_hist_vars()
1060 if (field_has_hist_vars(hist_field, 0)) in has_hist_vars()
1110 static struct hist_field *find_var_field(struct hist_trigger_data *hist_data, in find_var_field()
1113 struct hist_field *hist_field, *found = NULL; in find_var_field() local
1117 hist_field = hist_data->fields[i]; in find_var_field()
1118 if (hist_field && hist_field->flags & HIST_FIELD_FL_VAR && in find_var_field()
1119 strcmp(hist_field->var.name, var_name) == 0) { in find_var_field()
1120 found = hist_field; in find_var_field()
1128 static struct hist_field *find_var(struct hist_trigger_data *hist_data, in find_var()
1134 struct hist_field *hist_field; in find_var() local
1138 hist_field = find_var_field(hist_data, var_name); in find_var()
1139 if (hist_field) in find_var()
1140 return hist_field; in find_var()
1145 hist_field = find_var_field(test_data, var_name); in find_var()
1146 if (hist_field) in find_var()
1147 return hist_field; in find_var()
1185 static struct hist_field *find_file_var(struct trace_event_file *file, in find_file_var()
1190 struct hist_field *hist_field; in find_file_var() local
1197 hist_field = find_var_field(test_data, var_name); in find_file_var()
1198 if (hist_field) in find_file_var()
1199 return hist_field; in find_file_var()
1206 static struct hist_field *
1210 struct hist_field *hist_field, *found = NULL; in find_match_var() local
1224 hist_field = find_file_var(file, var_name); in find_match_var()
1225 if (hist_field) { in find_match_var()
1232 found = hist_field; in find_match_var()
1239 static struct hist_field *find_event_var(struct hist_trigger_data *hist_data, in find_event_var()
1245 struct hist_field *hist_field = NULL; in find_event_var() local
1249 hist_field = find_match_var(hist_data, var_name); in find_event_var()
1250 if (IS_ERR(hist_field)) in find_event_var()
1252 if (hist_field) in find_event_var()
1253 return hist_field; in find_event_var()
1260 hist_field = find_file_var(file, var_name); in find_event_var()
1262 return hist_field; in find_event_var()
1265 static u64 hist_field_var_ref(struct hist_field *hist_field, in hist_field_var_ref() argument
1278 var_val = elt_data->var_ref_vals[hist_field->var_ref_idx]; in hist_field_var_ref()
1288 struct hist_field *hist_field; in resolve_var_refs() local
1294 hist_field = hist_data->var_refs[i]; in resolve_var_refs()
1295 var_idx = hist_field->var.idx; in resolve_var_refs()
1296 var_data = hist_field->var.hist_data; in resolve_var_refs()
1318 if (self || !hist_field->read_once) in resolve_var_refs()
1329 static const char *hist_field_name(struct hist_field *field, in hist_field_name()
1637 struct hist_field *hist_field; in hist_trigger_elt_data_alloc() local
1645 hist_field = hist_data->fields[i]; in hist_trigger_elt_data_alloc()
1647 if (hist_field->flags & HIST_FIELD_FL_EXECNAME) { in hist_trigger_elt_data_alloc()
1702 static const char *get_hist_field_flags(struct hist_field *hist_field) in get_hist_field_flags() argument
1706 if (hist_field->flags & HIST_FIELD_FL_HEX) in get_hist_field_flags()
1708 else if (hist_field->flags & HIST_FIELD_FL_SYM) in get_hist_field_flags()
1710 else if (hist_field->flags & HIST_FIELD_FL_SYM_OFFSET) in get_hist_field_flags()
1712 else if (hist_field->flags & HIST_FIELD_FL_EXECNAME) in get_hist_field_flags()
1714 else if (hist_field->flags & HIST_FIELD_FL_SYSCALL) in get_hist_field_flags()
1716 else if (hist_field->flags & HIST_FIELD_FL_LOG2) in get_hist_field_flags()
1718 else if (hist_field->flags & HIST_FIELD_FL_BUCKET) in get_hist_field_flags()
1720 else if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP_USECS) in get_hist_field_flags()
1722 else if (hist_field->flags & HIST_FIELD_FL_PERCENT) in get_hist_field_flags()
1724 else if (hist_field->flags & HIST_FIELD_FL_GRAPH) in get_hist_field_flags()
1726 else if (hist_field->flags & HIST_FIELD_FL_STACKTRACE) in get_hist_field_flags()
1732 static void expr_field_str(struct hist_field *field, char *expr) in expr_field_str()
1755 static char *expr_str(struct hist_field *field, unsigned int level) in expr_str()
1904 static void get_hist_field(struct hist_field *hist_field) in get_hist_field() argument
1906 hist_field->ref++; in get_hist_field()
1909 static void __destroy_hist_field(struct hist_field *hist_field) in __destroy_hist_field() argument
1911 if (--hist_field->ref > 1) in __destroy_hist_field()
1914 kfree(hist_field->var.name); in __destroy_hist_field()
1915 kfree(hist_field->name); in __destroy_hist_field()
1918 kfree_const(hist_field->type); in __destroy_hist_field()
1920 kfree(hist_field->system); in __destroy_hist_field()
1921 kfree(hist_field->event_name); in __destroy_hist_field()
1923 kfree(hist_field); in __destroy_hist_field()
1926 static void destroy_hist_field(struct hist_field *hist_field, in destroy_hist_field() argument
1934 if (!hist_field) in destroy_hist_field()
1937 if (hist_field->flags & HIST_FIELD_FL_VAR_REF) in destroy_hist_field()
1941 destroy_hist_field(hist_field->operands[i], level + 1); in destroy_hist_field()
1943 __destroy_hist_field(hist_field); in destroy_hist_field()
1946 static struct hist_field *create_hist_field(struct hist_trigger_data *hist_data, in create_hist_field()
1951 struct hist_field *hist_field; in create_hist_field() local
1956 hist_field = kzalloc(sizeof(struct hist_field), GFP_KERNEL); in create_hist_field()
1957 if (!hist_field) in create_hist_field()
1960 hist_field->ref = 1; in create_hist_field()
1962 hist_field->hist_data = hist_data; in create_hist_field()
1968 hist_field->fn_num = HIST_FIELD_FN_VAR_REF; in create_hist_field()
1973 hist_field->fn_num = HIST_FIELD_FN_COUNTER; in create_hist_field()
1974 hist_field->size = sizeof(u64); in create_hist_field()
1975 hist_field->type = "u64"; in create_hist_field()
1980 hist_field->fn_num = HIST_FIELD_FN_CONST; in create_hist_field()
1981 hist_field->size = sizeof(u64); in create_hist_field()
1982 hist_field->type = kstrdup("u64", GFP_KERNEL); in create_hist_field()
1983 if (!hist_field->type) in create_hist_field()
1990 hist_field->fn_num = HIST_FIELD_FN_STACK; in create_hist_field()
1992 hist_field->fn_num = HIST_FIELD_FN_NOP; in create_hist_field()
1993 hist_field->size = HIST_STACKTRACE_SIZE; in create_hist_field()
1994 hist_field->type = kstrdup_const("unsigned long[]", GFP_KERNEL); in create_hist_field()
1995 if (!hist_field->type) in create_hist_field()
2002 hist_field->fn_num = flags & HIST_FIELD_FL_LOG2 ? HIST_FIELD_FN_LOG2 : in create_hist_field()
2004 hist_field->operands[0] = create_hist_field(hist_data, field, fl, NULL); in create_hist_field()
2005 if (!hist_field->operands[0]) in create_hist_field()
2007 hist_field->size = hist_field->operands[0]->size; in create_hist_field()
2008 hist_field->type = kstrdup_const(hist_field->operands[0]->type, GFP_KERNEL); in create_hist_field()
2009 if (!hist_field->type) in create_hist_field()
2015 hist_field->fn_num = HIST_FIELD_FN_TIMESTAMP; in create_hist_field()
2016 hist_field->size = sizeof(u64); in create_hist_field()
2017 hist_field->type = "u64"; in create_hist_field()
2022 hist_field->fn_num = HIST_FIELD_FN_CPU; in create_hist_field()
2023 hist_field->size = sizeof(int); in create_hist_field()
2024 hist_field->type = "unsigned int"; in create_hist_field()
2036 hist_field->size = MAX_FILTER_STR_VAL; in create_hist_field()
2037 hist_field->type = kstrdup_const(field->type, GFP_KERNEL); in create_hist_field()
2038 if (!hist_field->type) in create_hist_field()
2042 hist_field->fn_num = HIST_FIELD_FN_STRING; in create_hist_field()
2043 hist_field->size = field->size; in create_hist_field()
2045 hist_field->fn_num = HIST_FIELD_FN_DYNSTRING; in create_hist_field()
2047 hist_field->fn_num = HIST_FIELD_FN_RELDYNSTRING; in create_hist_field()
2049 hist_field->fn_num = HIST_FIELD_FN_PSTRING; in create_hist_field()
2051 hist_field->size = field->size; in create_hist_field()
2052 hist_field->is_signed = field->is_signed; in create_hist_field()
2053 hist_field->type = kstrdup_const(field->type, GFP_KERNEL); in create_hist_field()
2054 if (!hist_field->type) in create_hist_field()
2057 hist_field->fn_num = select_value_fn(field->size, in create_hist_field()
2059 if (hist_field->fn_num == HIST_FIELD_FN_NOP) { in create_hist_field()
2060 destroy_hist_field(hist_field, 0); in create_hist_field()
2065 hist_field->field = field; in create_hist_field()
2066 hist_field->flags = flags; in create_hist_field()
2069 hist_field->var.name = kstrdup(var_name, GFP_KERNEL); in create_hist_field()
2070 if (!hist_field->var.name) in create_hist_field()
2074 return hist_field; in create_hist_field()
2076 destroy_hist_field(hist_field, 0); in create_hist_field()
2098 static int init_var_ref(struct hist_field *ref_field, in init_var_ref()
2099 struct hist_field *var_field, in init_var_ref()
2158 struct hist_field *var_field) in find_var_ref_idx()
2160 struct hist_field *ref_field; in find_var_ref_idx()
2188 static struct hist_field *create_var_ref(struct hist_trigger_data *hist_data, in create_var_ref()
2189 struct hist_field *var_field, in create_var_ref()
2193 struct hist_field *ref_field; in create_var_ref()
2277 static struct hist_field *parse_var_ref(struct hist_trigger_data *hist_data, in parse_var_ref()
2281 struct hist_field *var_field = NULL, *ref_field = NULL; in parse_var_ref()
2404 static struct hist_field *create_alias(struct hist_trigger_data *hist_data, in create_alias()
2405 struct hist_field *var_ref, in create_alias()
2408 struct hist_field *alias = NULL; in create_alias()
2428 static struct hist_field *parse_const(struct hist_trigger_data *hist_data, in parse_const()
2433 struct hist_field *field = NULL; in parse_const()
2451 static struct hist_field *parse_atom(struct hist_trigger_data *hist_data, in parse_atom()
2457 struct hist_field *hist_field = NULL; in parse_atom() local
2462 hist_field = parse_const(hist_data, str, var_name, flags); in parse_atom()
2463 if (!hist_field) { in parse_atom()
2467 return hist_field; in parse_atom()
2490 hist_field = parse_var_ref(hist_data, ref_system, in parse_atom()
2492 if (hist_field) { in parse_atom()
2494 hist_field = create_alias(hist_data, hist_field, var_name); in parse_atom()
2495 if (!hist_field) { in parse_atom()
2500 return hist_field; in parse_atom()
2511 hist_field = create_hist_field(hist_data, field, *flags, var_name); in parse_atom()
2512 if (!hist_field) { in parse_atom()
2516 hist_field->buckets = buckets; in parse_atom()
2518 return hist_field; in parse_atom()
2523 static struct hist_field *parse_expr(struct hist_trigger_data *hist_data,
2528 static struct hist_field *parse_unary(struct hist_trigger_data *hist_data, in parse_unary()
2533 struct hist_field *operand1, *expr = NULL; in parse_unary()
2621 struct hist_field *operand1, in check_expr_operands()
2622 struct hist_field *operand2, in check_expr_operands()
2623 struct hist_field **var1, in check_expr_operands()
2624 struct hist_field **var2) in check_expr_operands()
2631 struct hist_field *var; in check_expr_operands()
2642 struct hist_field *var; in check_expr_operands()
2660 static struct hist_field *parse_expr(struct hist_trigger_data *hist_data, in parse_expr()
2665 struct hist_field *operand1 = NULL, *operand2 = NULL, *expr = NULL; in parse_expr()
2666 struct hist_field *var1 = NULL, *var2 = NULL; in parse_expr()
2871 struct hist_field *target_hist_field, *hist_field; in compatible_keys() local
2881 hist_field = hist_data->fields[i + n]; in compatible_keys()
2884 if (strcmp(hist_field->type, target_hist_field->type) != 0) in compatible_keys()
2886 if (hist_field->size != target_hist_field->size) in compatible_keys()
2888 if (hist_field->is_signed != target_hist_field->is_signed) in compatible_keys()
2931 static struct hist_field *
2935 struct hist_field *event_var; in find_synthetic_field_var()
2977 static struct hist_field *
2986 struct hist_field *key_field; in create_field_var_hist()
2987 struct hist_field *event_var; in create_field_var_hist()
3097 static struct hist_field *
3102 struct hist_field *hist_field = NULL; in find_target_event_var() local
3119 hist_field = find_var_field(hist_data, var_name); in find_target_event_var()
3121 return hist_field; in find_target_event_var()
3141 struct hist_field *var = field_var->var; in __update_field_vars()
3142 struct hist_field *val = field_var->val; in __update_field_vars()
3193 static struct hist_field *create_var(struct hist_trigger_data *hist_data, in create_var()
3197 struct hist_field *var; in create_var()
3205 var = kzalloc(sizeof(struct hist_field), GFP_KERNEL); in create_var()
3239 struct hist_field *val = NULL, *var = NULL; in create_field_var()
3519 struct hist_field *save_val = hist_data->save_vars[i]->val; in track_data_print()
3520 struct hist_field *save_var = hist_data->save_vars[i]->var; in track_data_print()
3597 struct hist_field *var_field, *ref_field, *track_var = NULL; in track_data_create()
3872 struct hist_field *hist_field, in check_synth_field() argument
3887 if (strstr(hist_field->type, "char[") && field->is_string in check_synth_field()
3891 if (strstr(hist_field->type, "long[") && field->is_stack) in check_synth_field()
3894 if (strcmp(field->type, hist_field->type) != 0) { in check_synth_field()
3895 if (field->size != hist_field->size || in check_synth_field()
3896 (!field->is_string && field->is_signed != hist_field->is_signed)) in check_synth_field()
3903 static struct hist_field *
3909 struct hist_field *hist_field; in trace_action_find_var() local
3913 hist_field = find_target_event_var(hist_data, system, event, var); in trace_action_find_var()
3914 if (!hist_field) { in trace_action_find_var()
3920 hist_field = find_event_var(hist_data, system, event, var); in trace_action_find_var()
3923 if (!hist_field) in trace_action_find_var()
3926 return hist_field; in trace_action_find_var()
3929 static struct hist_field *
3934 struct hist_field *hist_field = NULL; in trace_action_create_field_var() local
3947 hist_field = field_var->var; in trace_action_create_field_var()
3969 hist_field = create_field_var_hist(hist_data, system, event, var); in trace_action_create_field_var()
3970 if (IS_ERR(hist_field)) in trace_action_create_field_var()
3974 return hist_field; in trace_action_create_field_var()
3977 hist_field = NULL; in trace_action_create_field_var()
3986 struct hist_field *hist_field, *var_ref; in trace_action_create() local
4035 hist_field = trace_action_find_var(hist_data, data, in trace_action_create()
4039 hist_field = trace_action_create_field_var(hist_data, in trace_action_create()
4045 if (!hist_field) { in trace_action_create()
4051 if (check_synth_field(event, hist_field, field_pos) == 0) { in trace_action_create()
4052 var_ref = create_var_ref(hist_data, hist_field, in trace_action_create()
4236 struct hist_field *hist_field; in __create_val_field() local
4239 hist_field = parse_expr(hist_data, file, field_str, flags, var_name, &n_subexprs); in __create_val_field()
4240 if (IS_ERR(hist_field)) { in __create_val_field()
4241 ret = PTR_ERR(hist_field); in __create_val_field()
4246 if (hist_field->flags & HIST_FIELD_FL_VAR) { in __create_val_field()
4248 if (hist_field->flags & (HIST_FIELD_FL_GRAPH | HIST_FIELD_FL_PERCENT | in __create_val_field()
4253 if (hist_field->flags & (HIST_FIELD_FL_GRAPH | HIST_FIELD_FL_PERCENT | in __create_val_field()
4260 hist_data->fields[val_idx] = hist_field; in __create_val_field()
4287 static u64 hist_field_execname(struct hist_field *hist_field, in hist_field_execname() argument
4306 static u64 hist_field_stack(struct hist_field *hist_field, in hist_field_stack() argument
4312 u32 str_item = *(u32 *)(event + hist_field->field->offset); in hist_field_stack()
4319 static u64 hist_fn_call(struct hist_field *hist_field, in hist_fn_call() argument
4325 switch (hist_field->fn_num) { in hist_fn_call()
4327 return hist_field_var_ref(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4329 return hist_field_counter(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4331 return hist_field_const(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4333 return hist_field_log2(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4335 return hist_field_bucket(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4337 return hist_field_timestamp(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4339 return hist_field_cpu(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4341 return hist_field_string(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4343 return hist_field_dynstring(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4345 return hist_field_reldynstring(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4347 return hist_field_pstring(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4349 return hist_field_s64(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4351 return hist_field_u64(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4353 return hist_field_s32(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4355 return hist_field_u32(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4357 return hist_field_s16(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4359 return hist_field_u16(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4361 return hist_field_s8(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4363 return hist_field_u8(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4365 return hist_field_unary_minus(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4367 return hist_field_minus(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4369 return hist_field_plus(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4371 return hist_field_div(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4373 return hist_field_mult(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4375 return div_by_power_of_two(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4377 return div_by_not_power_of_two(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4379 return div_by_mult_and_shift(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4381 return hist_field_execname(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4383 return hist_field_stack(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4390 static void update_var_execname(struct hist_field *hist_field) in update_var_execname() argument
4392 hist_field->flags = HIST_FIELD_FL_STRING | HIST_FIELD_FL_VAR | in update_var_execname()
4394 hist_field->size = MAX_FILTER_STR_VAL; in update_var_execname()
4395 hist_field->is_signed = 0; in update_var_execname()
4397 kfree_const(hist_field->type); in update_var_execname()
4398 hist_field->type = "char[]"; in update_var_execname()
4400 hist_field->fn_num = HIST_FIELD_FN_EXECNAME; in update_var_execname()
4487 struct hist_field *hist_field = NULL; in create_key_field() local
4500 hist_field = create_hist_field(hist_data, NULL, flags, NULL); in create_key_field()
4502 hist_field = parse_expr(hist_data, file, field_str, flags, in create_key_field()
4504 if (IS_ERR(hist_field)) { in create_key_field()
4505 ret = PTR_ERR(hist_field); in create_key_field()
4509 if (field_has_hist_vars(hist_field, 0)) { in create_key_field()
4511 destroy_hist_field(hist_field, 0); in create_key_field()
4516 key_size = hist_field->size; in create_key_field()
4519 hist_data->fields[key_idx] = hist_field; in create_key_field()
4715 struct hist_field *hist_field; in create_sort_keys() local
4757 hist_field = hist_data->fields[j]; in create_sort_keys()
4758 if (hist_field->flags & HIST_FIELD_FL_VAR) in create_sort_keys()
4763 test_name = hist_field_name(hist_field, 0); in create_sort_keys()
5056 struct hist_field *hist_field; in create_tracing_map_fields() local
5060 hist_field = hist_data->fields[i]; in create_tracing_map_fields()
5061 if (hist_field->flags & HIST_FIELD_FL_KEY) { in create_tracing_map_fields()
5064 field = hist_field->field; in create_tracing_map_fields()
5066 if (hist_field->flags & HIST_FIELD_FL_STACKTRACE) in create_tracing_map_fields()
5068 else if (!field || hist_field->flags & HIST_FIELD_FL_CPU) in create_tracing_map_fields()
5069 cmp_fn = tracing_map_cmp_num(hist_field->size, in create_tracing_map_fields()
5070 hist_field->is_signed); in create_tracing_map_fields()
5077 hist_field->offset, in create_tracing_map_fields()
5079 } else if (!(hist_field->flags & HIST_FIELD_FL_VAR)) in create_tracing_map_fields()
5085 if (hist_field->flags & HIST_FIELD_FL_VAR) { in create_tracing_map_fields()
5089 hist_field->var.idx = idx; in create_tracing_map_fields()
5090 hist_field->var.hist_data = hist_data; in create_tracing_map_fields()
5159 struct hist_field *hist_field; in hist_trigger_elt_update() local
5167 hist_field = hist_data->fields[i]; in hist_trigger_elt_update()
5168 hist_val = hist_fn_call(hist_field, elt, buffer, rbe, rec); in hist_trigger_elt_update()
5169 if (hist_field->flags & HIST_FIELD_FL_VAR) { in hist_trigger_elt_update()
5170 var_idx = hist_field->var.idx; in hist_trigger_elt_update()
5172 if (hist_field->flags & in hist_trigger_elt_update()
5180 var_str_idx = hist_field->var_str_idx; in hist_trigger_elt_update()
5186 if (hist_field->flags & HIST_FIELD_FL_STRING) { in hist_trigger_elt_update()
5187 size = min(hist_field->size, STR_VAR_LEN_MAX); in hist_trigger_elt_update()
5209 hist_field = hist_data->fields[i]; in hist_trigger_elt_update()
5210 if (hist_field->flags & HIST_FIELD_FL_VAR) { in hist_trigger_elt_update()
5211 hist_val = hist_fn_call(hist_field, elt, buffer, rbe, rec); in hist_trigger_elt_update()
5212 var_idx = hist_field->var.idx; in hist_trigger_elt_update()
5221 struct hist_field *key_field, void *rec) in add_to_key()
5270 struct hist_field *key_field; in event_hist_trigger()
5348 struct hist_field *key_field; in hist_trigger_print_key()
5671 struct hist_field *field, unsigned long flags) in hist_field_debug_show()
5721 struct hist_field *field; in field_var_debug_show()
5925 static void hist_field_print(struct seq_file *m, struct hist_field *hist_field) in hist_field_print() argument
5927 const char *field_name = hist_field_name(hist_field, 0); in hist_field_print()
5929 if (hist_field->var.name) in hist_field_print()
5930 seq_printf(m, "%s=", hist_field->var.name); in hist_field_print()
5932 if (hist_field->flags & HIST_FIELD_FL_CPU) in hist_field_print()
5934 else if (hist_field->flags & HIST_FIELD_FL_CONST) in hist_field_print()
5935 seq_printf(m, "%llu", hist_field->constant); in hist_field_print()
5937 if (hist_field->flags & HIST_FIELD_FL_VAR_REF || in hist_field_print()
5938 hist_field->flags & HIST_FIELD_FL_ALIAS) in hist_field_print()
5941 } else if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP) in hist_field_print()
5944 if (hist_field->flags) { in hist_field_print()
5945 if (!(hist_field->flags & HIST_FIELD_FL_VAR_REF) && in hist_field_print()
5946 !(hist_field->flags & HIST_FIELD_FL_EXPR) && in hist_field_print()
5947 !(hist_field->flags & HIST_FIELD_FL_STACKTRACE)) { in hist_field_print()
5948 const char *flags = get_hist_field_flags(hist_field); in hist_field_print()
5954 if (hist_field->buckets) in hist_field_print()
5955 seq_printf(m, "=%ld", hist_field->buckets); in hist_field_print()
5962 struct hist_field *field; in event_hist_trigger_print()
6212 struct hist_field *key_field, *key_field_test; in hist_trigger_match()