• Home
  • Raw
  • Download

Lines Matching refs:hist_field

84 struct hist_field;
86 typedef u64 (*hist_field_fn_t) (struct hist_field *field,
155 struct hist_field { struct
160 struct hist_field *operands[HIST_FIELD_OPERANDS_MAX]; argument
201 static u64 hist_fn_call(struct hist_field *hist_field, argument
207 static u64 hist_field_const(struct hist_field *field, in hist_field_const()
216 static u64 hist_field_counter(struct hist_field *field, in hist_field_counter()
225 static u64 hist_field_string(struct hist_field *hist_field, in hist_field_string() argument
231 char *addr = (char *)(event + hist_field->field->offset); in hist_field_string()
236 static u64 hist_field_dynstring(struct hist_field *hist_field, in hist_field_dynstring() argument
242 u32 str_item = *(u32 *)(event + hist_field->field->offset); in hist_field_dynstring()
249 static u64 hist_field_reldynstring(struct hist_field *hist_field, in hist_field_reldynstring() argument
255 u32 *item = event + hist_field->field->offset; in hist_field_reldynstring()
263 static u64 hist_field_pstring(struct hist_field *hist_field, in hist_field_pstring() argument
269 char **addr = (char **)(event + hist_field->field->offset); in hist_field_pstring()
274 static u64 hist_field_log2(struct hist_field *hist_field, in hist_field_log2() argument
280 struct hist_field *operand = hist_field->operands[0]; in hist_field_log2()
287 static u64 hist_field_bucket(struct hist_field *hist_field, in hist_field_bucket() argument
293 struct hist_field *operand = hist_field->operands[0]; in hist_field_bucket()
294 unsigned long buckets = hist_field->buckets; in hist_field_bucket()
308 static u64 hist_field_plus(struct hist_field *hist_field, in hist_field_plus() argument
314 struct hist_field *operand1 = hist_field->operands[0]; in hist_field_plus()
315 struct hist_field *operand2 = hist_field->operands[1]; in hist_field_plus()
323 static u64 hist_field_minus(struct hist_field *hist_field, in hist_field_minus() argument
329 struct hist_field *operand1 = hist_field->operands[0]; in hist_field_minus()
330 struct hist_field *operand2 = hist_field->operands[1]; in hist_field_minus()
338 static u64 hist_field_div(struct hist_field *hist_field, in hist_field_div() argument
344 struct hist_field *operand1 = hist_field->operands[0]; in hist_field_div()
345 struct hist_field *operand2 = hist_field->operands[1]; in hist_field_div()
361 static u64 div_by_power_of_two(struct hist_field *hist_field, in div_by_power_of_two() argument
367 struct hist_field *operand1 = hist_field->operands[0]; in div_by_power_of_two()
368 struct hist_field *operand2 = hist_field->operands[1]; in div_by_power_of_two()
375 static u64 div_by_not_power_of_two(struct hist_field *hist_field, in div_by_not_power_of_two() argument
381 struct hist_field *operand1 = hist_field->operands[0]; in div_by_not_power_of_two()
382 struct hist_field *operand2 = hist_field->operands[1]; in div_by_not_power_of_two()
389 static u64 div_by_mult_and_shift(struct hist_field *hist_field, in div_by_mult_and_shift() argument
395 struct hist_field *operand1 = hist_field->operands[0]; in div_by_mult_and_shift()
396 struct hist_field *operand2 = hist_field->operands[1]; in div_by_mult_and_shift()
423 static u64 hist_field_mult(struct hist_field *hist_field, in hist_field_mult() argument
429 struct hist_field *operand1 = hist_field->operands[0]; in hist_field_mult()
430 struct hist_field *operand2 = hist_field->operands[1]; in hist_field_mult()
438 static u64 hist_field_unary_minus(struct hist_field *hist_field, in hist_field_unary_minus() argument
444 struct hist_field *operand = hist_field->operands[0]; in hist_field_unary_minus()
453 static u64 hist_field_##type(struct hist_field *hist_field, \
459 type *addr = (type *)(event + hist_field->field->offset); \
537 struct hist_field *var;
538 struct hist_field *val;
547 struct hist_field *fields[HIST_FIELDS_MAX];
561 struct hist_field *var_refs[TRACING_MAP_VARS_MAX];
644 struct hist_field *var_ref;
651 struct hist_field *track_var;
687 static enum hist_field_fn hist_field_get_div_fn(struct hist_field *divisor) in hist_field_get_div_fn()
864 static u64 hist_field_timestamp(struct hist_field *hist_field, in hist_field_timestamp() argument
870 struct hist_trigger_data *hist_data = hist_field->hist_data; in hist_field_timestamp()
881 static u64 hist_field_cpu(struct hist_field *hist_field, in hist_field_cpu() argument
903 static struct hist_field *
904 check_field_for_var_ref(struct hist_field *hist_field, in check_field_for_var_ref() argument
908 WARN_ON(!(hist_field && hist_field->flags & HIST_FIELD_FL_VAR_REF)); in check_field_for_var_ref()
910 if (hist_field && hist_field->var.idx == var_idx && in check_field_for_var_ref()
911 hist_field->var.hist_data == var_data) in check_field_for_var_ref()
912 return hist_field; in check_field_for_var_ref()
929 static struct hist_field *find_var_ref(struct hist_trigger_data *hist_data, in find_var_ref()
933 struct hist_field *hist_field; in find_var_ref() local
937 hist_field = hist_data->var_refs[i]; in find_var_ref()
938 if (check_field_for_var_ref(hist_field, var_data, var_idx)) in find_var_ref()
939 return hist_field; in find_var_ref()
959 static struct hist_field *find_any_var_ref(struct hist_trigger_data *hist_data, in find_any_var_ref()
963 struct hist_field *found = NULL; in find_any_var_ref()
992 struct hist_field *field; in check_var_refs()
1024 static bool field_has_hist_vars(struct hist_field *hist_field, in field_has_hist_vars() argument
1032 if (!hist_field) in field_has_hist_vars()
1035 if (hist_field->flags & HIST_FIELD_FL_VAR || in field_has_hist_vars()
1036 hist_field->flags & HIST_FIELD_FL_VAR_REF) in field_has_hist_vars()
1040 struct hist_field *operand; in field_has_hist_vars()
1042 operand = hist_field->operands[i]; in field_has_hist_vars()
1052 struct hist_field *hist_field; in has_hist_vars() local
1056 hist_field = hist_data->fields[i]; in has_hist_vars()
1057 if (field_has_hist_vars(hist_field, 0)) in has_hist_vars()
1107 static struct hist_field *find_var_field(struct hist_trigger_data *hist_data, in find_var_field()
1110 struct hist_field *hist_field, *found = NULL; in find_var_field() local
1114 hist_field = hist_data->fields[i]; in find_var_field()
1115 if (hist_field && hist_field->flags & HIST_FIELD_FL_VAR && in find_var_field()
1116 strcmp(hist_field->var.name, var_name) == 0) { in find_var_field()
1117 found = hist_field; in find_var_field()
1125 static struct hist_field *find_var(struct hist_trigger_data *hist_data, in find_var()
1131 struct hist_field *hist_field; in find_var() local
1135 hist_field = find_var_field(hist_data, var_name); in find_var()
1136 if (hist_field) in find_var()
1137 return hist_field; in find_var()
1142 hist_field = find_var_field(test_data, var_name); in find_var()
1143 if (hist_field) in find_var()
1144 return hist_field; in find_var()
1182 static struct hist_field *find_file_var(struct trace_event_file *file, in find_file_var()
1187 struct hist_field *hist_field; in find_file_var() local
1194 hist_field = find_var_field(test_data, var_name); in find_file_var()
1195 if (hist_field) in find_file_var()
1196 return hist_field; in find_file_var()
1203 static struct hist_field *
1207 struct hist_field *hist_field, *found = NULL; in find_match_var() local
1221 hist_field = find_file_var(file, var_name); in find_match_var()
1222 if (hist_field) { in find_match_var()
1229 found = hist_field; in find_match_var()
1236 static struct hist_field *find_event_var(struct hist_trigger_data *hist_data, in find_event_var()
1242 struct hist_field *hist_field = NULL; in find_event_var() local
1246 hist_field = find_match_var(hist_data, var_name); in find_event_var()
1247 if (IS_ERR(hist_field)) in find_event_var()
1249 if (hist_field) in find_event_var()
1250 return hist_field; in find_event_var()
1257 hist_field = find_file_var(file, var_name); in find_event_var()
1259 return hist_field; in find_event_var()
1262 static u64 hist_field_var_ref(struct hist_field *hist_field, in hist_field_var_ref() argument
1275 var_val = elt_data->var_ref_vals[hist_field->var_ref_idx]; in hist_field_var_ref()
1285 struct hist_field *hist_field; in resolve_var_refs() local
1291 hist_field = hist_data->var_refs[i]; in resolve_var_refs()
1292 var_idx = hist_field->var.idx; in resolve_var_refs()
1293 var_data = hist_field->var.hist_data; in resolve_var_refs()
1315 if (self || !hist_field->read_once) in resolve_var_refs()
1326 static const char *hist_field_name(struct hist_field *field, in hist_field_name()
1624 struct hist_field *hist_field; in hist_trigger_elt_data_alloc() local
1632 hist_field = hist_data->fields[i]; in hist_trigger_elt_data_alloc()
1634 if (hist_field->flags & HIST_FIELD_FL_EXECNAME) { in hist_trigger_elt_data_alloc()
1689 static const char *get_hist_field_flags(struct hist_field *hist_field) in get_hist_field_flags() argument
1693 if (hist_field->flags & HIST_FIELD_FL_HEX) in get_hist_field_flags()
1695 else if (hist_field->flags & HIST_FIELD_FL_SYM) in get_hist_field_flags()
1697 else if (hist_field->flags & HIST_FIELD_FL_SYM_OFFSET) in get_hist_field_flags()
1699 else if (hist_field->flags & HIST_FIELD_FL_EXECNAME) in get_hist_field_flags()
1701 else if (hist_field->flags & HIST_FIELD_FL_SYSCALL) in get_hist_field_flags()
1703 else if (hist_field->flags & HIST_FIELD_FL_LOG2) in get_hist_field_flags()
1705 else if (hist_field->flags & HIST_FIELD_FL_BUCKET) in get_hist_field_flags()
1707 else if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP_USECS) in get_hist_field_flags()
1709 else if (hist_field->flags & HIST_FIELD_FL_PERCENT) in get_hist_field_flags()
1711 else if (hist_field->flags & HIST_FIELD_FL_GRAPH) in get_hist_field_flags()
1717 static void expr_field_str(struct hist_field *field, char *expr) in expr_field_str()
1740 static char *expr_str(struct hist_field *field, unsigned int level) in expr_str()
1889 static void get_hist_field(struct hist_field *hist_field) in get_hist_field() argument
1891 hist_field->ref++; in get_hist_field()
1894 static void __destroy_hist_field(struct hist_field *hist_field) in __destroy_hist_field() argument
1896 if (--hist_field->ref > 1) in __destroy_hist_field()
1899 kfree(hist_field->var.name); in __destroy_hist_field()
1900 kfree(hist_field->name); in __destroy_hist_field()
1903 kfree_const(hist_field->type); in __destroy_hist_field()
1905 kfree(hist_field->system); in __destroy_hist_field()
1906 kfree(hist_field->event_name); in __destroy_hist_field()
1908 kfree(hist_field); in __destroy_hist_field()
1911 static void destroy_hist_field(struct hist_field *hist_field, in destroy_hist_field() argument
1919 if (!hist_field) in destroy_hist_field()
1922 if (hist_field->flags & HIST_FIELD_FL_VAR_REF) in destroy_hist_field()
1926 destroy_hist_field(hist_field->operands[i], level + 1); in destroy_hist_field()
1928 __destroy_hist_field(hist_field); in destroy_hist_field()
1931 static struct hist_field *create_hist_field(struct hist_trigger_data *hist_data, in create_hist_field()
1936 struct hist_field *hist_field; in create_hist_field() local
1941 hist_field = kzalloc(sizeof(struct hist_field), GFP_KERNEL); in create_hist_field()
1942 if (!hist_field) in create_hist_field()
1945 hist_field->ref = 1; in create_hist_field()
1947 hist_field->hist_data = hist_data; in create_hist_field()
1953 hist_field->fn_num = HIST_FIELD_FN_VAR_REF; in create_hist_field()
1958 hist_field->fn_num = HIST_FIELD_FN_COUNTER; in create_hist_field()
1959 hist_field->size = sizeof(u64); in create_hist_field()
1960 hist_field->type = "u64"; in create_hist_field()
1965 hist_field->fn_num = HIST_FIELD_FN_CONST; in create_hist_field()
1966 hist_field->size = sizeof(u64); in create_hist_field()
1967 hist_field->type = kstrdup("u64", GFP_KERNEL); in create_hist_field()
1968 if (!hist_field->type) in create_hist_field()
1974 hist_field->fn_num = HIST_FIELD_FN_NOP; in create_hist_field()
1980 hist_field->fn_num = flags & HIST_FIELD_FL_LOG2 ? HIST_FIELD_FN_LOG2 : in create_hist_field()
1982 hist_field->operands[0] = create_hist_field(hist_data, field, fl, NULL); in create_hist_field()
1983 if (!hist_field->operands[0]) in create_hist_field()
1985 hist_field->size = hist_field->operands[0]->size; in create_hist_field()
1986 hist_field->type = kstrdup_const(hist_field->operands[0]->type, GFP_KERNEL); in create_hist_field()
1987 if (!hist_field->type) in create_hist_field()
1993 hist_field->fn_num = HIST_FIELD_FN_TIMESTAMP; in create_hist_field()
1994 hist_field->size = sizeof(u64); in create_hist_field()
1995 hist_field->type = "u64"; in create_hist_field()
2000 hist_field->fn_num = HIST_FIELD_FN_CPU; in create_hist_field()
2001 hist_field->size = sizeof(int); in create_hist_field()
2002 hist_field->type = "unsigned int"; in create_hist_field()
2014 hist_field->size = MAX_FILTER_STR_VAL; in create_hist_field()
2015 hist_field->type = kstrdup_const(field->type, GFP_KERNEL); in create_hist_field()
2016 if (!hist_field->type) in create_hist_field()
2020 hist_field->fn_num = HIST_FIELD_FN_STRING; in create_hist_field()
2021 hist_field->size = field->size; in create_hist_field()
2023 hist_field->fn_num = HIST_FIELD_FN_DYNSTRING; in create_hist_field()
2025 hist_field->fn_num = HIST_FIELD_FN_RELDYNSTRING; in create_hist_field()
2027 hist_field->fn_num = HIST_FIELD_FN_PSTRING; in create_hist_field()
2029 hist_field->size = field->size; in create_hist_field()
2030 hist_field->is_signed = field->is_signed; in create_hist_field()
2031 hist_field->type = kstrdup_const(field->type, GFP_KERNEL); in create_hist_field()
2032 if (!hist_field->type) in create_hist_field()
2035 hist_field->fn_num = select_value_fn(field->size, in create_hist_field()
2037 if (hist_field->fn_num == HIST_FIELD_FN_NOP) { in create_hist_field()
2038 destroy_hist_field(hist_field, 0); in create_hist_field()
2043 hist_field->field = field; in create_hist_field()
2044 hist_field->flags = flags; in create_hist_field()
2047 hist_field->var.name = kstrdup(var_name, GFP_KERNEL); in create_hist_field()
2048 if (!hist_field->var.name) in create_hist_field()
2052 return hist_field; in create_hist_field()
2054 destroy_hist_field(hist_field, 0); in create_hist_field()
2076 static int init_var_ref(struct hist_field *ref_field, in init_var_ref()
2077 struct hist_field *var_field, in init_var_ref()
2136 struct hist_field *var_field) in find_var_ref_idx()
2138 struct hist_field *ref_field; in find_var_ref_idx()
2166 static struct hist_field *create_var_ref(struct hist_trigger_data *hist_data, in create_var_ref()
2167 struct hist_field *var_field, in create_var_ref()
2171 struct hist_field *ref_field; in create_var_ref()
2255 static struct hist_field *parse_var_ref(struct hist_trigger_data *hist_data, in parse_var_ref()
2259 struct hist_field *var_field = NULL, *ref_field = NULL; in parse_var_ref()
2372 static struct hist_field *create_alias(struct hist_trigger_data *hist_data, in create_alias()
2373 struct hist_field *var_ref, in create_alias()
2376 struct hist_field *alias = NULL; in create_alias()
2396 static struct hist_field *parse_const(struct hist_trigger_data *hist_data, in parse_const()
2401 struct hist_field *field = NULL; in parse_const()
2419 static struct hist_field *parse_atom(struct hist_trigger_data *hist_data, in parse_atom()
2425 struct hist_field *hist_field = NULL; in parse_atom() local
2430 hist_field = parse_const(hist_data, str, var_name, flags); in parse_atom()
2431 if (!hist_field) { in parse_atom()
2435 return hist_field; in parse_atom()
2458 hist_field = parse_var_ref(hist_data, ref_system, in parse_atom()
2460 if (hist_field) { in parse_atom()
2462 hist_field = create_alias(hist_data, hist_field, var_name); in parse_atom()
2463 if (!hist_field) { in parse_atom()
2468 return hist_field; in parse_atom()
2479 hist_field = create_hist_field(hist_data, field, *flags, var_name); in parse_atom()
2480 if (!hist_field) { in parse_atom()
2484 hist_field->buckets = buckets; in parse_atom()
2486 return hist_field; in parse_atom()
2491 static struct hist_field *parse_expr(struct hist_trigger_data *hist_data,
2496 static struct hist_field *parse_unary(struct hist_trigger_data *hist_data, in parse_unary()
2501 struct hist_field *operand1, *expr = NULL; in parse_unary()
2589 struct hist_field *operand1, in check_expr_operands()
2590 struct hist_field *operand2, in check_expr_operands()
2591 struct hist_field **var1, in check_expr_operands()
2592 struct hist_field **var2) in check_expr_operands()
2599 struct hist_field *var; in check_expr_operands()
2610 struct hist_field *var; in check_expr_operands()
2628 static struct hist_field *parse_expr(struct hist_trigger_data *hist_data, in parse_expr()
2633 struct hist_field *operand1 = NULL, *operand2 = NULL, *expr = NULL; in parse_expr()
2634 struct hist_field *var1 = NULL, *var2 = NULL; in parse_expr()
2839 struct hist_field *target_hist_field, *hist_field; in compatible_keys() local
2849 hist_field = hist_data->fields[i + n]; in compatible_keys()
2852 if (strcmp(hist_field->type, target_hist_field->type) != 0) in compatible_keys()
2854 if (hist_field->size != target_hist_field->size) in compatible_keys()
2856 if (hist_field->is_signed != target_hist_field->is_signed) in compatible_keys()
2899 static struct hist_field *
2903 struct hist_field *event_var; in find_synthetic_field_var()
2945 static struct hist_field *
2954 struct hist_field *key_field; in create_field_var_hist()
2955 struct hist_field *event_var; in create_field_var_hist()
3065 static struct hist_field *
3070 struct hist_field *hist_field = NULL; in find_target_event_var() local
3087 hist_field = find_var_field(hist_data, var_name); in find_target_event_var()
3089 return hist_field; in find_target_event_var()
3106 struct hist_field *var = field_var->var; in __update_field_vars()
3107 struct hist_field *val = field_var->val; in __update_field_vars()
3145 static struct hist_field *create_var(struct hist_trigger_data *hist_data, in create_var()
3149 struct hist_field *var; in create_var()
3157 var = kzalloc(sizeof(struct hist_field), GFP_KERNEL); in create_var()
3191 struct hist_field *val = NULL, *var = NULL; in create_field_var()
3471 struct hist_field *save_val = hist_data->save_vars[i]->val; in track_data_print()
3472 struct hist_field *save_var = hist_data->save_vars[i]->var; in track_data_print()
3549 struct hist_field *var_field, *ref_field, *track_var = NULL; in track_data_create()
3823 struct hist_field *hist_field, in check_synth_field() argument
3838 if (strstr(hist_field->type, "char[") && field->is_string in check_synth_field()
3842 if (strstr(hist_field->type, "long[") && field->is_stack) in check_synth_field()
3845 if (strcmp(field->type, hist_field->type) != 0) { in check_synth_field()
3846 if (field->size != hist_field->size || in check_synth_field()
3847 (!field->is_string && field->is_signed != hist_field->is_signed)) in check_synth_field()
3854 static struct hist_field *
3860 struct hist_field *hist_field; in trace_action_find_var() local
3864 hist_field = find_target_event_var(hist_data, system, event, var); in trace_action_find_var()
3865 if (!hist_field) { in trace_action_find_var()
3871 hist_field = find_event_var(hist_data, system, event, var); in trace_action_find_var()
3874 if (!hist_field) in trace_action_find_var()
3877 return hist_field; in trace_action_find_var()
3880 static struct hist_field *
3885 struct hist_field *hist_field = NULL; in trace_action_create_field_var() local
3898 hist_field = field_var->var; in trace_action_create_field_var()
3920 hist_field = create_field_var_hist(hist_data, system, event, var); in trace_action_create_field_var()
3921 if (IS_ERR(hist_field)) in trace_action_create_field_var()
3925 return hist_field; in trace_action_create_field_var()
3928 hist_field = NULL; in trace_action_create_field_var()
3937 struct hist_field *hist_field, *var_ref; in trace_action_create() local
3986 hist_field = trace_action_find_var(hist_data, data, in trace_action_create()
3990 hist_field = trace_action_create_field_var(hist_data, in trace_action_create()
3996 if (!hist_field) { in trace_action_create()
4002 if (check_synth_field(event, hist_field, field_pos) == 0) { in trace_action_create()
4003 var_ref = create_var_ref(hist_data, hist_field, in trace_action_create()
4186 struct hist_field *hist_field; in __create_val_field() local
4189 hist_field = parse_expr(hist_data, file, field_str, flags, var_name, &n_subexprs); in __create_val_field()
4190 if (IS_ERR(hist_field)) { in __create_val_field()
4191 ret = PTR_ERR(hist_field); in __create_val_field()
4196 if (hist_field->flags & HIST_FIELD_FL_VAR) { in __create_val_field()
4198 if (hist_field->flags & (HIST_FIELD_FL_GRAPH | HIST_FIELD_FL_PERCENT | in __create_val_field()
4203 if (hist_field->flags & (HIST_FIELD_FL_GRAPH | HIST_FIELD_FL_PERCENT | in __create_val_field()
4210 hist_data->fields[val_idx] = hist_field; in __create_val_field()
4237 static u64 hist_field_execname(struct hist_field *hist_field, in hist_field_execname() argument
4256 static u64 hist_fn_call(struct hist_field *hist_field, in hist_fn_call() argument
4262 switch (hist_field->fn_num) { in hist_fn_call()
4264 return hist_field_var_ref(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4266 return hist_field_counter(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4268 return hist_field_const(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4270 return hist_field_log2(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4272 return hist_field_bucket(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4274 return hist_field_timestamp(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4276 return hist_field_cpu(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4278 return hist_field_string(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4280 return hist_field_dynstring(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4282 return hist_field_reldynstring(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4284 return hist_field_pstring(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4286 return hist_field_s64(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4288 return hist_field_u64(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4290 return hist_field_s32(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4292 return hist_field_u32(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4294 return hist_field_s16(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4296 return hist_field_u16(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4298 return hist_field_s8(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4300 return hist_field_u8(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4302 return hist_field_unary_minus(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4304 return hist_field_minus(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4306 return hist_field_plus(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4308 return hist_field_div(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4310 return hist_field_mult(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4312 return div_by_power_of_two(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4314 return div_by_not_power_of_two(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4316 return div_by_mult_and_shift(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4318 return hist_field_execname(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4325 static void update_var_execname(struct hist_field *hist_field) in update_var_execname() argument
4327 hist_field->flags = HIST_FIELD_FL_STRING | HIST_FIELD_FL_VAR | in update_var_execname()
4329 hist_field->size = MAX_FILTER_STR_VAL; in update_var_execname()
4330 hist_field->is_signed = 0; in update_var_execname()
4332 kfree_const(hist_field->type); in update_var_execname()
4333 hist_field->type = "char[]"; in update_var_execname()
4335 hist_field->fn_num = HIST_FIELD_FN_EXECNAME; in update_var_execname()
4413 struct hist_field *hist_field = NULL; in create_key_field() local
4426 hist_field = create_hist_field(hist_data, NULL, flags, NULL); in create_key_field()
4428 hist_field = parse_expr(hist_data, file, field_str, flags, in create_key_field()
4430 if (IS_ERR(hist_field)) { in create_key_field()
4431 ret = PTR_ERR(hist_field); in create_key_field()
4435 if (field_has_hist_vars(hist_field, 0)) { in create_key_field()
4437 destroy_hist_field(hist_field, 0); in create_key_field()
4442 key_size = hist_field->size; in create_key_field()
4445 hist_data->fields[key_idx] = hist_field; in create_key_field()
4641 struct hist_field *hist_field; in create_sort_keys() local
4683 hist_field = hist_data->fields[j]; in create_sort_keys()
4684 if (hist_field->flags & HIST_FIELD_FL_VAR) in create_sort_keys()
4689 test_name = hist_field_name(hist_field, 0); in create_sort_keys()
4982 struct hist_field *hist_field; in create_tracing_map_fields() local
4986 hist_field = hist_data->fields[i]; in create_tracing_map_fields()
4987 if (hist_field->flags & HIST_FIELD_FL_KEY) { in create_tracing_map_fields()
4990 field = hist_field->field; in create_tracing_map_fields()
4992 if (hist_field->flags & HIST_FIELD_FL_STACKTRACE) in create_tracing_map_fields()
4994 else if (!field || hist_field->flags & HIST_FIELD_FL_CPU) in create_tracing_map_fields()
4995 cmp_fn = tracing_map_cmp_num(hist_field->size, in create_tracing_map_fields()
4996 hist_field->is_signed); in create_tracing_map_fields()
5003 hist_field->offset, in create_tracing_map_fields()
5005 } else if (!(hist_field->flags & HIST_FIELD_FL_VAR)) in create_tracing_map_fields()
5011 if (hist_field->flags & HIST_FIELD_FL_VAR) { in create_tracing_map_fields()
5015 hist_field->var.idx = idx; in create_tracing_map_fields()
5016 hist_field->var.hist_data = hist_data; in create_tracing_map_fields()
5085 struct hist_field *hist_field; in hist_trigger_elt_update() local
5093 hist_field = hist_data->fields[i]; in hist_trigger_elt_update()
5094 hist_val = hist_fn_call(hist_field, elt, buffer, rbe, rec); in hist_trigger_elt_update()
5095 if (hist_field->flags & HIST_FIELD_FL_VAR) { in hist_trigger_elt_update()
5096 var_idx = hist_field->var.idx; in hist_trigger_elt_update()
5098 if (hist_field->flags & HIST_FIELD_FL_STRING) { in hist_trigger_elt_update()
5105 var_str_idx = hist_field->var_str_idx; in hist_trigger_elt_update()
5111 size = min(hist_field->size, STR_VAR_LEN_MAX); in hist_trigger_elt_update()
5123 hist_field = hist_data->fields[i]; in hist_trigger_elt_update()
5124 if (hist_field->flags & HIST_FIELD_FL_VAR) { in hist_trigger_elt_update()
5125 hist_val = hist_fn_call(hist_field, elt, buffer, rbe, rec); in hist_trigger_elt_update()
5126 var_idx = hist_field->var.idx; in hist_trigger_elt_update()
5135 struct hist_field *key_field, void *rec) in add_to_key()
5184 struct hist_field *key_field; in event_hist_trigger()
5253 struct hist_field *key_field; in hist_trigger_print_key()
5575 struct hist_field *field, unsigned long flags) in hist_field_debug_show()
5625 struct hist_field *field; in field_var_debug_show()
5831 static void hist_field_print(struct seq_file *m, struct hist_field *hist_field) in hist_field_print() argument
5833 const char *field_name = hist_field_name(hist_field, 0); in hist_field_print()
5835 if (hist_field->var.name) in hist_field_print()
5836 seq_printf(m, "%s=", hist_field->var.name); in hist_field_print()
5838 if (hist_field->flags & HIST_FIELD_FL_CPU) in hist_field_print()
5840 else if (hist_field->flags & HIST_FIELD_FL_CONST) in hist_field_print()
5841 seq_printf(m, "%llu", hist_field->constant); in hist_field_print()
5843 if (hist_field->flags & HIST_FIELD_FL_VAR_REF || in hist_field_print()
5844 hist_field->flags & HIST_FIELD_FL_ALIAS) in hist_field_print()
5847 } else if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP) in hist_field_print()
5850 if (hist_field->flags) { in hist_field_print()
5851 if (!(hist_field->flags & HIST_FIELD_FL_VAR_REF) && in hist_field_print()
5852 !(hist_field->flags & HIST_FIELD_FL_EXPR)) { in hist_field_print()
5853 const char *flags = get_hist_field_flags(hist_field); in hist_field_print()
5859 if (hist_field->buckets) in hist_field_print()
5860 seq_printf(m, "=%ld", hist_field->buckets); in hist_field_print()
5867 struct hist_field *field; in event_hist_trigger_print()
6107 struct hist_field *key_field, *key_field_test; in hist_trigger_match()