Lines Matching refs:field

87 typedef u64 (*hist_field_fn_t) (struct hist_field *field,
158 struct ftrace_event_field *field; member
209 static u64 hist_field_const(struct hist_field *field, in hist_field_const() argument
215 return field->constant; in hist_field_const()
218 static u64 hist_field_counter(struct hist_field *field, in hist_field_counter() argument
233 char *addr = (char *)(event + hist_field->field->offset); in hist_field_string()
244 u32 str_item = *(u32 *)(event + hist_field->field->offset); in hist_field_dynstring()
257 u32 *item = event + hist_field->field->offset; in hist_field_reldynstring()
271 char **addr = (char **)(event + hist_field->field->offset); in hist_field_pstring()
461 type *addr = (type *)(event + hist_field->field->offset); \
995 struct hist_field *field; in check_var_refs() local
1000 field = hist_data->fields[i]; in check_var_refs()
1001 if (field && field->flags & HIST_FIELD_FL_VAR) { in check_var_refs()
1002 if (find_any_var_ref(hist_data, field->var.idx)) { in check_var_refs()
1329 static const char *hist_field_name(struct hist_field *field, in hist_field_name() argument
1334 if (WARN_ON_ONCE(!field)) in hist_field_name()
1340 if (field->field) in hist_field_name()
1341 field_name = field->field->name; in hist_field_name()
1342 else if (field->flags & HIST_FIELD_FL_LOG2 || in hist_field_name()
1343 field->flags & HIST_FIELD_FL_ALIAS || in hist_field_name()
1344 field->flags & HIST_FIELD_FL_BUCKET) in hist_field_name()
1345 field_name = hist_field_name(field->operands[0], ++level); in hist_field_name()
1346 else if (field->flags & HIST_FIELD_FL_CPU) in hist_field_name()
1348 else if (field->flags & HIST_FIELD_FL_EXPR || in hist_field_name()
1349 field->flags & HIST_FIELD_FL_VAR_REF) { in hist_field_name()
1350 if (field->system) { in hist_field_name()
1353 strcat(full_name, field->system); in hist_field_name()
1355 strcat(full_name, field->event_name); in hist_field_name()
1357 strcat(full_name, field->name); in hist_field_name()
1360 field_name = field->name; in hist_field_name()
1361 } else if (field->flags & HIST_FIELD_FL_TIMESTAMP) in hist_field_name()
1363 else if (field->flags & HIST_FIELD_FL_STACKTRACE) { in hist_field_name()
1364 if (field->field) in hist_field_name()
1365 field_name = field->field->name; in hist_field_name()
1368 } else if (field->flags & HIST_FIELD_FL_HITCOUNT) in hist_field_name()
1732 static void expr_field_str(struct hist_field *field, char *expr) in expr_field_str() argument
1734 if (field->flags & HIST_FIELD_FL_VAR_REF) in expr_field_str()
1736 else if (field->flags & HIST_FIELD_FL_CONST) { in expr_field_str()
1739 snprintf(str, HIST_CONST_DIGITS_MAX, "%llu", field->constant); in expr_field_str()
1743 strcat(expr, hist_field_name(field, 0)); in expr_field_str()
1745 if (field->flags && !(field->flags & HIST_FIELD_FL_VAR_REF)) { in expr_field_str()
1746 const char *flags_str = get_hist_field_flags(field); in expr_field_str()
1755 static char *expr_str(struct hist_field *field, unsigned int level) in expr_str() argument
1766 if (!field->operands[0]) { in expr_str()
1767 expr_field_str(field, expr); in expr_str()
1771 if (field->operator == FIELD_OP_UNARY_MINUS) { in expr_str()
1775 subexpr = expr_str(field->operands[0], ++level); in expr_str()
1788 expr_field_str(field->operands[0], expr); in expr_str()
1790 switch (field->operator) { in expr_str()
1808 expr_field_str(field->operands[1], expr); in expr_str()
1947 struct ftrace_event_field *field, in create_hist_field() argument
1953 if (field && is_function_field(field)) in create_hist_field()
1989 if (field) in create_hist_field()
2004 hist_field->operands[0] = create_hist_field(hist_data, field, fl, NULL); in create_hist_field()
2028 if (WARN_ON_ONCE(!field)) in create_hist_field()
2032 if (is_string_field(field) && in create_hist_field()
2033 (field->filter_type != FILTER_PTR_STRING)) { in create_hist_field()
2037 hist_field->type = kstrdup_const(field->type, GFP_KERNEL); in create_hist_field()
2041 if (field->filter_type == FILTER_STATIC_STRING) { in create_hist_field()
2043 hist_field->size = field->size; in create_hist_field()
2044 } else if (field->filter_type == FILTER_DYN_STRING) { in create_hist_field()
2046 } else if (field->filter_type == FILTER_RDYN_STRING) 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()
2057 hist_field->fn_num = select_value_fn(field->size, in create_hist_field()
2058 field->is_signed); in create_hist_field()
2065 hist_field->field = field; in create_hist_field()
2233 char *name, *field; in field_name_from_var() local
2240 field = hist_data->attrs->var_defs.expr[i]; in field_name_from_var()
2241 if (contains_operator(field, NULL) || is_var_ref(field)) in field_name_from_var()
2243 return field; in field_name_from_var()
2304 struct ftrace_event_field *field = NULL; in parse_field() local
2360 field = ERR_PTR(-EINVAL); in parse_field()
2377 field = trace_find_event_field(file->event_call, field_name); in parse_field()
2378 if (!field || !field->size) { in parse_field()
2386 if (field && field->filter_type == FILTER_CPU) { in parse_field()
2388 } else if (field && field->filter_type == FILTER_STACKTRACE) { in parse_field()
2393 field = ERR_PTR(-EINVAL); in parse_field()
2401 return field; in parse_field()
2433 struct hist_field *field = NULL; in parse_const() local
2442 field = create_hist_field(hist_data, NULL, *flags, var_name); in parse_const()
2443 if (!field) in parse_const()
2446 field->constant = constant; in parse_const()
2448 return field; in parse_const()
2456 struct ftrace_event_field *field = NULL; in parse_atom() local
2505 field = parse_field(hist_data, file, str, flags, &buckets); in parse_atom()
2506 if (IS_ERR(field)) { in parse_atom()
2507 ret = PTR_ERR(field); in parse_atom()
2511 hist_field = create_hist_field(hist_data, field, *flags, var_name); in parse_atom()
3040 strcat(cmd, key_field->field->name); in create_field_var_hist()
3875 struct synth_field *field; in check_synth_field() local
3880 field = event->fields[field_pos]; in check_synth_field()
3887 if (strstr(hist_field->type, "char[") && field->is_string in check_synth_field()
3888 && field->is_dynamic) 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()
4312 u32 str_item = *(u32 *)(event + hist_field->field->offset); in hist_field_stack()
5055 struct ftrace_event_field *field; in create_tracing_map_fields() local
5064 field = hist_field->field; in create_tracing_map_fields()
5068 else if (!field || hist_field->flags & HIST_FIELD_FL_CPU) in create_tracing_map_fields()
5071 else if (is_string_field(field)) in create_tracing_map_fields()
5074 cmp_fn = tracing_map_cmp_num(field->size, in create_tracing_map_fields()
5075 field->is_signed); in create_tracing_map_fields()
5226 struct ftrace_event_field *field; in add_to_key() local
5228 field = key_field->field; in add_to_key()
5229 if (field->filter_type == FILTER_DYN_STRING || in add_to_key()
5230 field->filter_type == FILTER_RDYN_STRING) in add_to_key()
5231 size = *(u32 *)(rec + field->offset) >> 16; in add_to_key()
5232 else if (field->filter_type == FILTER_STATIC_STRING) in add_to_key()
5233 size = field->size; in add_to_key()
5285 if (key_field->field) { in event_hist_trigger()
5398 if (key_field->field) in hist_trigger_print_key()
5399 seq_printf(m, "%s.stacktrace", key_field->field->name); in hist_trigger_print_key()
5673 struct hist_field *field, unsigned long flags) in hist_field_debug_show() argument
5675 if ((field->flags & flags) != flags) { in hist_field_debug_show()
5680 hist_field_debug_show_flags(m, field->flags); in hist_field_debug_show()
5681 if (field->field) in hist_field_debug_show()
5683 field->field->name); in hist_field_debug_show()
5685 if (field->flags & HIST_FIELD_FL_VAR) { in hist_field_debug_show()
5686 seq_printf(m, " var.name: %s\n", field->var.name); in hist_field_debug_show()
5688 field->var.idx); in hist_field_debug_show()
5691 if (field->flags & HIST_FIELD_FL_CONST) in hist_field_debug_show()
5692 seq_printf(m, " constant: %llu\n", field->constant); in hist_field_debug_show()
5694 if (field->flags & HIST_FIELD_FL_ALIAS) in hist_field_debug_show()
5696 field->var_ref_idx); in hist_field_debug_show()
5698 if (field->flags & HIST_FIELD_FL_VAR_REF) { in hist_field_debug_show()
5699 seq_printf(m, " name: %s\n", field->name); in hist_field_debug_show()
5701 field->var.idx); in hist_field_debug_show()
5702 seq_printf(m, " var.hist_data: %p\n", field->var.hist_data); in hist_field_debug_show()
5704 field->var_ref_idx); in hist_field_debug_show()
5705 if (field->system) in hist_field_debug_show()
5706 seq_printf(m, " system: %s\n", field->system); in hist_field_debug_show()
5707 if (field->event_name) in hist_field_debug_show()
5708 seq_printf(m, " event_name: %s\n", field->event_name); in hist_field_debug_show()
5711 seq_printf(m, " type: %s\n", field->type); in hist_field_debug_show()
5712 seq_printf(m, " size: %u\n", field->size); in hist_field_debug_show()
5713 seq_printf(m, " is_signed: %u\n", field->is_signed); in hist_field_debug_show()
5723 struct hist_field *field; in field_var_debug_show() local
5728 field = field_var->var; in field_var_debug_show()
5732 hist_field_debug_show_flags(m, field->flags); in field_var_debug_show()
5733 seq_printf(m, " var.name: %s\n", field->var.name); in field_var_debug_show()
5735 field->var.idx); in field_var_debug_show()
5737 field = field_var->val; in field_var_debug_show()
5740 if (field->field) in field_var_debug_show()
5742 field->field->name); in field_var_debug_show()
5748 seq_printf(m, " type: %s\n", field->type); in field_var_debug_show()
5749 seq_printf(m, " size: %u\n", field->size); in field_var_debug_show()
5750 seq_printf(m, " is_signed: %u\n", field->is_signed); in field_var_debug_show()
5966 struct hist_field *field; in event_hist_trigger_print() local
5979 field = hist_data->fields[i]; in event_hist_trigger_print()
5984 if (field->flags & HIST_FIELD_FL_STACKTRACE) { in event_hist_trigger_print()
5985 if (field->field) in event_hist_trigger_print()
5986 seq_printf(m, "%s.stacktrace", field->field->name); in event_hist_trigger_print()
5990 hist_field_print(m, field); in event_hist_trigger_print()
5996 field = hist_data->fields[i]; in event_hist_trigger_print()
5997 if (field->flags & HIST_FIELD_FL_VAR) { in event_hist_trigger_print()
6009 hist_field_print(m, field); in event_hist_trigger_print()
6020 field = hist_data->fields[i]; in event_hist_trigger_print()
6022 if (field->flags & HIST_FIELD_FL_VAR) { in event_hist_trigger_print()
6025 hist_field_print(m, field); in event_hist_trigger_print()
6190 static bool compatible_field(struct ftrace_event_field *field, in compatible_field() argument
6193 if (field == test_field) in compatible_field()
6195 if (field == NULL || test_field == NULL) in compatible_field()
6197 if (strcmp(field->name, test_field->name) != 0) in compatible_field()
6199 if (strcmp(field->type, test_field->type) != 0) in compatible_field()
6201 if (field->size != test_field->size) in compatible_field()
6203 if (field->is_signed != test_field->is_signed) in compatible_field()
6246 if (!compatible_field(key_field->field, key_field_test->field)) in hist_trigger_match()