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); \
539 struct hist_field *var;
540 struct hist_field *val;
549 struct hist_field *fields[HIST_FIELDS_MAX];
563 struct hist_field *var_refs[TRACING_MAP_VARS_MAX];
646 struct hist_field *var_ref;
653 struct hist_field *track_var;
689 static enum hist_field_fn hist_field_get_div_fn(struct hist_field *divisor) in hist_field_get_div_fn()
866 static u64 hist_field_timestamp(struct hist_field *hist_field, in hist_field_timestamp() argument
872 struct hist_trigger_data *hist_data = hist_field->hist_data; in hist_field_timestamp()
883 static u64 hist_field_cpu(struct hist_field *hist_field, in hist_field_cpu() argument
905 static struct hist_field *
906 check_field_for_var_ref(struct hist_field *hist_field, in check_field_for_var_ref() argument
910 WARN_ON(!(hist_field && hist_field->flags & HIST_FIELD_FL_VAR_REF)); in check_field_for_var_ref()
912 if (hist_field && hist_field->var.idx == var_idx && in check_field_for_var_ref()
913 hist_field->var.hist_data == var_data) in check_field_for_var_ref()
914 return hist_field; in check_field_for_var_ref()
931 static struct hist_field *find_var_ref(struct hist_trigger_data *hist_data, in find_var_ref()
935 struct hist_field *hist_field; in find_var_ref() local
939 hist_field = hist_data->var_refs[i]; in find_var_ref()
940 if (check_field_for_var_ref(hist_field, var_data, var_idx)) in find_var_ref()
941 return hist_field; in find_var_ref()
961 static struct hist_field *find_any_var_ref(struct hist_trigger_data *hist_data, in find_any_var_ref()
965 struct hist_field *found = NULL; in find_any_var_ref()
994 struct hist_field *field; in check_var_refs()
1026 static bool field_has_hist_vars(struct hist_field *hist_field, in field_has_hist_vars() argument
1034 if (!hist_field) in field_has_hist_vars()
1037 if (hist_field->flags & HIST_FIELD_FL_VAR || in field_has_hist_vars()
1038 hist_field->flags & HIST_FIELD_FL_VAR_REF) in field_has_hist_vars()
1042 struct hist_field *operand; in field_has_hist_vars()
1044 operand = hist_field->operands[i]; in field_has_hist_vars()
1054 struct hist_field *hist_field; in has_hist_vars() local
1058 hist_field = hist_data->fields[i]; in has_hist_vars()
1059 if (field_has_hist_vars(hist_field, 0)) in has_hist_vars()
1109 static struct hist_field *find_var_field(struct hist_trigger_data *hist_data, in find_var_field()
1112 struct hist_field *hist_field, *found = NULL; in find_var_field() local
1116 hist_field = hist_data->fields[i]; in find_var_field()
1117 if (hist_field && hist_field->flags & HIST_FIELD_FL_VAR && in find_var_field()
1118 strcmp(hist_field->var.name, var_name) == 0) { in find_var_field()
1119 found = hist_field; in find_var_field()
1127 static struct hist_field *find_var(struct hist_trigger_data *hist_data, in find_var()
1133 struct hist_field *hist_field; in find_var() local
1137 hist_field = find_var_field(hist_data, var_name); in find_var()
1138 if (hist_field) in find_var()
1139 return hist_field; in find_var()
1144 hist_field = find_var_field(test_data, var_name); in find_var()
1145 if (hist_field) in find_var()
1146 return hist_field; in find_var()
1184 static struct hist_field *find_file_var(struct trace_event_file *file, in find_file_var()
1189 struct hist_field *hist_field; in find_file_var() local
1196 hist_field = find_var_field(test_data, var_name); in find_file_var()
1197 if (hist_field) in find_file_var()
1198 return hist_field; in find_file_var()
1205 static struct hist_field *
1209 struct hist_field *hist_field, *found = NULL; in find_match_var() local
1223 hist_field = find_file_var(file, var_name); in find_match_var()
1224 if (hist_field) { in find_match_var()
1231 found = hist_field; in find_match_var()
1238 static struct hist_field *find_event_var(struct hist_trigger_data *hist_data, in find_event_var()
1244 struct hist_field *hist_field = NULL; in find_event_var() local
1248 hist_field = find_match_var(hist_data, var_name); in find_event_var()
1249 if (IS_ERR(hist_field)) in find_event_var()
1251 if (hist_field) in find_event_var()
1252 return hist_field; in find_event_var()
1259 hist_field = find_file_var(file, var_name); in find_event_var()
1261 return hist_field; in find_event_var()
1264 static u64 hist_field_var_ref(struct hist_field *hist_field, in hist_field_var_ref() argument
1277 var_val = elt_data->var_ref_vals[hist_field->var_ref_idx]; in hist_field_var_ref()
1287 struct hist_field *hist_field; in resolve_var_refs() local
1293 hist_field = hist_data->var_refs[i]; in resolve_var_refs()
1294 var_idx = hist_field->var.idx; in resolve_var_refs()
1295 var_data = hist_field->var.hist_data; in resolve_var_refs()
1317 if (self || !hist_field->read_once) in resolve_var_refs()
1328 static const char *hist_field_name(struct hist_field *field, in hist_field_name()
1623 struct hist_field *hist_field; in hist_trigger_elt_data_alloc() local
1631 hist_field = hist_data->fields[i]; in hist_trigger_elt_data_alloc()
1633 if (hist_field->flags & HIST_FIELD_FL_EXECNAME) { in hist_trigger_elt_data_alloc()
1688 static const char *get_hist_field_flags(struct hist_field *hist_field) in get_hist_field_flags() argument
1692 if (hist_field->flags & HIST_FIELD_FL_HEX) in get_hist_field_flags()
1694 else if (hist_field->flags & HIST_FIELD_FL_SYM) in get_hist_field_flags()
1696 else if (hist_field->flags & HIST_FIELD_FL_SYM_OFFSET) in get_hist_field_flags()
1698 else if (hist_field->flags & HIST_FIELD_FL_EXECNAME) in get_hist_field_flags()
1700 else if (hist_field->flags & HIST_FIELD_FL_SYSCALL) in get_hist_field_flags()
1702 else if (hist_field->flags & HIST_FIELD_FL_LOG2) in get_hist_field_flags()
1704 else if (hist_field->flags & HIST_FIELD_FL_BUCKET) in get_hist_field_flags()
1706 else if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP_USECS) in get_hist_field_flags()
1712 static void expr_field_str(struct hist_field *field, char *expr) in expr_field_str()
1735 static char *expr_str(struct hist_field *field, unsigned int level) in expr_str()
1884 static void get_hist_field(struct hist_field *hist_field) in get_hist_field() argument
1886 hist_field->ref++; in get_hist_field()
1889 static void __destroy_hist_field(struct hist_field *hist_field) in __destroy_hist_field() argument
1891 if (--hist_field->ref > 1) in __destroy_hist_field()
1894 kfree(hist_field->var.name); in __destroy_hist_field()
1895 kfree(hist_field->name); in __destroy_hist_field()
1898 kfree_const(hist_field->type); in __destroy_hist_field()
1900 kfree(hist_field->system); in __destroy_hist_field()
1901 kfree(hist_field->event_name); in __destroy_hist_field()
1903 kfree(hist_field); in __destroy_hist_field()
1906 static void destroy_hist_field(struct hist_field *hist_field, in destroy_hist_field() argument
1914 if (!hist_field) in destroy_hist_field()
1917 if (hist_field->flags & HIST_FIELD_FL_VAR_REF) in destroy_hist_field()
1921 destroy_hist_field(hist_field->operands[i], level + 1); in destroy_hist_field()
1923 __destroy_hist_field(hist_field); in destroy_hist_field()
1926 static struct hist_field *create_hist_field(struct hist_trigger_data *hist_data, in create_hist_field()
1931 struct hist_field *hist_field; in create_hist_field() local
1936 hist_field = kzalloc(sizeof(struct hist_field), GFP_KERNEL); in create_hist_field()
1937 if (!hist_field) in create_hist_field()
1940 hist_field->ref = 1; in create_hist_field()
1942 hist_field->hist_data = hist_data; in create_hist_field()
1948 hist_field->fn_num = HIST_FIELD_FN_VAR_REF; in create_hist_field()
1953 hist_field->fn_num = HIST_FIELD_FN_COUNTER; in create_hist_field()
1954 hist_field->size = sizeof(u64); in create_hist_field()
1955 hist_field->type = "u64"; in create_hist_field()
1960 hist_field->fn_num = HIST_FIELD_FN_CONST; in create_hist_field()
1961 hist_field->size = sizeof(u64); in create_hist_field()
1962 hist_field->type = kstrdup("u64", GFP_KERNEL); in create_hist_field()
1963 if (!hist_field->type) in create_hist_field()
1969 hist_field->fn_num = HIST_FIELD_FN_NOP; in create_hist_field()
1975 hist_field->fn_num = flags & HIST_FIELD_FL_LOG2 ? HIST_FIELD_FN_LOG2 : in create_hist_field()
1977 hist_field->operands[0] = create_hist_field(hist_data, field, fl, NULL); in create_hist_field()
1978 hist_field->size = hist_field->operands[0]->size; in create_hist_field()
1979 hist_field->type = kstrdup_const(hist_field->operands[0]->type, GFP_KERNEL); in create_hist_field()
1980 if (!hist_field->type) in create_hist_field()
1986 hist_field->fn_num = HIST_FIELD_FN_TIMESTAMP; in create_hist_field()
1987 hist_field->size = sizeof(u64); in create_hist_field()
1988 hist_field->type = "u64"; in create_hist_field()
1993 hist_field->fn_num = HIST_FIELD_FN_CPU; in create_hist_field()
1994 hist_field->size = sizeof(int); in create_hist_field()
1995 hist_field->type = "unsigned int"; in create_hist_field()
2007 hist_field->size = MAX_FILTER_STR_VAL; in create_hist_field()
2008 hist_field->type = kstrdup_const(field->type, GFP_KERNEL); in create_hist_field()
2009 if (!hist_field->type) in create_hist_field()
2013 hist_field->fn_num = HIST_FIELD_FN_STRING; in create_hist_field()
2014 hist_field->size = field->size; in create_hist_field()
2016 hist_field->fn_num = HIST_FIELD_FN_DYNSTRING; in create_hist_field()
2018 hist_field->fn_num = HIST_FIELD_FN_RELDYNSTRING; in create_hist_field()
2020 hist_field->fn_num = HIST_FIELD_FN_PSTRING; in create_hist_field()
2022 hist_field->size = field->size; in create_hist_field()
2023 hist_field->is_signed = field->is_signed; in create_hist_field()
2024 hist_field->type = kstrdup_const(field->type, GFP_KERNEL); in create_hist_field()
2025 if (!hist_field->type) in create_hist_field()
2028 hist_field->fn_num = select_value_fn(field->size, in create_hist_field()
2030 if (hist_field->fn_num == HIST_FIELD_FN_NOP) { in create_hist_field()
2031 destroy_hist_field(hist_field, 0); in create_hist_field()
2036 hist_field->field = field; in create_hist_field()
2037 hist_field->flags = flags; in create_hist_field()
2040 hist_field->var.name = kstrdup(var_name, GFP_KERNEL); in create_hist_field()
2041 if (!hist_field->var.name) in create_hist_field()
2045 return hist_field; in create_hist_field()
2047 destroy_hist_field(hist_field, 0); in create_hist_field()
2069 static int init_var_ref(struct hist_field *ref_field, in init_var_ref()
2070 struct hist_field *var_field, in init_var_ref()
2129 struct hist_field *var_field) in find_var_ref_idx()
2131 struct hist_field *ref_field; in find_var_ref_idx()
2159 static struct hist_field *create_var_ref(struct hist_trigger_data *hist_data, in create_var_ref()
2160 struct hist_field *var_field, in create_var_ref()
2164 struct hist_field *ref_field; in create_var_ref()
2246 static struct hist_field *parse_var_ref(struct hist_trigger_data *hist_data, in parse_var_ref()
2250 struct hist_field *var_field = NULL, *ref_field = NULL; in parse_var_ref()
2355 static struct hist_field *create_alias(struct hist_trigger_data *hist_data, in create_alias()
2356 struct hist_field *var_ref, in create_alias()
2359 struct hist_field *alias = NULL; in create_alias()
2379 static struct hist_field *parse_const(struct hist_trigger_data *hist_data, in parse_const()
2384 struct hist_field *field = NULL; in parse_const()
2402 static struct hist_field *parse_atom(struct hist_trigger_data *hist_data, in parse_atom()
2408 struct hist_field *hist_field = NULL; in parse_atom() local
2413 hist_field = parse_const(hist_data, str, var_name, flags); in parse_atom()
2414 if (!hist_field) { in parse_atom()
2418 return hist_field; in parse_atom()
2441 hist_field = parse_var_ref(hist_data, ref_system, in parse_atom()
2443 if (hist_field) { in parse_atom()
2445 hist_field = create_alias(hist_data, hist_field, var_name); in parse_atom()
2446 if (!hist_field) { in parse_atom()
2451 return hist_field; in parse_atom()
2462 hist_field = create_hist_field(hist_data, field, *flags, var_name); in parse_atom()
2463 if (!hist_field) { in parse_atom()
2467 hist_field->buckets = buckets; in parse_atom()
2469 return hist_field; in parse_atom()
2474 static struct hist_field *parse_expr(struct hist_trigger_data *hist_data,
2479 static struct hist_field *parse_unary(struct hist_trigger_data *hist_data, in parse_unary()
2484 struct hist_field *operand1, *expr = NULL; in parse_unary()
2572 struct hist_field *operand1, in check_expr_operands()
2573 struct hist_field *operand2, in check_expr_operands()
2574 struct hist_field **var1, in check_expr_operands()
2575 struct hist_field **var2) in check_expr_operands()
2582 struct hist_field *var; in check_expr_operands()
2593 struct hist_field *var; in check_expr_operands()
2611 static struct hist_field *parse_expr(struct hist_trigger_data *hist_data, in parse_expr()
2616 struct hist_field *operand1 = NULL, *operand2 = NULL, *expr = NULL; in parse_expr()
2617 struct hist_field *var1 = NULL, *var2 = NULL; in parse_expr()
2822 struct hist_field *target_hist_field, *hist_field; in compatible_keys() local
2832 hist_field = hist_data->fields[i + n]; in compatible_keys()
2835 if (strcmp(hist_field->type, target_hist_field->type) != 0) in compatible_keys()
2837 if (hist_field->size != target_hist_field->size) in compatible_keys()
2839 if (hist_field->is_signed != target_hist_field->is_signed) in compatible_keys()
2882 static struct hist_field *
2886 struct hist_field *event_var; in find_synthetic_field_var()
2928 static struct hist_field *
2937 struct hist_field *key_field; in create_field_var_hist()
2938 struct hist_field *event_var; in create_field_var_hist()
3048 static struct hist_field *
3053 struct hist_field *hist_field = NULL; in find_target_event_var() local
3070 hist_field = find_var_field(hist_data, var_name); in find_target_event_var()
3072 return hist_field; in find_target_event_var()
3089 struct hist_field *var = field_var->var; in __update_field_vars()
3090 struct hist_field *val = field_var->val; in __update_field_vars()
3128 static struct hist_field *create_var(struct hist_trigger_data *hist_data, in create_var()
3132 struct hist_field *var; in create_var()
3140 var = kzalloc(sizeof(struct hist_field), GFP_KERNEL); in create_var()
3174 struct hist_field *val = NULL, *var = NULL; in create_field_var()
3454 struct hist_field *save_val = hist_data->save_vars[i]->val; in track_data_print()
3455 struct hist_field *save_var = hist_data->save_vars[i]->var; in track_data_print()
3532 struct hist_field *var_field, *ref_field, *track_var = NULL; in track_data_create()
3805 struct hist_field *hist_field, in check_synth_field() argument
3820 if (strstr(hist_field->type, "char[") && field->is_string in check_synth_field()
3824 if (strcmp(field->type, hist_field->type) != 0) { in check_synth_field()
3825 if (field->size != hist_field->size || in check_synth_field()
3826 (!field->is_string && field->is_signed != hist_field->is_signed)) in check_synth_field()
3833 static struct hist_field *
3839 struct hist_field *hist_field; in trace_action_find_var() local
3843 hist_field = find_target_event_var(hist_data, system, event, var); in trace_action_find_var()
3844 if (!hist_field) { in trace_action_find_var()
3850 hist_field = find_event_var(hist_data, system, event, var); in trace_action_find_var()
3853 if (!hist_field) in trace_action_find_var()
3856 return hist_field; in trace_action_find_var()
3859 static struct hist_field *
3864 struct hist_field *hist_field = NULL; in trace_action_create_field_var() local
3877 hist_field = field_var->var; in trace_action_create_field_var()
3899 hist_field = create_field_var_hist(hist_data, system, event, var); in trace_action_create_field_var()
3900 if (IS_ERR(hist_field)) in trace_action_create_field_var()
3904 return hist_field; in trace_action_create_field_var()
3907 hist_field = NULL; in trace_action_create_field_var()
3916 struct hist_field *hist_field, *var_ref; in trace_action_create() local
3961 hist_field = trace_action_find_var(hist_data, data, in trace_action_create()
3965 hist_field = trace_action_create_field_var(hist_data, in trace_action_create()
3971 if (!hist_field) { in trace_action_create()
3977 if (check_synth_field(event, hist_field, field_pos) == 0) { in trace_action_create()
3978 var_ref = create_var_ref(hist_data, hist_field, in trace_action_create()
4161 struct hist_field *hist_field; in __create_val_field() local
4164 hist_field = parse_expr(hist_data, file, field_str, flags, var_name, &n_subexprs); in __create_val_field()
4165 if (IS_ERR(hist_field)) { in __create_val_field()
4166 ret = PTR_ERR(hist_field); in __create_val_field()
4170 hist_data->fields[val_idx] = hist_field; in __create_val_field()
4194 static u64 hist_field_execname(struct hist_field *hist_field, in hist_field_execname() argument
4213 static u64 hist_fn_call(struct hist_field *hist_field, in hist_fn_call() argument
4219 switch (hist_field->fn_num) { in hist_fn_call()
4221 return hist_field_var_ref(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4223 return hist_field_counter(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4225 return hist_field_const(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4227 return hist_field_log2(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4229 return hist_field_bucket(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4231 return hist_field_timestamp(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4233 return hist_field_cpu(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4235 return hist_field_string(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4237 return hist_field_dynstring(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4239 return hist_field_reldynstring(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4241 return hist_field_pstring(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4243 return hist_field_s64(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4245 return hist_field_u64(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4247 return hist_field_s32(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4249 return hist_field_u32(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4251 return hist_field_s16(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4253 return hist_field_u16(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4255 return hist_field_s8(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4257 return hist_field_u8(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4259 return hist_field_unary_minus(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4261 return hist_field_minus(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4263 return hist_field_plus(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4265 return hist_field_div(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4267 return hist_field_mult(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4269 return div_by_power_of_two(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4271 return div_by_not_power_of_two(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4273 return div_by_mult_and_shift(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4275 return hist_field_execname(hist_field, elt, buffer, rbe, event); in hist_fn_call()
4282 static void update_var_execname(struct hist_field *hist_field) in update_var_execname() argument
4284 hist_field->flags = HIST_FIELD_FL_STRING | HIST_FIELD_FL_VAR | in update_var_execname()
4286 hist_field->size = MAX_FILTER_STR_VAL; in update_var_execname()
4287 hist_field->is_signed = 0; in update_var_execname()
4289 kfree_const(hist_field->type); in update_var_execname()
4290 hist_field->type = "char[]"; in update_var_execname()
4292 hist_field->fn_num = HIST_FIELD_FN_EXECNAME; in update_var_execname()
4370 struct hist_field *hist_field = NULL; in create_key_field() local
4383 hist_field = create_hist_field(hist_data, NULL, flags, NULL); in create_key_field()
4385 hist_field = parse_expr(hist_data, file, field_str, flags, in create_key_field()
4387 if (IS_ERR(hist_field)) { in create_key_field()
4388 ret = PTR_ERR(hist_field); in create_key_field()
4392 if (field_has_hist_vars(hist_field, 0)) { in create_key_field()
4394 destroy_hist_field(hist_field, 0); in create_key_field()
4399 key_size = hist_field->size; in create_key_field()
4402 hist_data->fields[key_idx] = hist_field; in create_key_field()
4598 struct hist_field *hist_field; in create_sort_keys() local
4640 hist_field = hist_data->fields[j]; in create_sort_keys()
4641 if (hist_field->flags & HIST_FIELD_FL_VAR) in create_sort_keys()
4646 test_name = hist_field_name(hist_field, 0); in create_sort_keys()
4939 struct hist_field *hist_field; in create_tracing_map_fields() local
4943 hist_field = hist_data->fields[i]; in create_tracing_map_fields()
4944 if (hist_field->flags & HIST_FIELD_FL_KEY) { in create_tracing_map_fields()
4947 field = hist_field->field; in create_tracing_map_fields()
4949 if (hist_field->flags & HIST_FIELD_FL_STACKTRACE) in create_tracing_map_fields()
4951 else if (!field || hist_field->flags & HIST_FIELD_FL_CPU) in create_tracing_map_fields()
4952 cmp_fn = tracing_map_cmp_num(hist_field->size, in create_tracing_map_fields()
4953 hist_field->is_signed); in create_tracing_map_fields()
4960 hist_field->offset, in create_tracing_map_fields()
4962 } else if (!(hist_field->flags & HIST_FIELD_FL_VAR)) in create_tracing_map_fields()
4968 if (hist_field->flags & HIST_FIELD_FL_VAR) { in create_tracing_map_fields()
4972 hist_field->var.idx = idx; in create_tracing_map_fields()
4973 hist_field->var.hist_data = hist_data; in create_tracing_map_fields()
5042 struct hist_field *hist_field; in hist_trigger_elt_update() local
5050 hist_field = hist_data->fields[i]; in hist_trigger_elt_update()
5051 hist_val = hist_fn_call(hist_field, elt, buffer, rbe, rec); in hist_trigger_elt_update()
5052 if (hist_field->flags & HIST_FIELD_FL_VAR) { in hist_trigger_elt_update()
5053 var_idx = hist_field->var.idx; in hist_trigger_elt_update()
5055 if (hist_field->flags & HIST_FIELD_FL_STRING) { in hist_trigger_elt_update()
5062 var_str_idx = hist_field->var_str_idx; in hist_trigger_elt_update()
5068 size = min(hist_field->size, STR_VAR_LEN_MAX); in hist_trigger_elt_update()
5080 hist_field = hist_data->fields[i]; in hist_trigger_elt_update()
5081 if (hist_field->flags & HIST_FIELD_FL_VAR) { in hist_trigger_elt_update()
5082 hist_val = hist_fn_call(hist_field, elt, buffer, rbe, rec); in hist_trigger_elt_update()
5083 var_idx = hist_field->var.idx; in hist_trigger_elt_update()
5092 struct hist_field *key_field, void *rec) in add_to_key()
5141 struct hist_field *key_field; in event_hist_trigger()
5210 struct hist_field *key_field; in hist_trigger_print_key()
5437 struct hist_field *field, unsigned long flags) in hist_field_debug_show()
5487 struct hist_field *field; in field_var_debug_show()
5691 static void hist_field_print(struct seq_file *m, struct hist_field *hist_field) in hist_field_print() argument
5693 const char *field_name = hist_field_name(hist_field, 0); in hist_field_print()
5695 if (hist_field->var.name) in hist_field_print()
5696 seq_printf(m, "%s=", hist_field->var.name); in hist_field_print()
5698 if (hist_field->flags & HIST_FIELD_FL_CPU) in hist_field_print()
5700 else if (hist_field->flags & HIST_FIELD_FL_CONST) in hist_field_print()
5701 seq_printf(m, "%llu", hist_field->constant); in hist_field_print()
5703 if (hist_field->flags & HIST_FIELD_FL_VAR_REF || in hist_field_print()
5704 hist_field->flags & HIST_FIELD_FL_ALIAS) in hist_field_print()
5707 } else if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP) in hist_field_print()
5710 if (hist_field->flags) { in hist_field_print()
5711 if (!(hist_field->flags & HIST_FIELD_FL_VAR_REF) && in hist_field_print()
5712 !(hist_field->flags & HIST_FIELD_FL_EXPR)) { in hist_field_print()
5713 const char *flags = get_hist_field_flags(hist_field); in hist_field_print()
5719 if (hist_field->buckets) in hist_field_print()
5720 seq_printf(m, "=%ld", hist_field->buckets); in hist_field_print()
5727 struct hist_field *field; in event_hist_trigger_print()
5967 struct hist_field *key_field, *key_field_test; in hist_trigger_match()