From: Mathieu Desnoyers Date: Wed, 7 Apr 2021 17:40:46 +0000 (-0400) Subject: Cleanup: Rename abstract types to lttng_kernel_type X-Git-Tag: v2.13.0-rc1~23 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=12bb2edb6ed3e96d3299a979e49b828f2b17dcb2;p=lttng-modules.git Cleanup: Rename abstract types to lttng_kernel_type Signed-off-by: Mathieu Desnoyers Change-Id: Iac1810c9d9830d80109fe72b1965b7b7cf663207 --- diff --git a/include/instrumentation/events/net.h b/include/instrumentation/events/net.h index 6fbe86f8..d0227423 100644 --- a/include/instrumentation/events/net.h +++ b/include/instrumentation/events/net.h @@ -138,7 +138,7 @@ static struct lttng_event_field transport_fields[] = { [0] = { .name = "unknown", .type = { - .atype = atype_struct_nestable, + .type = lttng_kernel_type_struct_nestable, .u.struct_nestable.nr_fields = ARRAY_SIZE(emptyfields), .u.struct_nestable.fields = emptyfields, .u.struct_nestable.alignment = 0, @@ -148,7 +148,7 @@ static struct lttng_event_field transport_fields[] = { [1] = { .name = "tcp", .type = { - .atype = atype_struct_nestable, + .type = lttng_kernel_type_struct_nestable, .u.struct_nestable.nr_fields = ARRAY_SIZE(tcpfields), .u.struct_nestable.fields = tcpfields, .u.struct_nestable.alignment = 0, @@ -158,7 +158,7 @@ static struct lttng_event_field transport_fields[] = { [2] = { .name = "udp", .type = { - .atype = atype_struct_nestable, + .type = lttng_kernel_type_struct_nestable, .u.struct_nestable.nr_fields = ARRAY_SIZE(udpfields), .u.struct_nestable.fields = udpfields, .u.struct_nestable.alignment = 0, @@ -168,7 +168,7 @@ static struct lttng_event_field transport_fields[] = { [3] = { .name = "icmp", .type = { - .atype = atype_struct_nestable, + .type = lttng_kernel_type_struct_nestable, .u.struct_nestable.nr_fields = ARRAY_SIZE(icmpfields), .u.struct_nestable.fields = icmpfields, .u.struct_nestable.alignment = 0, @@ -349,7 +349,7 @@ static struct lttng_event_field ipv4fields[] = { [7] = { .name = "protocol", .type = { - .atype = atype_enum_nestable, + .type = lttng_kernel_type_enum_nestable, .u.enum_nestable.desc = &proto_transport_header_type, .u.enum_nestable.container_type = @@ -366,7 +366,7 @@ static struct lttng_event_field ipv4fields[] = { [9] = { .name = "saddr", .type = { - .atype = atype_array_nestable, + .type = lttng_kernel_type_array_nestable, .u.array_nestable.elem_type = __LTTNG_COMPOUND_LITERAL(struct lttng_type, __type_integer(uint8_t, 0, 0, 0, @@ -378,7 +378,7 @@ static struct lttng_event_field ipv4fields[] = { [10] = { .name = "daddr", .type = { - .atype = atype_array_nestable, + .type = lttng_kernel_type_array_nestable, .u.array_nestable.elem_type = __LTTNG_COMPOUND_LITERAL(struct lttng_type, __type_integer(uint8_t, 0, 0, 0, @@ -390,7 +390,7 @@ static struct lttng_event_field ipv4fields[] = { [11] = { .name = "transport_header_type", .type = { - .atype = atype_enum_nestable, + .type = lttng_kernel_type_enum_nestable, .u.enum_nestable.desc = &transport_header_type, .u.enum_nestable.container_type = __LTTNG_COMPOUND_LITERAL(struct lttng_type, @@ -401,7 +401,7 @@ static struct lttng_event_field ipv4fields[] = { [12] = { .name = "transport_header", .type = { - .atype = atype_variant_nestable, + .type = lttng_kernel_type_variant_nestable, .u.variant_nestable.tag_name = "transport_header_type", .u.variant_nestable.choices = transport_fields, .u.variant_nestable.nr_choices = ARRAY_SIZE(transport_fields), @@ -424,7 +424,7 @@ static struct lttng_event_field ipv6fields[] = { [2] = { .name = "flow_lbl", .type = { - .atype = atype_array_nestable, + .type = lttng_kernel_type_array_nestable, .u.array_nestable.elem_type = __LTTNG_COMPOUND_LITERAL(struct lttng_type, __type_integer(uint8_t, 0, 0, 0, @@ -441,7 +441,7 @@ static struct lttng_event_field ipv6fields[] = { [4] = { .name = "nexthdr", .type = { - .atype = atype_enum_nestable, + .type = lttng_kernel_type_enum_nestable, .u.enum_nestable.desc = &proto_transport_header_type, .u.enum_nestable.container_type = @@ -458,7 +458,7 @@ static struct lttng_event_field ipv6fields[] = { [6] = { .name = "saddr", .type = { - .atype = atype_array_nestable, + .type = lttng_kernel_type_array_nestable, .u.array_nestable.elem_type = __LTTNG_COMPOUND_LITERAL(struct lttng_type, __type_integer(uint16_t, 0, 0, 0, @@ -470,7 +470,7 @@ static struct lttng_event_field ipv6fields[] = { [7] = { .name = "daddr", .type = { - .atype = atype_array_nestable, + .type = lttng_kernel_type_array_nestable, .u.array_nestable.elem_type = __LTTNG_COMPOUND_LITERAL(struct lttng_type, __type_integer(uint16_t, 0, 0, 0, @@ -482,7 +482,7 @@ static struct lttng_event_field ipv6fields[] = { [8] = { .name = "transport_header_type", .type = { - .atype = atype_enum_nestable, + .type = lttng_kernel_type_enum_nestable, .u.enum_nestable.desc = &transport_header_type, .u.enum_nestable.container_type = __LTTNG_COMPOUND_LITERAL(struct lttng_type, @@ -493,7 +493,7 @@ static struct lttng_event_field ipv6fields[] = { [9] = { .name = "transport_header", .type = { - .atype = atype_variant_nestable, + .type = lttng_kernel_type_variant_nestable, .u.variant_nestable.tag_name = "transport_header_type", .u.variant_nestable.choices = transport_fields, .u.variant_nestable.nr_choices = ARRAY_SIZE(transport_fields), @@ -506,7 +506,7 @@ static struct lttng_event_field network_fields[] = { [0] = { .name = "unknown", .type = { - .atype = atype_struct_nestable, + .type = lttng_kernel_type_struct_nestable, .u.struct_nestable.nr_fields = 0, .u.struct_nestable.fields = emptyfields, .u.struct_nestable.alignment = 0, @@ -515,7 +515,7 @@ static struct lttng_event_field network_fields[] = { [1] = { .name = "ipv4", .type = { - .atype = atype_struct_nestable, + .type = lttng_kernel_type_struct_nestable, .u.struct_nestable.nr_fields = ARRAY_SIZE(ipv4fields), .u.struct_nestable.fields = ipv4fields, .u.struct_nestable.alignment = 0, @@ -524,7 +524,7 @@ static struct lttng_event_field network_fields[] = { [2] = { .name = "ipv6", .type = { - .atype = atype_struct_nestable, + .type = lttng_kernel_type_struct_nestable, .u.struct_nestable.nr_fields = ARRAY_SIZE(ipv6fields), .u.struct_nestable.fields = ipv6fields, .u.struct_nestable.alignment = 0, @@ -592,7 +592,7 @@ LTTNG_TRACEPOINT_EVENT_CLASS(net_dev_template, ctf_custom_field( ctf_custom_type( { - .atype = atype_variant_nestable, + .type = lttng_kernel_type_variant_nestable, .u.variant_nestable.tag_name = "network_header_type", .u.variant_nestable.choices = network_fields, .u.variant_nestable.nr_choices = diff --git a/include/instrumentation/syscalls/headers/syscalls_integers_override.h b/include/instrumentation/syscalls/headers/syscalls_integers_override.h index 84e20490..4a61a5c7 100644 --- a/include/instrumentation/syscalls/headers/syscalls_integers_override.h +++ b/include/instrumentation/syscalls/headers/syscalls_integers_override.h @@ -91,7 +91,7 @@ SC_LTTNG_TRACEPOINT_ENUM(lttng_mmap_flags_options, { \ .name = "type", \ .type = { \ - .atype = atype_enum_nestable, \ + .type = lttng_kernel_type_enum_nestable, \ .u = { \ .enum_nestable = { \ .desc = &__enum_lttng_mmap_flags_mapping_type, \ @@ -107,7 +107,7 @@ SC_LTTNG_TRACEPOINT_ENUM(lttng_mmap_flags_options, { \ .name = "options", \ .type = { \ - .atype = atype_enum_nestable, \ + .type = lttng_kernel_type_enum_nestable, \ .u = { \ .enum_nestable = { \ .desc = &__enum_lttng_mmap_flags_options, \ @@ -150,7 +150,7 @@ SC_LTTNG_TRACEPOINT_EVENT(mmap, ctf_custom_field( ctf_custom_type( { - .atype = atype_struct_nestable, + .type = lttng_kernel_type_struct_nestable, .u.struct_nestable.nr_fields = 2, .u.struct_nestable.fields = __LTTNG_COMPOUND_LITERAL(struct lttng_event_field, diff --git a/include/instrumentation/syscalls/headers/syscalls_pointers_override.h b/include/instrumentation/syscalls/headers/syscalls_pointers_override.h index 8b8be95a..0dbdd82b 100644 --- a/include/instrumentation/syscalls/headers/syscalls_pointers_override.h +++ b/include/instrumentation/syscalls/headers/syscalls_pointers_override.h @@ -120,7 +120,7 @@ SC_LTTNG_TRACEPOINT_ENUM(lttng_clone_option_flags, { \ .name = "exit_signal", \ .type = { \ - .atype = atype_enum_nestable, \ + .type = lttng_kernel_type_enum_nestable, \ .u = { \ .enum_nestable = { \ .desc = &__enum_lttng_clone_exit_signal_flags, \ @@ -137,7 +137,7 @@ SC_LTTNG_TRACEPOINT_ENUM(lttng_clone_option_flags, { \ .name = "options", \ .type = { \ - .atype = atype_enum_nestable, \ + .type = lttng_kernel_type_enum_nestable, \ .u = { \ .enum_nestable = { \ .desc = &__enum_lttng_clone_option_flags, \ @@ -175,7 +175,7 @@ SC_LTTNG_TRACEPOINT_EVENT(clone, ctf_custom_field( ctf_custom_type( { - .atype = atype_struct_nestable, + .type = lttng_kernel_type_struct_nestable, .u.struct_nestable.nr_fields = 2, .u.struct_nestable.fields = __LTTNG_COMPOUND_LITERAL(struct lttng_event_field, @@ -331,7 +331,7 @@ end: ; /* Label at end of compound statement. */ \ ctf_custom_field( \ ctf_custom_type( \ { \ - .atype = atype_sequence_nestable, \ + .type = lttng_kernel_type_sequence_nestable, \ .u.sequence_nestable.length_name = "_" #name "_length", \ .u.sequence_nestable.elem_type = __LTTNG_COMPOUND_LITERAL(struct lttng_type, \ __type_integer(uint8_t, 0, 0, 0, __BYTE_ORDER, 16, none)), \ @@ -379,7 +379,7 @@ end: ; /* Label at end of compound statement. */ \ ctf_custom_field( \ ctf_custom_type( \ { \ - .atype = atype_sequence_nestable, \ + .type = lttng_kernel_type_sequence_nestable, \ .u.sequence_nestable.elem_type = __LTTNG_COMPOUND_LITERAL(struct lttng_type, \ __type_integer(uint8_t, 0, 0, 0, __BYTE_ORDER, 16, none)), \ .u.sequence_nestable.alignment = 0, \ @@ -540,7 +540,7 @@ static struct lttng_event_field lttng_pollfd_fields[] = { [2] = { .name = "events", .type = { - .atype = atype_struct_nestable, + .type = lttng_kernel_type_struct_nestable, .u.struct_nestable.nr_fields = ARRAY_SIZE(lttng_pollfd_flag_fields), .u.struct_nestable.fields = lttng_pollfd_flag_fields, .u.struct_nestable.alignment = 0, @@ -549,7 +549,7 @@ static struct lttng_event_field lttng_pollfd_fields[] = { }; static struct lttng_type lttng_pollfd_elem = { - .atype = atype_struct_nestable, + .type = lttng_kernel_type_struct_nestable, .u.struct_nestable.nr_fields = ARRAY_SIZE(lttng_pollfd_fields), .u.struct_nestable.fields = lttng_pollfd_fields, .u.struct_nestable.alignment = 0, @@ -622,7 +622,7 @@ end: \ ctf_custom_field( \ ctf_custom_type( \ { \ - .atype = atype_sequence_nestable, \ + .type = lttng_kernel_type_sequence_nestable, \ .u.sequence_nestable.length_name = "fds_length", \ .u.sequence_nestable.elem_type = <tng_pollfd_elem, \ } \ @@ -645,7 +645,7 @@ end: \ ctf_custom_field( \ ctf_custom_type( \ { \ - .atype = atype_sequence_nestable, \ + .type = lttng_kernel_type_sequence_nestable, \ .u.sequence_nestable.length_name = "fds_length", \ .u.sequence_nestable.elem_type = <tng_pollfd_elem, \ } \ @@ -812,7 +812,7 @@ static struct lttng_event_field epoll_ctl_fields[] = { [0] = { .name = "data_union", .type = { - .atype = atype_struct_nestable, + .type = lttng_kernel_type_struct_nestable, .u.struct_nestable.nr_fields = ARRAY_SIZE(lttng_epoll_data_fields), .u.struct_nestable.fields = lttng_epoll_data_fields, .u.struct_nestable.alignment = 0, @@ -825,7 +825,7 @@ static struct lttng_event_field epoll_ctl_fields[] = { [2] = { .name = "events", .type = { - .atype = atype_struct_nestable, + .type = lttng_kernel_type_struct_nestable, .u.struct_nestable.nr_fields = ARRAY_SIZE(lttng_epoll_ctl_events_fields), .u.struct_nestable.fields = lttng_epoll_ctl_events_fields, .u.struct_nestable.alignment = 0, @@ -858,7 +858,7 @@ SC_LTTNG_TRACEPOINT_EVENT_CODE(epoll_ctl, ctf_custom_field( ctf_custom_type( { - .atype = atype_struct_nestable, + .type = lttng_kernel_type_struct_nestable, .u.struct_nestable.nr_fields = ARRAY_SIZE(epoll_ctl_fields), .u.struct_nestable.fields = epoll_ctl_fields, .u.struct_nestable.alignment = 0, @@ -895,7 +895,7 @@ static struct lttng_event_field lttng_epoll_wait_fields[] = { [0] = { .name = "data_union", .type = { - .atype = atype_struct_nestable, + .type = lttng_kernel_type_struct_nestable, .u.struct_nestable.nr_fields = ARRAY_SIZE(lttng_epoll_data_fields), .u.struct_nestable.fields = lttng_epoll_data_fields, .u.struct_nestable.alignment = 0, @@ -908,7 +908,7 @@ static struct lttng_event_field lttng_epoll_wait_fields[] = { [2] = { .name = "events", .type = { - .atype = atype_struct_nestable, + .type = lttng_kernel_type_struct_nestable, .u.struct_nestable.nr_fields = ARRAY_SIZE(lttng_epoll_ctl_events_fields), .u.struct_nestable.fields = lttng_epoll_ctl_events_fields, .u.struct_nestable.alignment = 0, @@ -917,7 +917,7 @@ static struct lttng_event_field lttng_epoll_wait_fields[] = { }; static struct lttng_type lttng_epoll_wait_elem = { - .atype = atype_struct_nestable, + .type = lttng_kernel_type_struct_nestable, .u.struct_nestable.nr_fields = ARRAY_SIZE(lttng_epoll_wait_fields), .u.struct_nestable.fields = lttng_epoll_wait_fields, .u.struct_nestable.alignment = 0, @@ -980,7 +980,7 @@ static struct lttng_type lttng_epoll_wait_elem = { ctf_custom_field( \ ctf_custom_type( \ { \ - .atype = atype_sequence_nestable, \ + .type = lttng_kernel_type_sequence_nestable, \ .u.sequence_nestable.length_name = \ "fds_length", \ .u.sequence_nestable.elem_type = \ diff --git a/include/lttng/events.h b/include/lttng/events.h index e4d62adb..9cbc3b99 100644 --- a/include/lttng/events.h +++ b/include/lttng/events.h @@ -35,15 +35,15 @@ struct lib_ring_buffer_config; /* Type description */ -enum abstract_types { - atype_integer, - atype_string, - atype_enum_nestable, - atype_array_nestable, - atype_sequence_nestable, - atype_struct_nestable, - atype_variant_nestable, - NR_ABSTRACT_TYPES, +enum lttng_kernel_type { + lttng_kernel_type_integer, + lttng_kernel_type_string, + lttng_kernel_type_enum_nestable, + lttng_kernel_type_array_nestable, + lttng_kernel_type_sequence_nestable, + lttng_kernel_type_struct_nestable, + lttng_kernel_type_variant_nestable, + NR_LTTNG_KERNEL_TYPES, }; enum lttng_string_encodings { @@ -74,7 +74,7 @@ struct lttng_enum_entry { #define __type_integer(_type, _size, _alignment, _signedness, \ _byte_order, _base, _encoding) \ { \ - .atype = atype_integer, \ + .type = lttng_kernel_type_integer, \ .u.integer = \ { \ .size = (_size) ? : sizeof(_type) * CHAR_BIT, \ @@ -96,7 +96,7 @@ struct lttng_integer_type { }; struct lttng_type { - enum abstract_types atype; + enum lttng_kernel_type type; union { struct lttng_integer_type integer; struct { @@ -1359,7 +1359,7 @@ extern const struct file_operations lttng_syscall_list_fops; static inline bool lttng_is_bytewise_integer(const struct lttng_type *type) { - if (type->atype != atype_integer) + if (type->type != lttng_kernel_type_integer) return false; switch (type->u.integer.size) { case 8: /* Fall-through. */ diff --git a/include/lttng/tracepoint-event-impl.h b/include/lttng/tracepoint-event-impl.h index f5464773..5259c596 100644 --- a/include/lttng/tracepoint-event-impl.h +++ b/include/lttng/tracepoint-event-impl.h @@ -307,7 +307,7 @@ void __event_notifier_template_proto___##_name(void); .name = #_item, \ .type = \ { \ - .atype = atype_array_nestable, \ + .type = lttng_kernel_type_array_nestable, \ .u = \ { \ .array_nestable = \ @@ -330,7 +330,7 @@ void __event_notifier_template_proto___##_name(void); .name = #_item, \ .type = \ { \ - .atype = atype_array_nestable, \ + .type = lttng_kernel_type_array_nestable, \ .u = \ { \ .array_nestable = \ @@ -362,7 +362,7 @@ void __event_notifier_template_proto___##_name(void); .name = #_item, \ .type = \ { \ - .atype = atype_sequence_nestable, \ + .type = lttng_kernel_type_sequence_nestable, \ .u = \ { \ .sequence_nestable = \ @@ -393,7 +393,7 @@ void __event_notifier_template_proto___##_name(void); .name = #_item, \ .type = \ { \ - .atype = atype_sequence_nestable, \ + .type = lttng_kernel_type_sequence_nestable, \ .u = \ { \ .sequence_nestable = \ @@ -416,7 +416,7 @@ void __event_notifier_template_proto___##_name(void); .name = #_item, \ .type = \ { \ - .atype = atype_string, \ + .type = lttng_kernel_type_string, \ .u = \ { \ .string = { .encoding = lttng_encode_UTF8 }, \ @@ -432,7 +432,7 @@ void __event_notifier_template_proto___##_name(void); { \ .name = #_item, \ .type = { \ - .atype = atype_enum_nestable, \ + .type = lttng_kernel_type_enum_nestable, \ .u = { \ .enum_nestable = { \ .desc = &__enum_##_name, \ diff --git a/src/lttng-bytecode-interpreter.c b/src/lttng-bytecode-interpreter.c index 153aeee6..01828b17 100644 --- a/src/lttng-bytecode-interpreter.c +++ b/src/lttng-bytecode-interpreter.c @@ -286,8 +286,8 @@ static int context_get_index(struct lttng_probe_ctx *lttng_probe_ctx, /* field is only used for types nested within variants. */ ptr->field = NULL; - switch (field->type.atype) { - case atype_integer: + switch (field->type.type) { + case lttng_kernel_type_integer: ctx_field->get_value(ctx_field, lttng_probe_ctx, &v); if (field->type.u.integer.signedness) { ptr->object_type = OBJECT_TYPE_S64; @@ -299,7 +299,7 @@ static int context_get_index(struct lttng_probe_ctx *lttng_probe_ctx, ptr->ptr = &ptr->u.u64; } break; - case atype_enum_nestable: + case lttng_kernel_type_enum_nestable: { const struct lttng_integer_type *itype = &field->type.u.enum_nestable.container_type->u.integer; @@ -316,7 +316,7 @@ static int context_get_index(struct lttng_probe_ctx *lttng_probe_ctx, } break; } - case atype_array_nestable: + case lttng_kernel_type_array_nestable: if (!lttng_is_bytewise_integer(field->type.u.array_nestable.elem_type)) { printk(KERN_WARNING "LTTng: bytecode: Array nesting only supports integer types.\n"); return -EINVAL; @@ -329,7 +329,7 @@ static int context_get_index(struct lttng_probe_ctx *lttng_probe_ctx, ctx_field->get_value(ctx_field, lttng_probe_ctx, &v); ptr->ptr = v.str; break; - case atype_sequence_nestable: + case lttng_kernel_type_sequence_nestable: if (!lttng_is_bytewise_integer(field->type.u.sequence_nestable.elem_type)) { printk(KERN_WARNING "LTTng: bytecode: Sequence nesting only supports integer types.\n"); return -EINVAL; @@ -342,19 +342,19 @@ static int context_get_index(struct lttng_probe_ctx *lttng_probe_ctx, ctx_field->get_value(ctx_field, lttng_probe_ctx, &v); ptr->ptr = v.str; break; - case atype_string: + case lttng_kernel_type_string: ptr->object_type = OBJECT_TYPE_STRING; ctx_field->get_value(ctx_field, lttng_probe_ctx, &v); ptr->ptr = v.str; break; - case atype_struct_nestable: + case lttng_kernel_type_struct_nestable: printk(KERN_WARNING "LTTng: bytecode: Structure type cannot be loaded.\n"); return -EINVAL; - case atype_variant_nestable: + case lttng_kernel_type_variant_nestable: printk(KERN_WARNING "LTTng: bytecode: Variant type cannot be loaded.\n"); return -EINVAL; default: - printk(KERN_WARNING "LTTng: bytecode: Unknown type: %d", (int) field->type.atype); + printk(KERN_WARNING "LTTng: bytecode: Unknown type: %d", (int) field->type.type); return -EINVAL; } return 0; @@ -382,7 +382,7 @@ static int dynamic_get_index(struct lttng_probe_ctx *lttng_probe_ctx, stack_top->u.ptr.ptr = ptr; stack_top->u.ptr.object_type = gid->elem.type; stack_top->u.ptr.rev_bo = gid->elem.rev_bo; - BUG_ON(stack_top->u.ptr.field->type.atype != atype_array_nestable); + BUG_ON(stack_top->u.ptr.field->type.type != lttng_kernel_type_array_nestable); stack_top->u.ptr.field = NULL; break; } @@ -401,7 +401,7 @@ static int dynamic_get_index(struct lttng_probe_ctx *lttng_probe_ctx, stack_top->u.ptr.ptr = ptr; stack_top->u.ptr.object_type = gid->elem.type; stack_top->u.ptr.rev_bo = gid->elem.rev_bo; - BUG_ON(stack_top->u.ptr.field->type.atype != atype_sequence_nestable); + BUG_ON(stack_top->u.ptr.field->type.type != lttng_kernel_type_sequence_nestable); stack_top->u.ptr.field = NULL; break; } diff --git a/src/lttng-bytecode-specialize.c b/src/lttng-bytecode-specialize.c index 1ad577a3..b5869a88 100644 --- a/src/lttng-bytecode-specialize.c +++ b/src/lttng-bytecode-specialize.c @@ -322,15 +322,15 @@ static int specialize_load_object(const struct lttng_event_field *field, { load->type = LOAD_OBJECT; - switch (field->type.atype) { - case atype_integer: + switch (field->type.type) { + case lttng_kernel_type_integer: if (field->type.u.integer.signedness) load->object_type = OBJECT_TYPE_S64; else load->object_type = OBJECT_TYPE_U64; load->rev_bo = false; break; - case atype_enum_nestable: + case lttng_kernel_type_enum_nestable: { const struct lttng_integer_type *itype = &field->type.u.enum_nestable.container_type->u.integer; @@ -342,7 +342,7 @@ static int specialize_load_object(const struct lttng_event_field *field, load->rev_bo = false; break; } - case atype_array_nestable: + case lttng_kernel_type_array_nestable: if (!lttng_is_bytewise_integer(field->type.u.array_nestable.elem_type)) { printk(KERN_WARNING "LTTng: bytecode: Array nesting only supports integer types.\n"); return -EINVAL; @@ -358,7 +358,7 @@ static int specialize_load_object(const struct lttng_event_field *field, } } break; - case atype_sequence_nestable: + case lttng_kernel_type_sequence_nestable: if (!lttng_is_bytewise_integer(field->type.u.sequence_nestable.elem_type)) { printk(KERN_WARNING "LTTng: bytecode: Sequence nesting only supports integer types.\n"); return -EINVAL; @@ -374,17 +374,17 @@ static int specialize_load_object(const struct lttng_event_field *field, } } break; - case atype_string: + case lttng_kernel_type_string: load->object_type = OBJECT_TYPE_STRING; break; - case atype_struct_nestable: + case lttng_kernel_type_struct_nestable: printk(KERN_WARNING "LTTng: bytecode: Structure type cannot be loaded.\n"); return -EINVAL; - case atype_variant_nestable: + case lttng_kernel_type_variant_nestable: printk(KERN_WARNING "LTTng: bytecode: Variant type cannot be loaded.\n"); return -EINVAL; default: - printk(KERN_WARNING "LTTng: bytecode: Unknown type: %d", (int) field->type.atype); + printk(KERN_WARNING "LTTng: bytecode: Unknown type: %d", (int) field->type.type); return -EINVAL; } return 0; @@ -454,17 +454,17 @@ static int specialize_payload_lookup(const struct lttng_event_desc *event_desc, break; } /* compute field offset on stack */ - switch (field->type.atype) { - case atype_integer: - case atype_enum_nestable: + switch (field->type.type) { + case lttng_kernel_type_integer: + case lttng_kernel_type_enum_nestable: field_offset += sizeof(int64_t); break; - case atype_array_nestable: - case atype_sequence_nestable: + case lttng_kernel_type_array_nestable: + case lttng_kernel_type_sequence_nestable: field_offset += sizeof(unsigned long); field_offset += sizeof(void *); break; - case atype_string: + case lttng_kernel_type_string: field_offset += sizeof(void *); break; default: diff --git a/src/lttng-bytecode.c b/src/lttng-bytecode.c index 38c2d183..bd6a30ea 100644 --- a/src/lttng-bytecode.c +++ b/src/lttng-bytecode.c @@ -196,28 +196,28 @@ int apply_field_reloc(const struct lttng_event_desc *event_desc, break; } /* compute field offset */ - switch (fields[i].type.atype) { - case atype_integer: - case atype_enum_nestable: + switch (fields[i].type.type) { + case lttng_kernel_type_integer: + case lttng_kernel_type_enum_nestable: field_offset += sizeof(int64_t); break; - case atype_array_nestable: + case lttng_kernel_type_array_nestable: if (!lttng_is_bytewise_integer(fields[i].type.u.array_nestable.elem_type)) return -EINVAL; field_offset += sizeof(unsigned long); field_offset += sizeof(void *); break; - case atype_sequence_nestable: + case lttng_kernel_type_sequence_nestable: if (!lttng_is_bytewise_integer(fields[i].type.u.sequence_nestable.elem_type)) return -EINVAL; field_offset += sizeof(unsigned long); field_offset += sizeof(void *); break; - case atype_string: + case lttng_kernel_type_string: field_offset += sizeof(void *); break; - case atype_struct_nestable: /* Unsupported. */ - case atype_variant_nestable: /* Unsupported. */ + case lttng_kernel_type_struct_nestable: /* Unsupported. */ + case lttng_kernel_type_variant_nestable: /* Unsupported. */ default: return -EINVAL; } @@ -238,12 +238,12 @@ int apply_field_reloc(const struct lttng_event_desc *event_desc, struct field_ref *field_ref; field_ref = (struct field_ref *) op->data; - switch (field->type.atype) { - case atype_integer: - case atype_enum_nestable: + switch (field->type.type) { + case lttng_kernel_type_integer: + case lttng_kernel_type_enum_nestable: op->op = BYTECODE_OP_LOAD_FIELD_REF_S64; break; - case atype_array_nestable: + case lttng_kernel_type_array_nestable: { const struct lttng_type *elem_type = field->type.u.array_nestable.elem_type; @@ -255,7 +255,7 @@ int apply_field_reloc(const struct lttng_event_desc *event_desc, op->op = BYTECODE_OP_LOAD_FIELD_REF_SEQUENCE; break; } - case atype_sequence_nestable: + case lttng_kernel_type_sequence_nestable: { const struct lttng_type *elem_type = field->type.u.sequence_nestable.elem_type; @@ -267,14 +267,14 @@ int apply_field_reloc(const struct lttng_event_desc *event_desc, op->op = BYTECODE_OP_LOAD_FIELD_REF_SEQUENCE; break; } - case atype_string: + case lttng_kernel_type_string: if (field->user) op->op = BYTECODE_OP_LOAD_FIELD_REF_USER_STRING; else op->op = BYTECODE_OP_LOAD_FIELD_REF_STRING; break; - case atype_struct_nestable: /* Unsupported. */ - case atype_variant_nestable: /* Unsupported. */ + case lttng_kernel_type_struct_nestable: /* Unsupported. */ + case lttng_kernel_type_variant_nestable: /* Unsupported. */ default: return -EINVAL; } @@ -320,17 +320,17 @@ int apply_context_reloc(struct bytecode_runtime *runtime, struct field_ref *field_ref; field_ref = (struct field_ref *) op->data; - switch (ctx_field->event_field.type.atype) { - case atype_integer: - case atype_enum_nestable: + switch (ctx_field->event_field.type.type) { + case lttng_kernel_type_integer: + case lttng_kernel_type_enum_nestable: op->op = BYTECODE_OP_GET_CONTEXT_REF_S64; break; /* Sequence and array supported as string */ - case atype_string: + case lttng_kernel_type_string: BUG_ON(ctx_field->event_field.user); op->op = BYTECODE_OP_GET_CONTEXT_REF_STRING; break; - case atype_array_nestable: + case lttng_kernel_type_array_nestable: { const struct lttng_type *elem_type = ctx_field->event_field.type.u.array_nestable.elem_type; @@ -340,7 +340,7 @@ int apply_context_reloc(struct bytecode_runtime *runtime, op->op = BYTECODE_OP_GET_CONTEXT_REF_STRING; break; } - case atype_sequence_nestable: + case lttng_kernel_type_sequence_nestable: { const struct lttng_type *elem_type = ctx_field->event_field.type.u.sequence_nestable.elem_type; @@ -350,8 +350,8 @@ int apply_context_reloc(struct bytecode_runtime *runtime, op->op = BYTECODE_OP_GET_CONTEXT_REF_STRING; break; } - case atype_struct_nestable: /* Unsupported. */ - case atype_variant_nestable: /* Unsupported. */ + case lttng_kernel_type_struct_nestable: /* Unsupported. */ + case lttng_kernel_type_variant_nestable: /* Unsupported. */ default: return -EINVAL; } diff --git a/src/lttng-context-callstack.c b/src/lttng-context-callstack.c index eaaecf4d..d1da784e 100644 --- a/src/lttng-context-callstack.c +++ b/src/lttng-context-callstack.c @@ -137,7 +137,7 @@ int __lttng_add_callstack_generic(struct lttng_ctx **ctx, field = &length_field->event_field; field->name = ctx_length_name; - field->type.atype = atype_integer; + field->type.type = lttng_kernel_type_integer; field->type.u.integer.size = sizeof(unsigned int) * CHAR_BIT; field->type.u.integer.alignment = lttng_alignof(unsigned int) * CHAR_BIT; field->type.u.integer.signedness = lttng_is_signed_type(unsigned int); @@ -150,7 +150,7 @@ int __lttng_add_callstack_generic(struct lttng_ctx **ctx, field = &sequence_field->event_field; field->name = ctx_name; - field->type.atype = atype_sequence_nestable; + field->type.type = lttng_kernel_type_sequence_nestable; field->type.u.sequence_nestable.length_name = ctx_length_name; field->type.u.sequence_nestable.elem_type = &sequence_elem_type; field->type.u.sequence_nestable.alignment = 0; diff --git a/src/lttng-context-cgroup-ns.c b/src/lttng-context-cgroup-ns.c index 3a942978..3d5b518f 100644 --- a/src/lttng-context-cgroup-ns.c +++ b/src/lttng-context-cgroup-ns.c @@ -86,7 +86,7 @@ int lttng_add_cgroup_ns_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "cgroup_ns"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(unsigned int) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(unsigned int) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(unsigned int); diff --git a/src/lttng-context-cpu-id.c b/src/lttng-context-cpu-id.c index 498dfcf0..d0eac981 100644 --- a/src/lttng-context-cpu-id.c +++ b/src/lttng-context-cpu-id.c @@ -57,7 +57,7 @@ int lttng_add_cpu_id_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "cpu_id"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(int) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(int) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(int); diff --git a/src/lttng-context-egid.c b/src/lttng-context-egid.c index e649fec8..f12158cd 100644 --- a/src/lttng-context-egid.c +++ b/src/lttng-context-egid.c @@ -59,7 +59,7 @@ int lttng_add_egid_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "egid"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(gid_t) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(gid_t) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(gid_t); diff --git a/src/lttng-context-euid.c b/src/lttng-context-euid.c index 79faf3ac..00d201ff 100644 --- a/src/lttng-context-euid.c +++ b/src/lttng-context-euid.c @@ -59,7 +59,7 @@ int lttng_add_euid_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "euid"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(uid_t) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(uid_t) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(uid_t); diff --git a/src/lttng-context-gid.c b/src/lttng-context-gid.c index 5620469d..0dbdd301 100644 --- a/src/lttng-context-gid.c +++ b/src/lttng-context-gid.c @@ -59,7 +59,7 @@ int lttng_add_gid_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "gid"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(gid_t) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(gid_t) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(gid_t); diff --git a/src/lttng-context-hostname.c b/src/lttng-context-hostname.c index 86c5d021..55116cfb 100644 --- a/src/lttng-context-hostname.c +++ b/src/lttng-context-hostname.c @@ -90,7 +90,7 @@ int lttng_add_hostname_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "hostname"; - field->event_field.type.atype = atype_array_nestable; + field->event_field.type.type = lttng_kernel_type_array_nestable; field->event_field.type.u.array_nestable.elem_type = &hostname_array_elem_type; field->event_field.type.u.array_nestable.length = LTTNG_HOSTNAME_CTX_LEN; diff --git a/src/lttng-context-interruptible.c b/src/lttng-context-interruptible.c index 9fbf266d..4bc4d8d7 100644 --- a/src/lttng-context-interruptible.c +++ b/src/lttng-context-interruptible.c @@ -64,7 +64,7 @@ int lttng_add_interruptible_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "interruptible"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(int8_t) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(int8_t) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(int8_t); diff --git a/src/lttng-context-ipc-ns.c b/src/lttng-context-ipc-ns.c index 162fac59..b4925ac9 100644 --- a/src/lttng-context-ipc-ns.c +++ b/src/lttng-context-ipc-ns.c @@ -85,7 +85,7 @@ int lttng_add_ipc_ns_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "ipc_ns"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(unsigned int) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(unsigned int) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(unsigned int); diff --git a/src/lttng-context-migratable.c b/src/lttng-context-migratable.c index 207e02ff..604f487e 100644 --- a/src/lttng-context-migratable.c +++ b/src/lttng-context-migratable.c @@ -57,7 +57,7 @@ int lttng_add_migratable_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "migratable"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(uint8_t) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(uint8_t) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(uint8_t); diff --git a/src/lttng-context-mnt-ns.c b/src/lttng-context-mnt-ns.c index f62d6a48..09fb81a7 100644 --- a/src/lttng-context-mnt-ns.c +++ b/src/lttng-context-mnt-ns.c @@ -87,7 +87,7 @@ int lttng_add_mnt_ns_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "mnt_ns"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(unsigned int) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(unsigned int) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(unsigned int); diff --git a/src/lttng-context-need-reschedule.c b/src/lttng-context-need-reschedule.c index 7f8deec2..e7a30955 100644 --- a/src/lttng-context-need-reschedule.c +++ b/src/lttng-context-need-reschedule.c @@ -57,7 +57,7 @@ int lttng_add_need_reschedule_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "need_reschedule"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(uint8_t) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(uint8_t) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(uint8_t); diff --git a/src/lttng-context-net-ns.c b/src/lttng-context-net-ns.c index c9c13e89..66b3b8d5 100644 --- a/src/lttng-context-net-ns.c +++ b/src/lttng-context-net-ns.c @@ -86,7 +86,7 @@ int lttng_add_net_ns_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "net_ns"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(unsigned int) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(unsigned int) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(unsigned int); diff --git a/src/lttng-context-nice.c b/src/lttng-context-nice.c index aaa3643e..411f336e 100644 --- a/src/lttng-context-nice.c +++ b/src/lttng-context-nice.c @@ -57,7 +57,7 @@ int lttng_add_nice_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "nice"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(int) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(int) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(int); diff --git a/src/lttng-context-perf-counters.c b/src/lttng-context-perf-counters.c index 25ca8c59..b9b1e27d 100644 --- a/src/lttng-context-perf-counters.c +++ b/src/lttng-context-perf-counters.c @@ -309,7 +309,7 @@ int lttng_add_perf_counter_to_ctx(uint32_t type, field->destroy = lttng_destroy_perf_counter_field; field->event_field.name = name_alloc; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(uint64_t) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(uint64_t) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(uint64_t); diff --git a/src/lttng-context-pid-ns.c b/src/lttng-context-pid-ns.c index 23b0e6d2..705b50f5 100644 --- a/src/lttng-context-pid-ns.c +++ b/src/lttng-context-pid-ns.c @@ -87,7 +87,7 @@ int lttng_add_pid_ns_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "pid_ns"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(unsigned int) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(unsigned int) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(unsigned int); diff --git a/src/lttng-context-pid.c b/src/lttng-context-pid.c index f3e4aef1..cfce9974 100644 --- a/src/lttng-context-pid.c +++ b/src/lttng-context-pid.c @@ -57,7 +57,7 @@ int lttng_add_pid_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "pid"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(pid_t) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(pid_t) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(pid_t); diff --git a/src/lttng-context-ppid.c b/src/lttng-context-ppid.c index 854c5159..07663f6c 100644 --- a/src/lttng-context-ppid.c +++ b/src/lttng-context-ppid.c @@ -79,7 +79,7 @@ int lttng_add_ppid_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "ppid"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(pid_t) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(pid_t) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(pid_t); diff --git a/src/lttng-context-preemptible.c b/src/lttng-context-preemptible.c index 6130a1a2..ae5f8256 100644 --- a/src/lttng-context-preemptible.c +++ b/src/lttng-context-preemptible.c @@ -75,7 +75,7 @@ int lttng_add_preemptible_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "preemptible"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(uint8_t) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(uint8_t) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(uint8_t); diff --git a/src/lttng-context-prio.c b/src/lttng-context-prio.c index 2a16ea87..885c48bc 100644 --- a/src/lttng-context-prio.c +++ b/src/lttng-context-prio.c @@ -91,7 +91,7 @@ int lttng_add_prio_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "prio"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(int) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(int) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(int); diff --git a/src/lttng-context-procname.c b/src/lttng-context-procname.c index fb5c36b8..e627b976 100644 --- a/src/lttng-context-procname.c +++ b/src/lttng-context-procname.c @@ -62,7 +62,7 @@ int lttng_add_procname_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "procname"; - field->event_field.type.atype = atype_array_nestable; + field->event_field.type.type = lttng_kernel_type_array_nestable; field->event_field.type.u.array_nestable.elem_type = &procname_array_elem_type; field->event_field.type.u.array_nestable.length = sizeof(current->comm); field->event_field.type.u.array_nestable.alignment = 0; diff --git a/src/lttng-context-sgid.c b/src/lttng-context-sgid.c index 18f1b837..c2708283 100644 --- a/src/lttng-context-sgid.c +++ b/src/lttng-context-sgid.c @@ -59,7 +59,7 @@ int lttng_add_sgid_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "sgid"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(gid_t) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(gid_t) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(gid_t); diff --git a/src/lttng-context-suid.c b/src/lttng-context-suid.c index 1aa52dc5..c26b1413 100644 --- a/src/lttng-context-suid.c +++ b/src/lttng-context-suid.c @@ -59,7 +59,7 @@ int lttng_add_suid_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "suid"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(uid_t) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(uid_t) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(uid_t); diff --git a/src/lttng-context-tid.c b/src/lttng-context-tid.c index 31161308..d4bedafc 100644 --- a/src/lttng-context-tid.c +++ b/src/lttng-context-tid.c @@ -60,7 +60,7 @@ int lttng_add_tid_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "tid"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(pid_t) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(pid_t) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(pid_t); diff --git a/src/lttng-context-time-ns.c b/src/lttng-context-time-ns.c index d3133aca..3d197827 100644 --- a/src/lttng-context-time-ns.c +++ b/src/lttng-context-time-ns.c @@ -85,7 +85,7 @@ int lttng_add_time_ns_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "time_ns"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(unsigned int) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(unsigned int) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(unsigned int); diff --git a/src/lttng-context-uid.c b/src/lttng-context-uid.c index c48bd0a6..47c740f9 100644 --- a/src/lttng-context-uid.c +++ b/src/lttng-context-uid.c @@ -59,7 +59,7 @@ int lttng_add_uid_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "uid"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(uid_t) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(uid_t) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(uid_t); diff --git a/src/lttng-context-user-ns.c b/src/lttng-context-user-ns.c index 5be49a59..2b5f46c6 100644 --- a/src/lttng-context-user-ns.c +++ b/src/lttng-context-user-ns.c @@ -71,7 +71,7 @@ int lttng_add_user_ns_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "user_ns"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(unsigned int) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(unsigned int) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(unsigned int); diff --git a/src/lttng-context-uts-ns.c b/src/lttng-context-uts-ns.c index 3c399fe3..6e1fabe8 100644 --- a/src/lttng-context-uts-ns.c +++ b/src/lttng-context-uts-ns.c @@ -85,7 +85,7 @@ int lttng_add_uts_ns_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "uts_ns"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(unsigned int) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(unsigned int) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(unsigned int); diff --git a/src/lttng-context-vegid.c b/src/lttng-context-vegid.c index 6207e61c..75327824 100644 --- a/src/lttng-context-vegid.c +++ b/src/lttng-context-vegid.c @@ -59,7 +59,7 @@ int lttng_add_vegid_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "vegid"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(gid_t) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(gid_t) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(gid_t); diff --git a/src/lttng-context-veuid.c b/src/lttng-context-veuid.c index a2498208..2c49b182 100644 --- a/src/lttng-context-veuid.c +++ b/src/lttng-context-veuid.c @@ -59,7 +59,7 @@ int lttng_add_veuid_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "veuid"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(uid_t) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(uid_t) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(uid_t); diff --git a/src/lttng-context-vgid.c b/src/lttng-context-vgid.c index a833915f..b42e4988 100644 --- a/src/lttng-context-vgid.c +++ b/src/lttng-context-vgid.c @@ -59,7 +59,7 @@ int lttng_add_vgid_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "vgid"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(gid_t) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(gid_t) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(gid_t); diff --git a/src/lttng-context-vpid.c b/src/lttng-context-vpid.c index 28178b9e..41296c48 100644 --- a/src/lttng-context-vpid.c +++ b/src/lttng-context-vpid.c @@ -72,7 +72,7 @@ int lttng_add_vpid_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "vpid"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(pid_t) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(pid_t) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(pid_t); diff --git a/src/lttng-context-vppid.c b/src/lttng-context-vppid.c index 8757eb29..1ff182c3 100644 --- a/src/lttng-context-vppid.c +++ b/src/lttng-context-vppid.c @@ -101,7 +101,7 @@ int lttng_add_vppid_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "vppid"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(pid_t) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(pid_t) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(pid_t); diff --git a/src/lttng-context-vsgid.c b/src/lttng-context-vsgid.c index c6a6ea7c..a00545b5 100644 --- a/src/lttng-context-vsgid.c +++ b/src/lttng-context-vsgid.c @@ -59,7 +59,7 @@ int lttng_add_vsgid_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "vsgid"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(gid_t) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(gid_t) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(gid_t); diff --git a/src/lttng-context-vsuid.c b/src/lttng-context-vsuid.c index c22d4304..635bba48 100644 --- a/src/lttng-context-vsuid.c +++ b/src/lttng-context-vsuid.c @@ -59,7 +59,7 @@ int lttng_add_vsuid_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "vsuid"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(uid_t) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(uid_t) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(uid_t); diff --git a/src/lttng-context-vtid.c b/src/lttng-context-vtid.c index 3b0cadc4..1e2e1ad9 100644 --- a/src/lttng-context-vtid.c +++ b/src/lttng-context-vtid.c @@ -72,7 +72,7 @@ int lttng_add_vtid_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "vtid"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(pid_t) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(pid_t) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(pid_t); diff --git a/src/lttng-context-vuid.c b/src/lttng-context-vuid.c index e83f8989..6980af9f 100644 --- a/src/lttng-context-vuid.c +++ b/src/lttng-context-vuid.c @@ -59,7 +59,7 @@ int lttng_add_vuid_to_ctx(struct lttng_ctx **ctx) return -EEXIST; } field->event_field.name = "vuid"; - field->event_field.type.atype = atype_integer; + field->event_field.type.type = lttng_kernel_type_integer; field->event_field.type.u.integer.size = sizeof(uid_t) * CHAR_BIT; field->event_field.type.u.integer.alignment = lttng_alignof(uid_t) * CHAR_BIT; field->event_field.type.u.integer.signedness = lttng_is_signed_type(uid_t); diff --git a/src/lttng-context.c b/src/lttng-context.c index 311dd6e1..5c83ffb2 100644 --- a/src/lttng-context.c +++ b/src/lttng-context.c @@ -135,26 +135,26 @@ void lttng_context_update(struct lttng_ctx *ctx) size_t field_align = 8; type = &ctx->fields[i].event_field.type; - switch (type->atype) { - case atype_integer: + switch (type->type) { + case lttng_kernel_type_integer: field_align = type->u.integer.alignment; break; - case atype_array_nestable: + case lttng_kernel_type_array_nestable: { const struct lttng_type *nested_type; nested_type = type->u.array_nestable.elem_type; - switch (nested_type->atype) { - case atype_integer: + switch (nested_type->type) { + case lttng_kernel_type_integer: field_align = nested_type->u.integer.alignment; break; - case atype_string: + case lttng_kernel_type_string: break; - case atype_array_nestable: - case atype_sequence_nestable: - case atype_struct_nestable: - case atype_variant_nestable: + case lttng_kernel_type_array_nestable: + case lttng_kernel_type_sequence_nestable: + case lttng_kernel_type_struct_nestable: + case lttng_kernel_type_variant_nestable: default: WARN_ON_ONCE(1); break; @@ -163,23 +163,23 @@ void lttng_context_update(struct lttng_ctx *ctx) type->u.array_nestable.alignment); break; } - case atype_sequence_nestable: + case lttng_kernel_type_sequence_nestable: { const struct lttng_type *nested_type; nested_type = type->u.sequence_nestable.elem_type; - switch (nested_type->atype) { - case atype_integer: + switch (nested_type->type) { + case lttng_kernel_type_integer: field_align = nested_type->u.integer.alignment; break; - case atype_string: + case lttng_kernel_type_string: break; - case atype_array_nestable: - case atype_sequence_nestable: - case atype_struct_nestable: - case atype_variant_nestable: + case lttng_kernel_type_array_nestable: + case lttng_kernel_type_sequence_nestable: + case lttng_kernel_type_struct_nestable: + case lttng_kernel_type_variant_nestable: default: WARN_ON_ONCE(1); break; @@ -188,14 +188,14 @@ void lttng_context_update(struct lttng_ctx *ctx) type->u.sequence_nestable.alignment); break; } - case atype_string: + case lttng_kernel_type_string: break; - case atype_struct_nestable: - case atype_variant_nestable: + case lttng_kernel_type_struct_nestable: + case lttng_kernel_type_variant_nestable: break; - case atype_enum_nestable: + case lttng_kernel_type_enum_nestable: default: WARN_ON_ONCE(1); break; diff --git a/src/lttng-event-notifier-notification.c b/src/lttng-event-notifier-notification.c index b39bfaad..906ed109 100644 --- a/src/lttng-event-notifier-notification.c +++ b/src/lttng-event-notifier-notification.c @@ -208,11 +208,11 @@ int capture_sequence(struct lttng_msgpack_writer *writer, ptr = (uint8_t *) output->u.sequence.ptr; nested_type = output->u.sequence.nested_type; - switch (nested_type->atype) { - case atype_integer: + switch (nested_type->type) { + case lttng_kernel_type_integer: integer_type = &nested_type->u.integer; break; - case atype_enum_nestable: + case lttng_kernel_type_enum_nestable: /* Treat enumeration as an integer. */ integer_type = &nested_type->u.enum_nestable.container_type->u.integer; break; diff --git a/src/lttng-events.c b/src/lttng-events.c index 944d4fb2..9df49fac 100644 --- a/src/lttng-events.c +++ b/src/lttng-events.c @@ -3013,7 +3013,7 @@ int _lttng_integer_type_statedump(struct lttng_session *session, { int ret; - WARN_ON_ONCE(type->atype != atype_integer); + WARN_ON_ONCE(type->type != lttng_kernel_type_integer); ret = print_tabs(session, nesting); if (ret) return ret; @@ -3049,7 +3049,7 @@ int _lttng_struct_type_statedump(struct lttng_session *session, uint32_t i, nr_fields; unsigned int alignment; - WARN_ON_ONCE(type->atype != atype_struct_nestable); + WARN_ON_ONCE(type->type != lttng_kernel_type_struct_nestable); ret = print_tabs(session, nesting); if (ret) @@ -3110,7 +3110,7 @@ int _lttng_variant_type_statedump(struct lttng_session *session, int ret; uint32_t i, nr_choices; - WARN_ON_ONCE(type->atype != atype_variant_nestable); + WARN_ON_ONCE(type->type != lttng_kernel_type_variant_nestable); /* * CTF 1.8 does not allow expressing nonzero variant alignment in a nestable way. */ @@ -3169,7 +3169,7 @@ int _lttng_array_field_statedump(struct lttng_session *session, int ret; const struct lttng_type *elem_type; - WARN_ON_ONCE(field->type.atype != atype_array_nestable); + WARN_ON_ONCE(field->type.type != lttng_kernel_type_array_nestable); if (field->type.u.array_nestable.alignment) { ret = print_tabs(session, nesting); @@ -3187,10 +3187,10 @@ int _lttng_array_field_statedump(struct lttng_session *session, * currently supported. */ elem_type = field->type.u.array_nestable.elem_type; - switch (elem_type->atype) { - case atype_integer: - case atype_struct_nestable: - case atype_variant_nestable: + switch (elem_type->type) { + case lttng_kernel_type_integer: + case lttng_kernel_type_struct_nestable: + case lttng_kernel_type_variant_nestable: ret = _lttng_type_statedump(session, elem_type, nesting); if (ret) return ret; @@ -3218,7 +3218,7 @@ int _lttng_sequence_field_statedump(struct lttng_session *session, const char *length_name; const struct lttng_type *elem_type; - WARN_ON_ONCE(field->type.atype != atype_sequence_nestable); + WARN_ON_ONCE(field->type.type != lttng_kernel_type_sequence_nestable); length_name = field->type.u.sequence_nestable.length_name; @@ -3239,10 +3239,10 @@ int _lttng_sequence_field_statedump(struct lttng_session *session, * currently supported. */ elem_type = field->type.u.sequence_nestable.elem_type; - switch (elem_type->atype) { - case atype_integer: - case atype_struct_nestable: - case atype_variant_nestable: + switch (elem_type->type) { + case lttng_kernel_type_integer: + case lttng_kernel_type_struct_nestable: + case lttng_kernel_type_variant_nestable: ret = _lttng_type_statedump(session, elem_type, nesting); if (ret) return ret; @@ -3272,7 +3272,7 @@ int _lttng_enum_type_statedump(struct lttng_session *session, unsigned int i, nr_entries; container_type = type->u.enum_nestable.container_type; - if (container_type->atype != atype_integer) { + if (container_type->type != lttng_kernel_type_integer) { ret = -EINVAL; goto end; } @@ -3410,7 +3410,7 @@ int _lttng_string_type_statedump(struct lttng_session *session, { int ret; - WARN_ON_ONCE(type->atype != atype_string); + WARN_ON_ONCE(type->type != lttng_kernel_type_string); /* Default encoding is UTF8 */ ret = print_tabs(session, nesting); if (ret) @@ -3429,7 +3429,7 @@ int _lttng_string_field_statedump(struct lttng_session *session, { int ret; - WARN_ON_ONCE(field->type.atype != atype_string); + WARN_ON_ONCE(field->type.type != lttng_kernel_type_string); ret = _lttng_string_type_statedump(session, &field->type, nesting); if (ret) return ret; @@ -3446,26 +3446,26 @@ int _lttng_type_statedump(struct lttng_session *session, { int ret = 0; - switch (type->atype) { - case atype_integer: + switch (type->type) { + case lttng_kernel_type_integer: ret = _lttng_integer_type_statedump(session, type, nesting); break; - case atype_enum_nestable: + case lttng_kernel_type_enum_nestable: ret = _lttng_enum_type_statedump(session, type, nesting); break; - case atype_string: + case lttng_kernel_type_string: ret = _lttng_string_type_statedump(session, type, nesting); break; - case atype_struct_nestable: + case lttng_kernel_type_struct_nestable: ret = _lttng_struct_type_statedump(session, type, nesting); break; - case atype_variant_nestable: + case lttng_kernel_type_variant_nestable: ret = _lttng_variant_type_statedump(session, type, nesting); break; /* Nested arrays and sequences are not supported yet. */ - case atype_array_nestable: - case atype_sequence_nestable: + case lttng_kernel_type_array_nestable: + case lttng_kernel_type_sequence_nestable: default: WARN_ON_ONCE(1); return -EINVAL; @@ -3483,26 +3483,26 @@ int _lttng_field_statedump(struct lttng_session *session, { int ret = 0; - switch (field->type.atype) { - case atype_integer: + switch (field->type.type) { + case lttng_kernel_type_integer: ret = _lttng_integer_field_statedump(session, field, nesting); break; - case atype_enum_nestable: + case lttng_kernel_type_enum_nestable: ret = _lttng_enum_field_statedump(session, field, nesting); break; - case atype_string: + case lttng_kernel_type_string: ret = _lttng_string_field_statedump(session, field, nesting); break; - case atype_struct_nestable: + case lttng_kernel_type_struct_nestable: ret = _lttng_struct_field_statedump(session, field, nesting); break; - case atype_array_nestable: + case lttng_kernel_type_array_nestable: ret = _lttng_array_field_statedump(session, field, nesting); break; - case atype_sequence_nestable: + case lttng_kernel_type_sequence_nestable: ret = _lttng_sequence_field_statedump(session, field, nesting); break; - case atype_variant_nestable: + case lttng_kernel_type_variant_nestable: ret = _lttng_variant_field_statedump(session, field, nesting); break; diff --git a/src/probes/lttng-kprobes.c b/src/probes/lttng-kprobes.c index 82433bd8..c4b089c6 100644 --- a/src/probes/lttng-kprobes.c +++ b/src/probes/lttng-kprobes.c @@ -91,7 +91,7 @@ int lttng_create_kprobe_event(const char *name, struct lttng_event *event) goto error_field; } field->name = "ip"; - field->type.atype = atype_integer; + field->type.type = lttng_kernel_type_integer; field->type.u.integer.size = sizeof(unsigned long) * CHAR_BIT; field->type.u.integer.alignment = lttng_alignof(unsigned long) * CHAR_BIT; field->type.u.integer.signedness = lttng_is_signed_type(unsigned long); diff --git a/src/probes/lttng-kretprobes.c b/src/probes/lttng-kretprobes.c index e0037aa7..25bdec90 100644 --- a/src/probes/lttng-kretprobes.c +++ b/src/probes/lttng-kretprobes.c @@ -129,7 +129,7 @@ int lttng_create_kprobe_event(const char *name, struct lttng_event *event, goto error_fields; } fields[0].name = "ip"; - fields[0].type.atype = atype_integer; + fields[0].type.type = lttng_kernel_type_integer; fields[0].type.u.integer.size = sizeof(unsigned long) * CHAR_BIT; fields[0].type.u.integer.alignment = lttng_alignof(unsigned long) * CHAR_BIT; fields[0].type.u.integer.signedness = lttng_is_signed_type(unsigned long); @@ -138,7 +138,7 @@ int lttng_create_kprobe_event(const char *name, struct lttng_event *event, fields[0].type.u.integer.encoding = lttng_encode_none; fields[1].name = "parent_ip"; - fields[1].type.atype = atype_integer; + fields[1].type.type = lttng_kernel_type_integer; fields[1].type.u.integer.size = sizeof(unsigned long) * CHAR_BIT; fields[1].type.u.integer.alignment = lttng_alignof(unsigned long) * CHAR_BIT; fields[1].type.u.integer.signedness = lttng_is_signed_type(unsigned long); diff --git a/src/probes/lttng-uprobes.c b/src/probes/lttng-uprobes.c index c44ed4f8..b738847f 100644 --- a/src/probes/lttng-uprobes.c +++ b/src/probes/lttng-uprobes.c @@ -107,7 +107,7 @@ int lttng_create_uprobe_event(const char *name, struct lttng_event *event) goto error_fields; } fields[0].name = "ip"; - fields[0].type.atype = atype_integer; + fields[0].type.type = lttng_kernel_type_integer; fields[0].type.u.integer.size = sizeof(unsigned long) * CHAR_BIT; fields[0].type.u.integer.alignment = lttng_alignof(unsigned long) * CHAR_BIT; fields[0].type.u.integer.signedness = lttng_is_signed_type(unsigned long);