Lines Matching refs:field
86 typedef u64 (*hist_field_fn_t) (struct hist_field *field,
156 struct ftrace_event_field *field; member
207 static u64 hist_field_const(struct hist_field *field, in hist_field_const() argument
213 return field->constant; in hist_field_const()
216 static u64 hist_field_counter(struct hist_field *field, in hist_field_counter() argument
231 char *addr = (char *)(event + hist_field->field->offset); in hist_field_string()
242 u32 str_item = *(u32 *)(event + hist_field->field->offset); in hist_field_dynstring()
255 u32 *item = event + hist_field->field->offset; in hist_field_reldynstring()
269 char **addr = (char **)(event + hist_field->field->offset); in hist_field_pstring()
459 type *addr = (type *)(event + hist_field->field->offset); \
992 struct hist_field *field; in check_var_refs() local
997 field = hist_data->fields[i]; in check_var_refs()
998 if (field && field->flags & HIST_FIELD_FL_VAR) { in check_var_refs()
999 if (find_any_var_ref(hist_data, field->var.idx)) { in check_var_refs()
1326 static const char *hist_field_name(struct hist_field *field, in hist_field_name() argument
1331 if (WARN_ON_ONCE(!field)) in hist_field_name()
1337 if (field->field) in hist_field_name()
1338 field_name = field->field->name; in hist_field_name()
1339 else if (field->flags & HIST_FIELD_FL_LOG2 || in hist_field_name()
1340 field->flags & HIST_FIELD_FL_ALIAS || in hist_field_name()
1341 field->flags & HIST_FIELD_FL_BUCKET) in hist_field_name()
1342 field_name = hist_field_name(field->operands[0], ++level); in hist_field_name()
1343 else if (field->flags & HIST_FIELD_FL_CPU) in hist_field_name()
1345 else if (field->flags & HIST_FIELD_FL_EXPR || in hist_field_name()
1346 field->flags & HIST_FIELD_FL_VAR_REF) { in hist_field_name()
1347 if (field->system) { in hist_field_name()
1350 strcat(full_name, field->system); in hist_field_name()
1352 strcat(full_name, field->event_name); in hist_field_name()
1354 strcat(full_name, field->name); in hist_field_name()
1357 field_name = field->name; in hist_field_name()
1358 } else if (field->flags & HIST_FIELD_FL_TIMESTAMP) in hist_field_name()
1717 static void expr_field_str(struct hist_field *field, char *expr) in expr_field_str() argument
1719 if (field->flags & HIST_FIELD_FL_VAR_REF) in expr_field_str()
1721 else if (field->flags & HIST_FIELD_FL_CONST) { in expr_field_str()
1724 snprintf(str, HIST_CONST_DIGITS_MAX, "%llu", field->constant); in expr_field_str()
1728 strcat(expr, hist_field_name(field, 0)); in expr_field_str()
1730 if (field->flags && !(field->flags & HIST_FIELD_FL_VAR_REF)) { in expr_field_str()
1731 const char *flags_str = get_hist_field_flags(field); in expr_field_str()
1740 static char *expr_str(struct hist_field *field, unsigned int level) in expr_str() argument
1751 if (!field->operands[0]) { in expr_str()
1752 expr_field_str(field, expr); in expr_str()
1756 if (field->operator == FIELD_OP_UNARY_MINUS) { in expr_str()
1760 subexpr = expr_str(field->operands[0], ++level); in expr_str()
1773 expr_field_str(field->operands[0], expr); in expr_str()
1775 switch (field->operator) { in expr_str()
1793 expr_field_str(field->operands[1], expr); in expr_str()
1932 struct ftrace_event_field *field, in create_hist_field() argument
1938 if (field && is_function_field(field)) in create_hist_field()
1982 hist_field->operands[0] = create_hist_field(hist_data, field, fl, NULL); in create_hist_field()
2006 if (WARN_ON_ONCE(!field)) in create_hist_field()
2010 if (is_string_field(field) && in create_hist_field()
2011 (field->filter_type != FILTER_PTR_STRING)) { in create_hist_field()
2015 hist_field->type = kstrdup_const(field->type, GFP_KERNEL); in create_hist_field()
2019 if (field->filter_type == FILTER_STATIC_STRING) { in create_hist_field()
2021 hist_field->size = field->size; in create_hist_field()
2022 } else if (field->filter_type == FILTER_DYN_STRING) { in create_hist_field()
2024 } else if (field->filter_type == FILTER_RDYN_STRING) 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()
2035 hist_field->fn_num = select_value_fn(field->size, in create_hist_field()
2036 field->is_signed); in create_hist_field()
2043 hist_field->field = field; in create_hist_field()
2211 char *name, *field; in field_name_from_var() local
2218 field = hist_data->attrs->var_defs.expr[i]; in field_name_from_var()
2219 if (contains_operator(field, NULL) || is_var_ref(field)) in field_name_from_var()
2221 return field; in field_name_from_var()
2282 struct ftrace_event_field *field = NULL; in parse_field() local
2336 field = ERR_PTR(-EINVAL); in parse_field()
2349 field = trace_find_event_field(file->event_call, field_name); in parse_field()
2350 if (!field || !field->size) { in parse_field()
2356 if (field && field->filter_type == FILTER_CPU) { in parse_field()
2361 field = ERR_PTR(-EINVAL); in parse_field()
2369 return field; in parse_field()
2401 struct hist_field *field = NULL; in parse_const() local
2410 field = create_hist_field(hist_data, NULL, *flags, var_name); in parse_const()
2411 if (!field) in parse_const()
2414 field->constant = constant; in parse_const()
2416 return field; in parse_const()
2424 struct ftrace_event_field *field = NULL; in parse_atom() local
2473 field = parse_field(hist_data, file, str, flags, &buckets); in parse_atom()
2474 if (IS_ERR(field)) { in parse_atom()
2475 ret = PTR_ERR(field); in parse_atom()
2479 hist_field = create_hist_field(hist_data, field, *flags, var_name); in parse_atom()
3008 strcat(cmd, key_field->field->name); in create_field_var_hist()
3826 struct synth_field *field; in check_synth_field() local
3831 field = event->fields[field_pos]; in check_synth_field()
3838 if (strstr(hist_field->type, "char[") && field->is_string in check_synth_field()
3839 && field->is_dynamic) 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()
4981 struct ftrace_event_field *field; in create_tracing_map_fields() local
4990 field = hist_field->field; in create_tracing_map_fields()
4994 else if (!field || hist_field->flags & HIST_FIELD_FL_CPU) in create_tracing_map_fields()
4997 else if (is_string_field(field)) in create_tracing_map_fields()
5000 cmp_fn = tracing_map_cmp_num(field->size, in create_tracing_map_fields()
5001 field->is_signed); in create_tracing_map_fields()
5140 struct ftrace_event_field *field; in add_to_key() local
5142 field = key_field->field; in add_to_key()
5143 if (field->filter_type == FILTER_DYN_STRING || in add_to_key()
5144 field->filter_type == FILTER_RDYN_STRING) in add_to_key()
5145 size = *(u32 *)(rec + field->offset) >> 16; in add_to_key()
5146 else if (field->filter_type == FILTER_STATIC_STRING) in add_to_key()
5147 size = field->size; in add_to_key()
5575 struct hist_field *field, unsigned long flags) in hist_field_debug_show() argument
5577 if ((field->flags & flags) != flags) { in hist_field_debug_show()
5582 hist_field_debug_show_flags(m, field->flags); in hist_field_debug_show()
5583 if (field->field) in hist_field_debug_show()
5585 field->field->name); in hist_field_debug_show()
5587 if (field->flags & HIST_FIELD_FL_VAR) { in hist_field_debug_show()
5588 seq_printf(m, " var.name: %s\n", field->var.name); in hist_field_debug_show()
5590 field->var.idx); in hist_field_debug_show()
5593 if (field->flags & HIST_FIELD_FL_CONST) in hist_field_debug_show()
5594 seq_printf(m, " constant: %llu\n", field->constant); in hist_field_debug_show()
5596 if (field->flags & HIST_FIELD_FL_ALIAS) in hist_field_debug_show()
5598 field->var_ref_idx); in hist_field_debug_show()
5600 if (field->flags & HIST_FIELD_FL_VAR_REF) { in hist_field_debug_show()
5601 seq_printf(m, " name: %s\n", field->name); in hist_field_debug_show()
5603 field->var.idx); in hist_field_debug_show()
5604 seq_printf(m, " var.hist_data: %p\n", field->var.hist_data); in hist_field_debug_show()
5606 field->var_ref_idx); in hist_field_debug_show()
5607 if (field->system) in hist_field_debug_show()
5608 seq_printf(m, " system: %s\n", field->system); in hist_field_debug_show()
5609 if (field->event_name) in hist_field_debug_show()
5610 seq_printf(m, " event_name: %s\n", field->event_name); in hist_field_debug_show()
5613 seq_printf(m, " type: %s\n", field->type); in hist_field_debug_show()
5614 seq_printf(m, " size: %u\n", field->size); in hist_field_debug_show()
5615 seq_printf(m, " is_signed: %u\n", field->is_signed); in hist_field_debug_show()
5625 struct hist_field *field; in field_var_debug_show() local
5630 field = field_var->var; in field_var_debug_show()
5634 hist_field_debug_show_flags(m, field->flags); in field_var_debug_show()
5635 seq_printf(m, " var.name: %s\n", field->var.name); in field_var_debug_show()
5637 field->var.idx); in field_var_debug_show()
5639 field = field_var->val; in field_var_debug_show()
5642 if (field->field) in field_var_debug_show()
5644 field->field->name); in field_var_debug_show()
5650 seq_printf(m, " type: %s\n", field->type); in field_var_debug_show()
5651 seq_printf(m, " size: %u\n", field->size); in field_var_debug_show()
5652 seq_printf(m, " is_signed: %u\n", field->is_signed); in field_var_debug_show()
5867 struct hist_field *field; in event_hist_trigger_print() local
5879 field = hist_data->fields[i]; in event_hist_trigger_print()
5884 if (field->flags & HIST_FIELD_FL_STACKTRACE) in event_hist_trigger_print()
5887 hist_field_print(m, field); in event_hist_trigger_print()
5893 field = hist_data->fields[i]; in event_hist_trigger_print()
5894 if (field->flags & HIST_FIELD_FL_VAR) { in event_hist_trigger_print()
5903 hist_field_print(m, field); in event_hist_trigger_print()
5913 field = hist_data->fields[i]; in event_hist_trigger_print()
5915 if (field->flags & HIST_FIELD_FL_VAR) { in event_hist_trigger_print()
5918 hist_field_print(m, field); in event_hist_trigger_print()
6081 static bool compatible_field(struct ftrace_event_field *field, in compatible_field() argument
6084 if (field == test_field) in compatible_field()
6086 if (field == NULL || test_field == NULL) in compatible_field()
6088 if (strcmp(field->name, test_field->name) != 0) in compatible_field()
6090 if (strcmp(field->type, test_field->type) != 0) in compatible_field()
6092 if (field->size != test_field->size) in compatible_field()
6094 if (field->is_signed != test_field->is_signed) in compatible_field()
6137 if (!compatible_field(key_field->field, key_field_test->field)) in hist_trigger_match()