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()
860 static u64 hist_field_timestamp(struct hist_field *hist_field, in hist_field_timestamp() argument
866 struct hist_trigger_data *hist_data = hist_field->hist_data; in hist_field_timestamp()
877 static u64 hist_field_cpu(struct hist_field *hist_field, in hist_field_cpu() argument
899 static struct hist_field *
900 check_field_for_var_ref(struct hist_field *hist_field, in check_field_for_var_ref() argument
904 WARN_ON(!(hist_field && hist_field->flags & HIST_FIELD_FL_VAR_REF)); in check_field_for_var_ref()
906 if (hist_field && hist_field->var.idx == var_idx && in check_field_for_var_ref()
907 hist_field->var.hist_data == var_data) in check_field_for_var_ref()
908 return hist_field; in check_field_for_var_ref()
925 static struct hist_field *find_var_ref(struct hist_trigger_data *hist_data, in find_var_ref()
929 struct hist_field *hist_field; in find_var_ref() local
933 hist_field = hist_data->var_refs[i]; in find_var_ref()
934 if (check_field_for_var_ref(hist_field, var_data, var_idx)) in find_var_ref()
935 return hist_field; in find_var_ref()
955 static struct hist_field *find_any_var_ref(struct hist_trigger_data *hist_data, in find_any_var_ref()
959 struct hist_field *found = NULL; in find_any_var_ref()
988 struct hist_field *field; in check_var_refs()
1020 static bool field_has_hist_vars(struct hist_field *hist_field, in field_has_hist_vars() argument
1028 if (!hist_field) in field_has_hist_vars()
1031 if (hist_field->flags & HIST_FIELD_FL_VAR || in field_has_hist_vars()
1032 hist_field->flags & HIST_FIELD_FL_VAR_REF) in field_has_hist_vars()
1036 struct hist_field *operand; in field_has_hist_vars()
1038 operand = hist_field->operands[i]; in field_has_hist_vars()
1048 struct hist_field *hist_field; in has_hist_vars() local
1052 hist_field = hist_data->fields[i]; in has_hist_vars()
1053 if (field_has_hist_vars(hist_field, 0)) in has_hist_vars()
1103 static struct hist_field *find_var_field(struct hist_trigger_data *hist_data, in find_var_field()
1106 struct hist_field *hist_field, *found = NULL; in find_var_field() local
1110 hist_field = hist_data->fields[i]; in find_var_field()
1111 if (hist_field && hist_field->flags & HIST_FIELD_FL_VAR && in find_var_field()
1112 strcmp(hist_field->var.name, var_name) == 0) { in find_var_field()
1113 found = hist_field; in find_var_field()
1121 static struct hist_field *find_var(struct hist_trigger_data *hist_data, in find_var()
1127 struct hist_field *hist_field; in find_var() local
1131 hist_field = find_var_field(hist_data, var_name); in find_var()
1132 if (hist_field) in find_var()
1133 return hist_field; in find_var()
1138 hist_field = find_var_field(test_data, var_name); in find_var()
1139 if (hist_field) in find_var()
1140 return hist_field; in find_var()
1178 static struct hist_field *find_file_var(struct trace_event_file *file, in find_file_var()
1183 struct hist_field *hist_field; in find_file_var() local
1190 hist_field = find_var_field(test_data, var_name); in find_file_var()
1191 if (hist_field) in find_file_var()
1192 return hist_field; in find_file_var()
1199 static struct hist_field *
1203 struct hist_field *hist_field, *found = NULL; in find_match_var() local
1217 hist_field = find_file_var(file, var_name); in find_match_var()
1218 if (hist_field) { in find_match_var()
1225 found = hist_field; in find_match_var()
1232 static struct hist_field *find_event_var(struct hist_trigger_data *hist_data, in find_event_var()
1238 struct hist_field *hist_field = NULL; in find_event_var() local
1242 hist_field = find_match_var(hist_data, var_name); in find_event_var()
1243 if (IS_ERR(hist_field)) in find_event_var()
1245 if (hist_field) in find_event_var()
1246 return hist_field; in find_event_var()
1253 hist_field = find_file_var(file, var_name); in find_event_var()
1255 return hist_field; in find_event_var()
1258 static u64 hist_field_var_ref(struct hist_field *hist_field, in hist_field_var_ref() argument
1271 var_val = elt_data->var_ref_vals[hist_field->var_ref_idx]; in hist_field_var_ref()
1281 struct hist_field *hist_field; in resolve_var_refs() local
1287 hist_field = hist_data->var_refs[i]; in resolve_var_refs()
1288 var_idx = hist_field->var.idx; in resolve_var_refs()
1289 var_data = hist_field->var.hist_data; in resolve_var_refs()
1311 if (self || !hist_field->read_once) in resolve_var_refs()
1322 static const char *hist_field_name(struct hist_field *field, in hist_field_name()
1627 struct hist_field *hist_field; in hist_trigger_elt_data_alloc() local
1635 hist_field = hist_data->fields[i]; in hist_trigger_elt_data_alloc()
1637 if (hist_field->flags & HIST_FIELD_FL_EXECNAME) { in hist_trigger_elt_data_alloc()
1692 static const char *get_hist_field_flags(struct hist_field *hist_field) in get_hist_field_flags() argument
1696 if (hist_field->flags & HIST_FIELD_FL_HEX) in get_hist_field_flags()
1698 else if (hist_field->flags & HIST_FIELD_FL_SYM) in get_hist_field_flags()
1700 else if (hist_field->flags & HIST_FIELD_FL_SYM_OFFSET) in get_hist_field_flags()
1702 else if (hist_field->flags & HIST_FIELD_FL_EXECNAME) in get_hist_field_flags()
1704 else if (hist_field->flags & HIST_FIELD_FL_SYSCALL) in get_hist_field_flags()
1706 else if (hist_field->flags & HIST_FIELD_FL_LOG2) in get_hist_field_flags()
1708 else if (hist_field->flags & HIST_FIELD_FL_BUCKET) in get_hist_field_flags()
1710 else if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP_USECS) in get_hist_field_flags()
1712 else if (hist_field->flags & HIST_FIELD_FL_PERCENT) in get_hist_field_flags()
1714 else if (hist_field->flags & HIST_FIELD_FL_GRAPH) in get_hist_field_flags()
1716 else if (hist_field->flags & HIST_FIELD_FL_STACKTRACE) in get_hist_field_flags()
1722 static void expr_field_str(struct hist_field *field, char *expr) in expr_field_str()
1745 static char *expr_str(struct hist_field *field, unsigned int level) in expr_str()
1894 static void get_hist_field(struct hist_field *hist_field) in get_hist_field() argument
1896 hist_field->ref++; in get_hist_field()
1899 static void __destroy_hist_field(struct hist_field *hist_field) in __destroy_hist_field() argument
1901 if (--hist_field->ref > 1) in __destroy_hist_field()
1904 kfree(hist_field->var.name); in __destroy_hist_field()
1905 kfree(hist_field->name); in __destroy_hist_field()
1908 kfree_const(hist_field->type); in __destroy_hist_field()
1910 kfree(hist_field->system); in __destroy_hist_field()
1911 kfree(hist_field->event_name); in __destroy_hist_field()
1913 kfree(hist_field); in __destroy_hist_field()
1916 static void destroy_hist_field(struct hist_field *hist_field, in destroy_hist_field() argument
1924 if (!hist_field) in destroy_hist_field()
1927 if (hist_field->flags & HIST_FIELD_FL_VAR_REF) in destroy_hist_field()
1931 destroy_hist_field(hist_field->operands[i], level + 1); in destroy_hist_field()
1933 __destroy_hist_field(hist_field); in destroy_hist_field()
1936 static struct hist_field *create_hist_field(struct hist_trigger_data *hist_data, in create_hist_field()
1941 struct hist_field *hist_field; in create_hist_field() local
1946 hist_field = kzalloc(sizeof(struct hist_field), GFP_KERNEL); in create_hist_field()
1947 if (!hist_field) in create_hist_field()
1950 hist_field->ref = 1; in create_hist_field()
1952 hist_field->hist_data = hist_data; in create_hist_field()
1958 hist_field->fn_num = HIST_FIELD_FN_VAR_REF; in create_hist_field()
1963 hist_field->fn_num = HIST_FIELD_FN_COUNTER; in create_hist_field()
1964 hist_field->size = sizeof(u64); in create_hist_field()
1965 hist_field->type = "u64"; in create_hist_field()
1970 hist_field->fn_num = HIST_FIELD_FN_CONST; in create_hist_field()
1971 hist_field->size = sizeof(u64); in create_hist_field()
1972 hist_field->type = kstrdup("u64", GFP_KERNEL); in create_hist_field()
1973 if (!hist_field->type) in create_hist_field()
1980 hist_field->fn_num = HIST_FIELD_FN_STACK; in create_hist_field()
1982 hist_field->fn_num = HIST_FIELD_FN_NOP; in create_hist_field()
1983 hist_field->size = HIST_STACKTRACE_SIZE; in create_hist_field()
1984 hist_field->type = kstrdup_const("unsigned long[]", GFP_KERNEL); in create_hist_field()
1985 if (!hist_field->type) in create_hist_field()
1992 hist_field->fn_num = flags & HIST_FIELD_FL_LOG2 ? HIST_FIELD_FN_LOG2 : in create_hist_field()
1994 hist_field->operands[0] = create_hist_field(hist_data, field, fl, NULL); in create_hist_field()
1995 if (!hist_field->operands[0]) in create_hist_field()
1997 hist_field->size = hist_field->operands[0]->size; in create_hist_field()
1998 hist_field->type = kstrdup_const(hist_field->operands[0]->type, GFP_KERNEL); in create_hist_field()
1999 if (!hist_field->type) in create_hist_field()
2005 hist_field->fn_num = HIST_FIELD_FN_TIMESTAMP; in create_hist_field()
2006 hist_field->size = sizeof(u64); in create_hist_field()
2007 hist_field->type = "u64"; in create_hist_field()
2012 hist_field->fn_num = HIST_FIELD_FN_CPU; in create_hist_field()
2013 hist_field->size = sizeof(int); in create_hist_field()
2014 hist_field->type = "unsigned int"; in create_hist_field()
2026 hist_field->size = MAX_FILTER_STR_VAL; in create_hist_field()
2027 hist_field->type = kstrdup_const(field->type, GFP_KERNEL); in create_hist_field()
2028 if (!hist_field->type) in create_hist_field()
2032 hist_field->fn_num = HIST_FIELD_FN_STRING; in create_hist_field()
2033 hist_field->size = field->size; in create_hist_field()
2035 hist_field->fn_num = HIST_FIELD_FN_DYNSTRING; in create_hist_field()
2037 hist_field->fn_num = HIST_FIELD_FN_RELDYNSTRING; in create_hist_field()
2039 hist_field->fn_num = HIST_FIELD_FN_PSTRING; in create_hist_field()
2041 hist_field->size = field->size; in create_hist_field()
2042 hist_field->is_signed = field->is_signed; in create_hist_field()
2043 hist_field->type = kstrdup_const(field->type, GFP_KERNEL); in create_hist_field()
2044 if (!hist_field->type) in create_hist_field()
2047 hist_field->fn_num = select_value_fn(field->size, in create_hist_field()
2049 if (hist_field->fn_num == HIST_FIELD_FN_NOP) { in create_hist_field()
2050 destroy_hist_field(hist_field, 0); in create_hist_field()
2055 hist_field->field = field; in create_hist_field()
2056 hist_field->flags = flags; in create_hist_field()
2059 hist_field->var.name = kstrdup(var_name, GFP_KERNEL); in create_hist_field()
2060 if (!hist_field->var.name) in create_hist_field()
2064 return hist_field; in create_hist_field()
2066 destroy_hist_field(hist_field, 0); in create_hist_field()
2088 static int init_var_ref(struct hist_field *ref_field, in init_var_ref()
2089 struct hist_field *var_field, in init_var_ref()
2148 struct hist_field *var_field) in find_var_ref_idx()
2150 struct hist_field *ref_field; in find_var_ref_idx()
2178 static struct hist_field *create_var_ref(struct hist_trigger_data *hist_data, in create_var_ref()
2179 struct hist_field *var_field, in create_var_ref()
2183 struct hist_field *ref_field; in create_var_ref()
2267 static struct hist_field *parse_var_ref(struct hist_trigger_data *hist_data, in parse_var_ref()
2271 struct hist_field *var_field = NULL, *ref_field = NULL; in parse_var_ref()
2394 static struct hist_field *create_alias(struct hist_trigger_data *hist_data, in create_alias()
2395 struct hist_field *var_ref, in create_alias()
2398 struct hist_field *alias = NULL; in create_alias()
2418 static struct hist_field *parse_const(struct hist_trigger_data *hist_data, in parse_const()
2423 struct hist_field *field = NULL; in parse_const()
2441 static struct hist_field *parse_atom(struct hist_trigger_data *hist_data, in parse_atom()
2447 struct hist_field *hist_field = NULL; in parse_atom() local
2452 hist_field = parse_const(hist_data, str, var_name, flags); in parse_atom()
2453 if (!hist_field) { in parse_atom()
2457 return hist_field; in parse_atom()
2480 hist_field = parse_var_ref(hist_data, ref_system, in parse_atom()
2482 if (hist_field) { in parse_atom()
2484 hist_field = create_alias(hist_data, hist_field, var_name); in parse_atom()
2485 if (!hist_field) { in parse_atom()
2490 return hist_field; in parse_atom()
2501 hist_field = create_hist_field(hist_data, field, *flags, var_name); in parse_atom()
2502 if (!hist_field) { in parse_atom()
2506 hist_field->buckets = buckets; in parse_atom()
2508 return hist_field; in parse_atom()
2513 static struct hist_field *parse_expr(struct hist_trigger_data *hist_data,
2518 static struct hist_field *parse_unary(struct hist_trigger_data *hist_data, in parse_unary()
2523 struct hist_field *operand1, *expr = NULL; in parse_unary()
2611 struct hist_field *operand1, in check_expr_operands()
2612 struct hist_field *operand2, in check_expr_operands()
2613 struct hist_field **var1, in check_expr_operands()
2614 struct hist_field **var2) in check_expr_operands()
2621 struct hist_field *var; in check_expr_operands()
2632 struct hist_field *var; in check_expr_operands()
2650 static struct hist_field *parse_expr(struct hist_trigger_data *hist_data, in parse_expr()
2655 struct hist_field *operand1 = NULL, *operand2 = NULL, *expr = NULL; in parse_expr()
2656 struct hist_field *var1 = NULL, *var2 = NULL; in parse_expr()
2861 struct hist_field *target_hist_field, *hist_field; in compatible_keys() local
2871 hist_field = hist_data->fields[i + n]; in compatible_keys()
2874 if (strcmp(hist_field->type, target_hist_field->type) != 0) in compatible_keys()
2876 if (hist_field->size != target_hist_field->size) in compatible_keys()
2878 if (hist_field->is_signed != target_hist_field->is_signed) in compatible_keys()
2921 static struct hist_field *
2925 struct hist_field *event_var; in find_synthetic_field_var()
2967 static struct hist_field *
2976 struct hist_field *key_field; in create_field_var_hist()
2977 struct hist_field *event_var; in create_field_var_hist()
3087 static struct hist_field *
3092 struct hist_field *hist_field = NULL; in find_target_event_var() local
3109 hist_field = find_var_field(hist_data, var_name); in find_target_event_var()
3111 return hist_field; in find_target_event_var()
3131 struct hist_field *var = field_var->var; in __update_field_vars()
3132 struct hist_field *val = field_var->val; in __update_field_vars()
3183 static struct hist_field *create_var(struct hist_trigger_data *hist_data, in create_var()
3187 struct hist_field *var; in create_var()
3195 var = kzalloc(sizeof(struct hist_field), GFP_KERNEL); in create_var()
3229 struct hist_field *val = NULL, *var = NULL; in create_field_var()
3509 struct hist_field *save_val = hist_data->save_vars[i]->val; in track_data_print()
3510 struct hist_field *save_var = hist_data->save_vars[i]->var; in track_data_print()
3587 struct hist_field *var_field, *ref_field, *track_var = NULL; in track_data_create()
3862 struct hist_field *hist_field, in check_synth_field() argument
3877 if (strstr(hist_field->type, "char[") && field->is_string in check_synth_field()
3881 if (strstr(hist_field->type, "long[") && field->is_stack) in check_synth_field()
3884 if (strcmp(field->type, hist_field->type) != 0) { in check_synth_field()
3885 if (field->size != hist_field->size || in check_synth_field()
3886 (!field->is_string && field->is_signed != hist_field->is_signed)) in check_synth_field()
3893 static struct hist_field *
3899 struct hist_field *hist_field; in trace_action_find_var() local
3903 hist_field = find_target_event_var(hist_data, system, event, var); in trace_action_find_var()
3904 if (!hist_field) { in trace_action_find_var()
3910 hist_field = find_event_var(hist_data, system, event, var); in trace_action_find_var()
3913 if (!hist_field) in trace_action_find_var()
3916 return hist_field; in trace_action_find_var()
3919 static struct hist_field *
3924 struct hist_field *hist_field = NULL; in trace_action_create_field_var() local
3937 hist_field = field_var->var; in trace_action_create_field_var()
3959 hist_field = create_field_var_hist(hist_data, system, event, var); in trace_action_create_field_var()
3960 if (IS_ERR(hist_field)) in trace_action_create_field_var()
3964 return hist_field; in trace_action_create_field_var()
3967 hist_field = NULL; in trace_action_create_field_var()
3976 struct hist_field *hist_field, *var_ref; in trace_action_create() local
4025 hist_field = trace_action_find_var(hist_data, data, in trace_action_create()
4029 hist_field = trace_action_create_field_var(hist_data, in trace_action_create()
4035 if (!hist_field) { in trace_action_create()
4041 if (check_synth_field(event, hist_field, field_pos) == 0) { in trace_action_create()
4042 var_ref = create_var_ref(hist_data, hist_field, in trace_action_create()
4226 struct hist_field *hist_field; in __create_val_field() local
4229 hist_field = parse_expr(hist_data, file, field_str, flags, var_name, &n_subexprs); in __create_val_field()
4230 if (IS_ERR(hist_field)) { in __create_val_field()
4231 ret = PTR_ERR(hist_field); in __create_val_field()
4236 if (hist_field->flags & HIST_FIELD_FL_VAR) { in __create_val_field()
4238 if (hist_field->flags & (HIST_FIELD_FL_GRAPH | HIST_FIELD_FL_PERCENT | in __create_val_field()
4243 if (hist_field->flags & (HIST_FIELD_FL_GRAPH | HIST_FIELD_FL_PERCENT | in __create_val_field()
4250 hist_data->fields[val_idx] = hist_field; in __create_val_field()
4277 static u64 hist_field_execname(struct hist_field *hist_field, in hist_field_execname() argument
4296 static u64 hist_field_stack(struct hist_field *hist_field, in hist_field_stack() argument
4302 u32 str_item = *(u32 *)(event + hist_field->field->offset); in hist_field_stack()
4309 static u64 hist_fn_call(struct hist_field *hist_field, in hist_fn_call() argument
4315 switch (hist_field->fn_num) { in hist_fn_call()
4317 return hist_field_var_ref(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4319 return hist_field_counter(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4321 return hist_field_const(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4323 return hist_field_log2(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4325 return hist_field_bucket(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4327 return hist_field_timestamp(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4329 return hist_field_cpu(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4331 return hist_field_string(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4333 return hist_field_dynstring(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4335 return hist_field_reldynstring(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4337 return hist_field_pstring(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4339 return hist_field_s64(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4341 return hist_field_u64(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4343 return hist_field_s32(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4345 return hist_field_u32(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4347 return hist_field_s16(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4349 return hist_field_u16(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4351 return hist_field_s8(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4353 return hist_field_u8(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4355 return hist_field_unary_minus(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4357 return hist_field_minus(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4359 return hist_field_plus(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4361 return hist_field_div(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4363 return hist_field_mult(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4365 return div_by_power_of_two(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4367 return div_by_not_power_of_two(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4369 return div_by_mult_and_shift(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4371 return hist_field_execname(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4373 return hist_field_stack(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4380 static void update_var_execname(struct hist_field *hist_field) in update_var_execname() argument
4382 hist_field->flags = HIST_FIELD_FL_STRING | HIST_FIELD_FL_VAR | in update_var_execname()
4384 hist_field->size = MAX_FILTER_STR_VAL; in update_var_execname()
4385 hist_field->is_signed = 0; in update_var_execname()
4387 kfree_const(hist_field->type); in update_var_execname()
4388 hist_field->type = "char[]"; in update_var_execname()
4390 hist_field->fn_num = HIST_FIELD_FN_EXECNAME; in update_var_execname()
4477 struct hist_field *hist_field = NULL; in create_key_field() local
4490 hist_field = create_hist_field(hist_data, NULL, flags, NULL); in create_key_field()
4492 hist_field = parse_expr(hist_data, file, field_str, flags, in create_key_field()
4494 if (IS_ERR(hist_field)) { in create_key_field()
4495 ret = PTR_ERR(hist_field); in create_key_field()
4499 if (field_has_hist_vars(hist_field, 0)) { in create_key_field()
4501 destroy_hist_field(hist_field, 0); in create_key_field()
4506 key_size = hist_field->size; in create_key_field()
4509 hist_data->fields[key_idx] = hist_field; in create_key_field()
4705 struct hist_field *hist_field; in create_sort_keys() local
4747 hist_field = hist_data->fields[j]; in create_sort_keys()
4748 if (hist_field->flags & HIST_FIELD_FL_VAR) in create_sort_keys()
4753 test_name = hist_field_name(hist_field, 0); in create_sort_keys()
5045 struct hist_field *hist_field; in create_tracing_map_fields() local
5049 hist_field = hist_data->fields[i]; in create_tracing_map_fields()
5050 if (hist_field->flags & HIST_FIELD_FL_KEY) { in create_tracing_map_fields()
5053 field = hist_field->field; in create_tracing_map_fields()
5055 if (hist_field->flags & HIST_FIELD_FL_STACKTRACE) in create_tracing_map_fields()
5057 else if (!field || hist_field->flags & HIST_FIELD_FL_CPU) in create_tracing_map_fields()
5058 cmp_fn = tracing_map_cmp_num(hist_field->size, in create_tracing_map_fields()
5059 hist_field->is_signed); in create_tracing_map_fields()
5066 hist_field->offset, in create_tracing_map_fields()
5068 } else if (!(hist_field->flags & HIST_FIELD_FL_VAR)) in create_tracing_map_fields()
5074 if (hist_field->flags & HIST_FIELD_FL_VAR) { in create_tracing_map_fields()
5078 hist_field->var.idx = idx; in create_tracing_map_fields()
5079 hist_field->var.hist_data = hist_data; in create_tracing_map_fields()
5148 struct hist_field *hist_field; in hist_trigger_elt_update() local
5156 hist_field = hist_data->fields[i]; in hist_trigger_elt_update()
5157 hist_val = hist_fn_call(hist_field, elt, buffer, rbe, rec); in hist_trigger_elt_update()
5158 if (hist_field->flags & HIST_FIELD_FL_VAR) { in hist_trigger_elt_update()
5159 var_idx = hist_field->var.idx; in hist_trigger_elt_update()
5161 if (hist_field->flags & in hist_trigger_elt_update()
5169 var_str_idx = hist_field->var_str_idx; in hist_trigger_elt_update()
5175 if (hist_field->flags & HIST_FIELD_FL_STRING) { in hist_trigger_elt_update()
5176 size = min(hist_field->size, STR_VAR_LEN_MAX); in hist_trigger_elt_update()
5198 hist_field = hist_data->fields[i]; in hist_trigger_elt_update()
5199 if (hist_field->flags & HIST_FIELD_FL_VAR) { in hist_trigger_elt_update()
5200 hist_val = hist_fn_call(hist_field, elt, buffer, rbe, rec); in hist_trigger_elt_update()
5201 var_idx = hist_field->var.idx; in hist_trigger_elt_update()
5210 struct hist_field *key_field, void *rec) in add_to_key()
5259 struct hist_field *key_field; in event_hist_trigger()
5339 struct hist_field *key_field; in hist_trigger_print_key()
5752 struct hist_field *field, unsigned long flags) in hist_field_debug_show()
5802 struct hist_field *field; in field_var_debug_show()
6005 static void hist_field_print(struct seq_file *m, struct hist_field *hist_field) in hist_field_print() argument
6007 const char *field_name = hist_field_name(hist_field, 0); in hist_field_print()
6009 if (hist_field->var.name) in hist_field_print()
6010 seq_printf(m, "%s=", hist_field->var.name); in hist_field_print()
6012 if (hist_field->flags & HIST_FIELD_FL_CPU) in hist_field_print()
6014 else if (hist_field->flags & HIST_FIELD_FL_CONST) in hist_field_print()
6015 seq_printf(m, "%llu", hist_field->constant); in hist_field_print()
6017 if (hist_field->flags & HIST_FIELD_FL_VAR_REF || in hist_field_print()
6018 hist_field->flags & HIST_FIELD_FL_ALIAS) in hist_field_print()
6021 } else if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP) in hist_field_print()
6024 if (hist_field->flags) { in hist_field_print()
6025 if (!(hist_field->flags & HIST_FIELD_FL_VAR_REF) && in hist_field_print()
6026 !(hist_field->flags & HIST_FIELD_FL_EXPR) && in hist_field_print()
6027 !(hist_field->flags & HIST_FIELD_FL_STACKTRACE)) { in hist_field_print()
6028 const char *flags = get_hist_field_flags(hist_field); in hist_field_print()
6034 if (hist_field->buckets) in hist_field_print()
6035 seq_printf(m, "=%ld", hist_field->buckets); in hist_field_print()
6042 struct hist_field *field; in event_hist_trigger_print()
6292 struct hist_field *key_field, *key_field_test; in hist_trigger_match()