Lines Matching refs:field
880 free(arg->field.name); in free_arg()
883 free_arg(arg->flags.field); in free_arg()
888 free_arg(arg->symbol.field); in free_arg()
893 free_arg(arg->hex.field); in free_arg()
897 free_arg(arg->int_array.field); in free_arg()
1373 static int field_is_string(struct tep_format_field *field) in field_is_string() argument
1375 if ((field->flags & TEP_FIELD_IS_ARRAY) && in field_is_string()
1376 (strstr(field->type, "char") || strstr(field->type, "u8") || in field_is_string()
1377 strstr(field->type, "s8"))) in field_is_string()
1383 static int field_is_dynamic(struct tep_format_field *field) in field_is_dynamic() argument
1385 if (strncmp(field->type, "__data_loc", 10) == 0) in field_is_dynamic()
1391 static int field_is_long(struct tep_format_field *field) in field_is_long() argument
1394 if (strstr(field->type, "long")) in field_is_long()
1443 struct tep_format_field *field = NULL; in event_read_fields() local
1486 field = calloc(1, sizeof(*field)); in event_read_fields()
1487 if (!field) in event_read_fields()
1490 field->event = event; in event_read_fields()
1505 field->flags |= TEP_FIELD_IS_POINTER; in event_read_fields()
1507 if (field->type) { in event_read_fields()
1508 ret = append(&field->type, delim, last_token); in event_read_fields()
1513 field->type = last_token; in event_read_fields()
1526 ret = append(&field->type, " ", last_token); in event_read_fields()
1527 ret |= append(&field->type, "", "("); in event_read_fields()
1540 ret = append(&field->type, "", token); in event_read_fields()
1543 ret = append(&field->type, delim, token); in event_read_fields()
1556 if (!field->type) { in event_read_fields()
1560 field->name = field->alias = last_token; in event_read_fields()
1569 field->flags |= TEP_FIELD_IS_ARRAY; in event_read_fields()
1574 field->arraylen = strtoul(token, NULL, 0); in event_read_fields()
1576 field->arraylen = 0; in event_read_fields()
1595 field->arraylen = strtoul(token, NULL, 0); in event_read_fields()
1621 ret = append(&field->type, " ", field->name); in event_read_fields()
1626 ret = append(&field->type, "", brackets); in event_read_fields()
1628 size_dynamic = type_size(field->name); in event_read_fields()
1629 free_token(field->name); in event_read_fields()
1630 field->name = field->alias = token; in event_read_fields()
1633 ret = append(&field->type, "", brackets); in event_read_fields()
1642 if (field_is_string(field)) in event_read_fields()
1643 field->flags |= TEP_FIELD_IS_STRING; in event_read_fields()
1644 if (field_is_dynamic(field)) in event_read_fields()
1645 field->flags |= TEP_FIELD_IS_DYNAMIC; in event_read_fields()
1646 if (field_is_long(field)) in event_read_fields()
1647 field->flags |= TEP_FIELD_IS_LONG; in event_read_fields()
1661 field->offset = strtoul(token, NULL, 0); in event_read_fields()
1675 field->size = strtoul(token, NULL, 0); in event_read_fields()
1696 field->flags |= TEP_FIELD_IS_SIGNED; in event_read_fields()
1708 if (field->flags & TEP_FIELD_IS_ARRAY) { in event_read_fields()
1709 if (field->arraylen) in event_read_fields()
1710 field->elementsize = field->size / field->arraylen; in event_read_fields()
1711 else if (field->flags & TEP_FIELD_IS_DYNAMIC) in event_read_fields()
1712 field->elementsize = size_dynamic; in event_read_fields()
1713 else if (field->flags & TEP_FIELD_IS_STRING) in event_read_fields()
1714 field->elementsize = 1; in event_read_fields()
1715 else if (field->flags & TEP_FIELD_IS_LONG) in event_read_fields()
1716 field->elementsize = event->tep ? in event_read_fields()
1720 field->elementsize = field->size; in event_read_fields()
1722 *fields = field; in event_read_fields()
1723 fields = &field->next; in event_read_fields()
1732 if (field) { in event_read_fields()
1733 free(field->type); in event_read_fields()
1734 free(field->name); in event_read_fields()
1735 free(field); in event_read_fields()
2170 char *field; in process_entry() local
2178 field = token; in process_entry()
2181 arg->field.name = field; in process_entry()
2184 arg->field.field = tep_find_any_field(event, arg->field.name); in process_entry()
2185 arg->field.field->flags |= TEP_FIELD_IS_FLAG; in process_entry()
2188 arg->field.field = tep_find_any_field(event, arg->field.name); in process_entry()
2189 arg->field.field->flags |= TEP_FIELD_IS_SYMBOLIC; in process_entry()
2208 struct tep_print_arg *field; in alloc_and_process_delim() local
2213 field = alloc_arg(); in alloc_and_process_delim()
2214 if (!field) { in alloc_and_process_delim()
2220 type = process_arg(event, field, &token); in alloc_and_process_delim()
2225 free_arg(field); in alloc_and_process_delim()
2229 *print_arg = field; in alloc_and_process_delim()
2544 struct tep_print_flag_sym *field; in process_fields() local
2570 field = calloc(1, sizeof(*field)); in process_fields()
2571 if (!field) in process_fields()
2577 field->value = strdup(value); in process_fields()
2578 if (field->value == NULL) in process_fields()
2594 field->str = strdup(value); in process_fields()
2595 if (field->str == NULL) in process_fields()
2600 *list = field; in process_fields()
2601 list = &field->next; in process_fields()
2611 free_flag_sym(field); in process_fields()
2623 struct tep_print_arg *field; in process_flags() local
2630 field = alloc_arg(); in process_flags()
2631 if (!field) { in process_flags()
2636 type = process_field_arg(event, field, &token); in process_flags()
2640 type = process_op(event, field, &token); in process_flags()
2646 arg->flags.field = field; in process_flags()
2666 free_arg(field); in process_flags()
2676 struct tep_print_arg *field; in process_symbols() local
2683 field = alloc_arg(); in process_symbols()
2684 if (!field) { in process_symbols()
2689 type = process_field_arg(event, field, &token); in process_symbols()
2694 arg->symbol.field = field; in process_symbols()
2705 free_arg(field); in process_symbols()
2719 if (alloc_and_process_delim(event, ",", &arg->hex.field)) in process_hex_common()
2728 free_arg(arg->hex.field); in process_hex_common()
2729 arg->hex.field = NULL; in process_hex_common()
2754 if (alloc_and_process_delim(event, ",", &arg->int_array.field)) in process_int_array()
2769 free_arg(arg->int_array.field); in process_int_array()
2770 arg->int_array.field = NULL; in process_int_array()
2779 struct tep_format_field *field; in process_dynamic_array() local
2797 field = tep_find_field(event, token); in process_dynamic_array()
2798 if (!field) in process_dynamic_array()
2801 arg->dynarray.field = field; in process_dynamic_array()
2844 struct tep_format_field *field; in process_dynamic_array_len() local
2854 field = tep_find_field(event, token); in process_dynamic_array_len()
2855 if (!field) in process_dynamic_array_len()
2858 arg->dynarray.field = field; in process_dynamic_array_len()
3450 int tep_read_number_field(struct tep_format_field *field, const void *data, in tep_read_number_field() argument
3453 if (!field) in tep_read_number_field()
3455 switch (field->size) { in tep_read_number_field()
3460 *value = tep_read_number(field->event->tep, in tep_read_number_field()
3461 data + field->offset, field->size); in tep_read_number_field()
3472 struct tep_format_field *field; in get_common_info() local
3484 field = tep_find_common_field(event, type); in get_common_info()
3485 if (!field) in get_common_info()
3488 *offset = field->offset; in get_common_info()
3489 *size = field->size; in get_common_info()
3636 if (!arg->field.field) { in eval_num_arg()
3637 arg->field.field = tep_find_any_field(event, arg->field.name); in eval_num_arg()
3638 if (!arg->field.field) in eval_num_arg()
3643 val = tep_read_number(tep, data + arg->field.field->offset, in eval_num_arg()
3644 arg->field.field->size); in eval_num_arg()
3688 data + larg->dynarray.field->offset, in eval_num_arg()
3689 larg->dynarray.field->size); in eval_num_arg()
3690 if (larg->dynarray.field->elementsize) in eval_num_arg()
3691 field_size = larg->dynarray.field->elementsize; in eval_num_arg()
3701 if (!larg->field.field) { in eval_num_arg()
3702 larg->field.field = in eval_num_arg()
3703 tep_find_any_field(event, larg->field.name); in eval_num_arg()
3704 if (!larg->field.field) { in eval_num_arg()
3709 field_size = larg->field.field->elementsize; in eval_num_arg()
3710 offset = larg->field.field->offset + in eval_num_arg()
3711 right * larg->field.field->elementsize; in eval_num_arg()
3818 data + arg->dynarray.field->offset, in eval_num_arg()
3819 arg->dynarray.field->size); in eval_num_arg()
3830 data + arg->dynarray.field->offset, in eval_num_arg()
3831 arg->dynarray.field->size); in eval_num_arg()
3851 __func__, arg->field.name); in eval_num_arg()
3964 struct tep_format_field *field; in print_str_arg() local
3981 field = arg->field.field; in print_str_arg()
3982 if (!field) { in print_str_arg()
3983 field = tep_find_any_field(event, arg->field.name); in print_str_arg()
3984 if (!field) { in print_str_arg()
3985 str = arg->field.name; in print_str_arg()
3988 arg->field.field = field; in print_str_arg()
3991 len = field->size ? : size - field->offset; in print_str_arg()
3998 if (!(field->flags & TEP_FIELD_IS_ARRAY) && in print_str_arg()
3999 field->size == tep->long_size) { in print_str_arg()
4015 *(unsigned long long *)(data + field->offset) : in print_str_arg()
4016 (unsigned long long)*(unsigned int *)(data + field->offset); in print_str_arg()
4032 memcpy(str, data + field->offset, len); in print_str_arg()
4038 val = eval_num_arg(data, size, event, arg->flags.field); in print_str_arg()
4061 val = eval_num_arg(data, size, event, arg->symbol.field); in print_str_arg()
4074 if (arg->hex.field->type == TEP_PRINT_DYNAMIC_ARRAY) { in print_str_arg()
4077 data + arg->hex.field->dynarray.field->offset, in print_str_arg()
4078 arg->hex.field->dynarray.field->size); in print_str_arg()
4081 field = arg->hex.field->field.field; in print_str_arg()
4082 if (!field) { in print_str_arg()
4083 str = arg->hex.field->field.name; in print_str_arg()
4084 field = tep_find_any_field(event, str); in print_str_arg()
4085 if (!field) in print_str_arg()
4087 arg->hex.field->field.field = field; in print_str_arg()
4089 hex = data + field->offset; in print_str_arg()
4103 if (arg->int_array.field->type == TEP_PRINT_DYNAMIC_ARRAY) { in print_str_arg()
4105 struct tep_format_field *field = in print_str_arg() local
4106 arg->int_array.field->dynarray.field; in print_str_arg()
4108 data + field->offset, in print_str_arg()
4109 field->size); in print_str_arg()
4112 field = arg->int_array.field->field.field; in print_str_arg()
4113 if (!field) { in print_str_arg()
4114 str = arg->int_array.field->field.name; in print_str_arg()
4115 field = tep_find_any_field(event, str); in print_str_arg()
4116 if (!field) in print_str_arg()
4118 arg->int_array.field->field.field = field; in print_str_arg()
4120 num = data + field->offset; in print_str_arg()
4209 __func__, arg->field.name); in print_str_arg()
4312 struct tep_format_field *field, *ip_field; in make_bprint_args() local
4319 field = tep->bprint_buf_field; in make_bprint_args()
4322 if (!field) { in make_bprint_args()
4323 field = tep_find_field(event, "buf"); in make_bprint_args()
4324 if (!field) { in make_bprint_args()
4333 tep->bprint_buf_field = field; in make_bprint_args()
4358 for (ptr = fmt + 5, bptr = data + field->offset; in make_bprint_args()
4501 struct tep_format_field *field; in get_bprint_format() local
4505 field = tep->bprint_fmt_field; in get_bprint_format()
4507 if (!field) { in get_bprint_format()
4508 field = tep_find_field(event, "fmt"); in get_bprint_format()
4509 if (!field) { in get_bprint_format()
4513 tep->bprint_fmt_field = field; in get_bprint_format()
4516 addr = tep_read_number(tep, data + field->offset, field->size); in get_bprint_format()
4550 if (!arg->field.field) { in print_mac_arg()
4551 arg->field.field = in print_mac_arg()
4552 tep_find_any_field(event, arg->field.name); in print_mac_arg()
4553 if (!arg->field.field) { in print_mac_arg()
4555 __func__, arg->field.name); in print_mac_arg()
4559 if (arg->field.field->size != 6) { in print_mac_arg()
4563 buf = data + arg->field.field->offset; in print_mac_arg()
4700 if (!arg->field.field) { in print_ipv4_arg()
4701 arg->field.field = in print_ipv4_arg()
4702 tep_find_any_field(event, arg->field.name); in print_ipv4_arg()
4703 if (!arg->field.field) { in print_ipv4_arg()
4705 __func__, arg->field.name); in print_ipv4_arg()
4710 buf = data + arg->field.field->offset; in print_ipv4_arg()
4712 if (arg->field.field->size != 4) { in print_ipv4_arg()
4746 if (!arg->field.field) { in print_ipv6_arg()
4747 arg->field.field = in print_ipv6_arg()
4748 tep_find_any_field(event, arg->field.name); in print_ipv6_arg()
4749 if (!arg->field.field) { in print_ipv6_arg()
4751 __func__, arg->field.name); in print_ipv6_arg()
4756 buf = data + arg->field.field->offset; in print_ipv6_arg()
4758 if (arg->field.field->size != 16) { in print_ipv6_arg()
4804 if (!arg->field.field) { in print_ipsa_arg()
4805 arg->field.field = in print_ipsa_arg()
4806 tep_find_any_field(event, arg->field.name); in print_ipsa_arg()
4807 if (!arg->field.field) { in print_ipsa_arg()
4809 __func__, arg->field.name); in print_ipsa_arg()
4814 sa = (struct sockaddr_storage *) (data + arg->field.field->offset); in print_ipsa_arg()
4819 if (arg->field.field->size < sizeof(struct sockaddr_in)) { in print_ipsa_arg()
4832 if (arg->field.field->size < sizeof(struct sockaddr_in6)) { in print_ipsa_arg()
4896 struct tep_format_field *field) in tep_print_field() argument
4900 struct tep_handle *tep = field->event->tep; in tep_print_field()
4902 if (field->flags & TEP_FIELD_IS_ARRAY) { in tep_print_field()
4903 offset = field->offset; in tep_print_field()
4904 len = field->size; in tep_print_field()
4905 if (field->flags & TEP_FIELD_IS_DYNAMIC) { in tep_print_field()
4911 if (field->flags & TEP_FIELD_IS_STRING && in tep_print_field()
4923 field->flags &= ~TEP_FIELD_IS_STRING; in tep_print_field()
4926 val = tep_read_number(tep, data + field->offset, in tep_print_field()
4927 field->size); in tep_print_field()
4928 if (field->flags & TEP_FIELD_IS_POINTER) { in tep_print_field()
4930 } else if (field->flags & TEP_FIELD_IS_SIGNED) { in tep_print_field()
4931 switch (field->size) { in tep_print_field()
4937 if (field->flags & TEP_FIELD_IS_LONG) in tep_print_field()
4952 if (field->flags & TEP_FIELD_IS_LONG) in tep_print_field()
4963 struct tep_format_field *field; in tep_print_fields() local
4965 field = event->format.fields; in tep_print_fields()
4966 while (field) { in tep_print_fields()
4967 trace_seq_printf(s, " %s=", field->name); in tep_print_fields()
4968 tep_print_field(s, data, field); in tep_print_fields()
4969 field = field->next; in tep_print_fields()
5885 struct tep_format_field *field; in get_event_fields() local
5892 for (field = list; field; field = field->next) { in get_event_fields()
5893 fields[i++] = field; in get_event_fields()
5939 static void print_fields(struct trace_seq *s, struct tep_print_flag_sym *field) in print_fields() argument
5941 trace_seq_printf(s, "{ %s, %s }", field->value, field->str); in print_fields()
5942 if (field->next) { in print_fields()
5944 print_fields(s, field->next); in print_fields()
5962 printf("REC->%s", args->field.name); in print_args()
5966 print_args(args->flags.field); in print_args()
5976 print_args(args->symbol.field); in print_args()
5986 print_args(args->hex.field); in print_args()
5993 print_args(args->hex.field); in print_args()
6000 print_args(args->int_array.field); in print_args()
6039 static void parse_header_field(const char *field, in parse_header_field() argument
6064 if (read_expected(TEP_EVENT_ITEM, field) < 0) in parse_header_field()
6069 if (strcmp(token, field) != 0) in parse_header_field()
6306 struct tep_format_field *field; in __tep_parse_format() local
6311 for (field = event->format.fields; field; field = field->next) { in __tep_parse_format()
6318 arg->field.name = strdup(field->name); in __tep_parse_format()
6319 if (!arg->field.name) { in __tep_parse_format()
6324 arg->field.field = field; in __tep_parse_format()
6417 int get_field_val(struct trace_seq *s, struct tep_format_field *field, in get_field_val() argument
6421 if (!field) { in get_field_val()
6427 if (tep_read_number_field(field, record->data, val)) { in get_field_val()
6454 struct tep_format_field *field; in tep_get_field_raw() local
6462 field = tep_find_field(event, name); in tep_get_field_raw()
6464 if (!field) { in tep_get_field_raw()
6474 offset = field->offset; in tep_get_field_raw()
6475 if (field->flags & TEP_FIELD_IS_DYNAMIC) { in tep_get_field_raw()
6477 data + offset, field->size); in tep_get_field_raw()
6481 *len = field->size; in tep_get_field_raw()
6501 struct tep_format_field *field; in tep_get_field_val() local
6506 field = tep_find_field(event, name); in tep_get_field_val()
6508 return get_field_val(s, field, name, record, val, err); in tep_get_field_val()
6526 struct tep_format_field *field; in tep_get_common_field_val() local
6531 field = tep_find_common_field(event, name); in tep_get_common_field_val()
6533 return get_field_val(s, field, name, record, val, err); in tep_get_common_field_val()
6551 struct tep_format_field *field; in tep_get_any_field_val() local
6556 field = tep_find_any_field(event, name); in tep_get_any_field_val()
6558 return get_field_val(s, field, name, record, val, err); in tep_get_any_field_val()
6577 struct tep_format_field *field = tep_find_field(event, name); in tep_print_num_field() local
6580 if (!field) in tep_print_num_field()
6583 if (tep_read_number_field(field, record->data, &val)) in tep_print_num_field()
6610 struct tep_format_field *field = tep_find_field(event, name); in tep_print_func_field() local
6616 if (!field) in tep_print_func_field()
6619 if (tep_read_number_field(field, record->data, &val)) in tep_print_func_field()
6962 void tep_free_format_field(struct tep_format_field *field) in tep_free_format_field() argument
6964 free(field->type); in tep_free_format_field()
6965 if (field->alias != field->name) in tep_free_format_field()
6966 free(field->alias); in tep_free_format_field()
6967 free(field->name); in tep_free_format_field()
6968 free(field); in tep_free_format_field()
6971 static void free_format_fields(struct tep_format_field *field) in free_format_fields() argument
6975 while (field) { in free_format_fields()
6976 next = field->next; in free_format_fields()
6977 tep_free_format_field(field); in free_format_fields()
6978 field = next; in free_format_fields()