Lines Matching refs:field

87 typedef u64 (*hist_field_fn_t) (struct hist_field *field,
159 struct ftrace_event_field *field; member
210 static u64 hist_field_const(struct hist_field *field, in hist_field_const() argument
216 return field->constant; in hist_field_const()
219 static u64 hist_field_counter(struct hist_field *field, in hist_field_counter() argument
234 char *addr = (char *)(event + hist_field->field->offset); in hist_field_string()
245 u32 str_item = *(u32 *)(event + hist_field->field->offset); in hist_field_dynstring()
258 u32 *item = event + hist_field->field->offset; in hist_field_reldynstring()
272 char **addr = (char **)(event + hist_field->field->offset); in hist_field_pstring()
462 type *addr = (type *)(event + hist_field->field->offset); \
999 struct hist_field *field; in check_var_refs() local
1004 field = hist_data->fields[i]; in check_var_refs()
1005 if (field && field->flags & HIST_FIELD_FL_VAR) { in check_var_refs()
1006 if (find_any_var_ref(hist_data, field->var.idx)) { in check_var_refs()
1333 static const char *hist_field_name(struct hist_field *field, in hist_field_name() argument
1338 if (WARN_ON_ONCE(!field)) in hist_field_name()
1344 if (field->field) in hist_field_name()
1345 field_name = field->field->name; in hist_field_name()
1346 else if (field->flags & HIST_FIELD_FL_LOG2 || in hist_field_name()
1347 field->flags & HIST_FIELD_FL_ALIAS || in hist_field_name()
1348 field->flags & HIST_FIELD_FL_BUCKET) in hist_field_name()
1349 field_name = hist_field_name(field->operands[0], ++level); in hist_field_name()
1350 else if (field->flags & HIST_FIELD_FL_CPU) in hist_field_name()
1352 else if (field->flags & HIST_FIELD_FL_COMM) in hist_field_name()
1354 else if (field->flags & HIST_FIELD_FL_EXPR || in hist_field_name()
1355 field->flags & HIST_FIELD_FL_VAR_REF) { in hist_field_name()
1356 if (field->system) { in hist_field_name()
1359 strcat(full_name, field->system); in hist_field_name()
1361 strcat(full_name, field->event_name); in hist_field_name()
1363 strcat(full_name, field->name); in hist_field_name()
1366 field_name = field->name; in hist_field_name()
1367 } else if (field->flags & HIST_FIELD_FL_TIMESTAMP) in hist_field_name()
1369 else if (field->flags & HIST_FIELD_FL_STACKTRACE) { in hist_field_name()
1371 } else if (field->flags & HIST_FIELD_FL_HITCOUNT) in hist_field_name()
1735 static void expr_field_str(struct hist_field *field, char *expr) in expr_field_str() argument
1737 if (field->flags & HIST_FIELD_FL_VAR_REF) in expr_field_str()
1739 else if (field->flags & HIST_FIELD_FL_CONST) { in expr_field_str()
1742 snprintf(str, HIST_CONST_DIGITS_MAX, "%llu", field->constant); in expr_field_str()
1746 strcat(expr, hist_field_name(field, 0)); in expr_field_str()
1748 if (field->flags && !(field->flags & HIST_FIELD_FL_VAR_REF)) { in expr_field_str()
1749 const char *flags_str = get_hist_field_flags(field); in expr_field_str()
1758 static char *expr_str(struct hist_field *field, unsigned int level) in expr_str() argument
1769 if (!field->operands[0]) { in expr_str()
1770 expr_field_str(field, expr); in expr_str()
1774 if (field->operator == FIELD_OP_UNARY_MINUS) { in expr_str()
1778 subexpr = expr_str(field->operands[0], ++level); in expr_str()
1791 expr_field_str(field->operands[0], expr); in expr_str()
1793 switch (field->operator) { in expr_str()
1811 expr_field_str(field->operands[1], expr); in expr_str()
1950 struct ftrace_event_field *field, in create_hist_field() argument
1956 if (field && is_function_field(field)) in create_hist_field()
1992 if (field) in create_hist_field()
2007 hist_field->operands[0] = create_hist_field(hist_data, field, fl, NULL); in create_hist_field()
2038 if (WARN_ON_ONCE(!field)) in create_hist_field()
2042 if (is_string_field(field) && in create_hist_field()
2043 (field->filter_type != FILTER_PTR_STRING)) { in create_hist_field()
2047 hist_field->type = kstrdup_const(field->type, GFP_KERNEL); in create_hist_field()
2051 if (field->filter_type == FILTER_STATIC_STRING) { in create_hist_field()
2053 hist_field->size = field->size; in create_hist_field()
2054 } else if (field->filter_type == FILTER_DYN_STRING) { in create_hist_field()
2056 } else if (field->filter_type == FILTER_RDYN_STRING) in create_hist_field()
2061 hist_field->size = field->size; in create_hist_field()
2062 hist_field->is_signed = field->is_signed; in create_hist_field()
2063 hist_field->type = kstrdup_const(field->type, GFP_KERNEL); in create_hist_field()
2067 hist_field->fn_num = select_value_fn(field->size, in create_hist_field()
2068 field->is_signed); in create_hist_field()
2075 hist_field->field = field; in create_hist_field()
2243 char *name, *field; in field_name_from_var() local
2250 field = hist_data->attrs->var_defs.expr[i]; in field_name_from_var()
2251 if (contains_operator(field, NULL) || is_var_ref(field)) in field_name_from_var()
2253 return field; in field_name_from_var()
2314 struct ftrace_event_field *field = NULL; in parse_field() local
2370 field = ERR_PTR(-EINVAL); in parse_field()
2389 field = trace_find_event_field(file->event_call, field_name); in parse_field()
2390 if (!field || !field->size) { in parse_field()
2398 if (field && field->filter_type == FILTER_CPU) { in parse_field()
2400 } else if (field && field->filter_type == FILTER_STACKTRACE) { in parse_field()
2402 } else if (field && field->filter_type == FILTER_COMM) { in parse_field()
2407 field = ERR_PTR(-EINVAL); in parse_field()
2415 return field; in parse_field()
2447 struct hist_field *field = NULL; in parse_const() local
2456 field = create_hist_field(hist_data, NULL, *flags, var_name); in parse_const()
2457 if (!field) in parse_const()
2460 field->constant = constant; in parse_const()
2462 return field; in parse_const()
2470 struct ftrace_event_field *field = NULL; in parse_atom() local
2519 field = parse_field(hist_data, file, str, flags, &buckets); in parse_atom()
2520 if (IS_ERR(field)) { in parse_atom()
2521 ret = PTR_ERR(field); in parse_atom()
2525 hist_field = create_hist_field(hist_data, field, *flags, var_name); in parse_atom()
3054 strcat(cmd, key_field->field->name); in create_field_var_hist()
3889 struct synth_field *field; in check_synth_field() local
3894 field = event->fields[field_pos]; in check_synth_field()
3901 if (strstr(hist_field->type, "char[") && field->is_string in check_synth_field()
3902 && field->is_dynamic) in check_synth_field()
3905 if (strstr(hist_field->type, "long[") && field->is_stack) in check_synth_field()
3908 if (strcmp(field->type, hist_field->type) != 0) { in check_synth_field()
3909 if (field->size != hist_field->size || in check_synth_field()
3910 (!field->is_string && field->is_signed != hist_field->is_signed)) in check_synth_field()
4326 u32 str_item = *(u32 *)(event + hist_field->field->offset); in hist_field_stack()
5070 struct ftrace_event_field *field; in create_tracing_map_fields() local
5079 field = hist_field->field; in create_tracing_map_fields()
5083 else if (!field || hist_field->flags & HIST_FIELD_FL_CPU) in create_tracing_map_fields()
5086 else if (is_string_field(field)) in create_tracing_map_fields()
5089 cmp_fn = tracing_map_cmp_num(field->size, in create_tracing_map_fields()
5090 field->is_signed); in create_tracing_map_fields()
5245 struct ftrace_event_field *field; in add_to_key() local
5247 field = key_field->field; in add_to_key()
5248 if (field->filter_type == FILTER_DYN_STRING || in add_to_key()
5249 field->filter_type == FILTER_RDYN_STRING) in add_to_key()
5250 size = *(u32 *)(rec + field->offset) >> 16; in add_to_key()
5251 else if (field->filter_type == FILTER_STATIC_STRING) in add_to_key()
5252 size = field->size; in add_to_key()
5386 if (key_field->field) { in event_hist_trigger()
5506 if (key_field->field) in hist_trigger_print_key()
5507 seq_printf(m, "%s.stacktrace", key_field->field->name); in hist_trigger_print_key()
5869 struct hist_field *field, unsigned long flags) in hist_field_debug_show() argument
5871 if ((field->flags & flags) != flags) { in hist_field_debug_show()
5876 hist_field_debug_show_flags(m, field->flags); in hist_field_debug_show()
5877 if (field->field) in hist_field_debug_show()
5879 field->field->name); in hist_field_debug_show()
5881 if (field->flags & HIST_FIELD_FL_VAR) { in hist_field_debug_show()
5882 seq_printf(m, " var.name: %s\n", field->var.name); in hist_field_debug_show()
5884 field->var.idx); in hist_field_debug_show()
5887 if (field->flags & HIST_FIELD_FL_CONST) in hist_field_debug_show()
5888 seq_printf(m, " constant: %llu\n", field->constant); in hist_field_debug_show()
5890 if (field->flags & HIST_FIELD_FL_ALIAS) in hist_field_debug_show()
5892 field->var_ref_idx); in hist_field_debug_show()
5894 if (field->flags & HIST_FIELD_FL_VAR_REF) { in hist_field_debug_show()
5895 seq_printf(m, " name: %s\n", field->name); in hist_field_debug_show()
5897 field->var.idx); in hist_field_debug_show()
5898 seq_printf(m, " var.hist_data: %p\n", field->var.hist_data); in hist_field_debug_show()
5900 field->var_ref_idx); in hist_field_debug_show()
5901 if (field->system) in hist_field_debug_show()
5902 seq_printf(m, " system: %s\n", field->system); in hist_field_debug_show()
5903 if (field->event_name) in hist_field_debug_show()
5904 seq_printf(m, " event_name: %s\n", field->event_name); in hist_field_debug_show()
5907 seq_printf(m, " type: %s\n", field->type); in hist_field_debug_show()
5908 seq_printf(m, " size: %u\n", field->size); in hist_field_debug_show()
5909 seq_printf(m, " is_signed: %u\n", field->is_signed); in hist_field_debug_show()
5919 struct hist_field *field; in field_var_debug_show() local
5924 field = field_var->var; in field_var_debug_show()
5928 hist_field_debug_show_flags(m, field->flags); in field_var_debug_show()
5929 seq_printf(m, " var.name: %s\n", field->var.name); in field_var_debug_show()
5931 field->var.idx); in field_var_debug_show()
5933 field = field_var->val; in field_var_debug_show()
5936 if (field->field) in field_var_debug_show()
5938 field->field->name); in field_var_debug_show()
5944 seq_printf(m, " type: %s\n", field->type); in field_var_debug_show()
5945 seq_printf(m, " size: %u\n", field->size); in field_var_debug_show()
5946 seq_printf(m, " is_signed: %u\n", field->is_signed); in field_var_debug_show()
6161 struct hist_field *field; in event_hist_trigger_print() local
6174 field = hist_data->fields[i]; in event_hist_trigger_print()
6179 if (field->flags & HIST_FIELD_FL_STACKTRACE) { in event_hist_trigger_print()
6180 if (field->field) in event_hist_trigger_print()
6181 seq_printf(m, "%s.stacktrace", field->field->name); in event_hist_trigger_print()
6185 hist_field_print(m, field); in event_hist_trigger_print()
6191 field = hist_data->fields[i]; in event_hist_trigger_print()
6192 if (field->flags & HIST_FIELD_FL_VAR) { in event_hist_trigger_print()
6204 hist_field_print(m, field); in event_hist_trigger_print()
6215 field = hist_data->fields[i]; in event_hist_trigger_print()
6217 if (field->flags & HIST_FIELD_FL_VAR) { in event_hist_trigger_print()
6220 hist_field_print(m, field); in event_hist_trigger_print()
6387 static bool compatible_field(struct ftrace_event_field *field, in compatible_field() argument
6390 if (field == test_field) in compatible_field()
6392 if (field == NULL || test_field == NULL) in compatible_field()
6394 if (strcmp(field->name, test_field->name) != 0) in compatible_field()
6396 if (strcmp(field->type, test_field->type) != 0) in compatible_field()
6398 if (field->size != test_field->size) in compatible_field()
6400 if (field->is_signed != test_field->is_signed) in compatible_field()
6443 if (!compatible_field(key_field->field, key_field_test->field)) in hist_trigger_match()