X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-field-utils.c;h=a89fade5ec93254c237a73a0d45e991e7a5e947e;hb=b623cb6a788d9e666d9a93658ab04b06458863ef;hp=9b0ff7a1d1bdb874ed845788eb19d56e5dcc6e42;hpb=30f1659b7319f08fa5422db5fa8493905cb4b9c6;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/ust-field-utils.c b/src/bin/lttng-sessiond/ust-field-utils.c index 9b0ff7a1d..a89fade5e 100644 --- a/src/bin/lttng-sessiond/ust-field-utils.c +++ b/src/bin/lttng-sessiond/ust-field-utils.c @@ -11,24 +11,24 @@ #include "ust-field-utils.h" /* - * The ustctl_field is made of a combination of C basic types - * ustctl_basic_type and _ustctl_basic_type. + * The lttng_ust_ctl_field is made of a combination of C basic types + * lttng_ust_ctl_basic_type and _lttng_ust_ctl_basic_type. * - * ustctl_basic_type contains an enumeration describing the abstract type. - * _ustctl_basic_type does _NOT_ contain an enumeration describing the + * lttng_ust_ctl_basic_type contains an enumeration describing the abstract type. + * _lttng_ust_ctl_basic_type does _NOT_ contain an enumeration describing the * abstract type. * * A layer is needed to use the same code for both structures. - * When dealing with _ustctl_basic_type, we need to use the abstract type of - * the ustctl_type struct. + * When dealing with _lttng_ust_ctl_basic_type, we need to use the abstract type of + * the lttng_ust_ctl_type struct. */ /* - * Compare two ustctl_integer_type fields. + * Compare two lttng_ust_ctl_integer_type fields. * Returns 1 if both are identical. */ -static bool match_ustctl_field_integer(const struct ustctl_integer_type *first, - const struct ustctl_integer_type *second) +static bool match_lttng_ust_ctl_field_integer(const struct lttng_ust_ctl_integer_type *first, + const struct lttng_ust_ctl_integer_type *second) { if (first->size != second->size) { goto no_match; @@ -56,23 +56,23 @@ no_match: } /* - * Compare two _ustctl_basic_type fields known to be of type integer. + * Compare two _lttng_ust_ctl_basic_type fields known to be of type integer. * Returns 1 if both are identical. */ -static bool match_ustctl_field_integer_from_raw_basic_type( - const union _ustctl_basic_type *first, - const union _ustctl_basic_type *second) +static bool match_lttng_ust_ctl_field_integer_from_raw_basic_type( + const union _lttng_ust_ctl_basic_type *first, + const union _lttng_ust_ctl_basic_type *second) { - return match_ustctl_field_integer(&first->integer, &second->integer); + return match_lttng_ust_ctl_field_integer(&first->integer, &second->integer); } /* - * Compare two _ustctl_basic_type fields known to be of type enum. + * Compare two _lttng_ust_ctl_basic_type fields known to be of type enum. * Returns 1 if both are identical. */ -static bool match_ustctl_field_enum_from_raw_basic_type( - const union _ustctl_basic_type *first, - const union _ustctl_basic_type *second) +static bool match_lttng_ust_ctl_field_enum_from_raw_basic_type( + const union _lttng_ust_ctl_basic_type *first, + const union _lttng_ust_ctl_basic_type *second) { /* * Compare enumeration ID. Enumeration ID is provided to the application by @@ -90,7 +90,7 @@ static bool match_ustctl_field_enum_from_raw_basic_type( LTTNG_UST_ABI_SYM_NAME_LEN)) { goto no_match; } - if (!match_ustctl_field_integer(&first->enumeration.container_type, + if (!match_lttng_ust_ctl_field_integer(&first->enumeration.container_type, &second->enumeration.container_type)) { goto no_match; } @@ -102,23 +102,23 @@ no_match: } /* - * Compare two _ustctl_basic_type fields known to be of type string. + * Compare two _lttng_ust_ctl_basic_type fields known to be of type string. * Returns 1 if both are identical. */ -static bool match_ustctl_field_string_from_raw_basic_type( - const union _ustctl_basic_type *first, - const union _ustctl_basic_type *second) +static bool match_lttng_ust_ctl_field_string_from_raw_basic_type( + const union _lttng_ust_ctl_basic_type *first, + const union _lttng_ust_ctl_basic_type *second) { return first->string.encoding == second->string.encoding; } /* - * Compare two _ustctl_basic_type fields known to be of type float. + * Compare two _lttng_ust_ctl_basic_type fields known to be of type float. * Returns 1 if both are identical. */ -static bool match_ustctl_field_float_from_raw_basic_type( - const union _ustctl_basic_type *first, - const union _ustctl_basic_type *second) +static bool match_lttng_ust_ctl_field_float_from_raw_basic_type( + const union _lttng_ust_ctl_basic_type *first, + const union _lttng_ust_ctl_basic_type *second) { if (first->_float.exp_dig != second->_float.exp_dig) { goto no_match; @@ -144,37 +144,37 @@ no_match: } /* - * Compare two _ustctl_basic_type fields given their respective abstract types. + * Compare two _lttng_ust_ctl_basic_type fields given their respective abstract types. * Returns 1 if both are identical. */ -static bool match_ustctl_field_raw_basic_type( - enum ustctl_abstract_types first_atype, - const union _ustctl_basic_type *first, - enum ustctl_abstract_types second_atype, - const union _ustctl_basic_type *second) +static bool match_lttng_ust_ctl_field_raw_basic_type( + enum lttng_ust_ctl_abstract_types first_atype, + const union _lttng_ust_ctl_basic_type *first, + enum lttng_ust_ctl_abstract_types second_atype, + const union _lttng_ust_ctl_basic_type *second) { if (first_atype != second_atype) { goto no_match; } switch (first_atype) { - case ustctl_atype_integer: - if (!match_ustctl_field_integer_from_raw_basic_type(first, second)) { + case lttng_ust_ctl_atype_integer: + if (!match_lttng_ust_ctl_field_integer_from_raw_basic_type(first, second)) { goto no_match; } break; - case ustctl_atype_enum: - if (!match_ustctl_field_enum_from_raw_basic_type(first, second)) { + case lttng_ust_ctl_atype_enum: + if (!match_lttng_ust_ctl_field_enum_from_raw_basic_type(first, second)) { goto no_match; } break; - case ustctl_atype_string: - if (!match_ustctl_field_string_from_raw_basic_type(first, second)) { + case lttng_ust_ctl_atype_string: + if (!match_lttng_ust_ctl_field_string_from_raw_basic_type(first, second)) { goto no_match; } break; - case ustctl_atype_float: - if (!match_ustctl_field_float_from_raw_basic_type(first, second)) { + case lttng_ust_ctl_atype_float: + if (!match_lttng_ust_ctl_field_float_from_raw_basic_type(first, second)) { goto no_match; } break; @@ -189,18 +189,18 @@ no_match: } /* - * Compatibility layer between the ustctl_basic_type struct and - * _ustctl_basic_type union. + * Compatibility layer between the lttng_ust_ctl_basic_type struct and + * _lttng_ust_ctl_basic_type union. */ -static bool match_ustctl_field_basic_type(const struct ustctl_basic_type *first, - const struct ustctl_basic_type *second) +static bool match_lttng_ust_ctl_field_basic_type(const struct lttng_ust_ctl_basic_type *first, + const struct lttng_ust_ctl_basic_type *second) { - return match_ustctl_field_raw_basic_type(first->atype, &first->u.basic, + return match_lttng_ust_ctl_field_raw_basic_type(first->atype, &first->u.basic, second->atype, &second->u.basic); } -int match_ustctl_field(const struct ustctl_field *first, - const struct ustctl_field *second) +int match_lttng_ust_ctl_field(const struct lttng_ust_ctl_field *first, + const struct lttng_ust_ctl_field *second) { /* Check the name of the field is identical. */ if (strncmp(first->name, second->name, LTTNG_UST_ABI_SYM_NAME_LEN)) { @@ -214,32 +214,32 @@ int match_ustctl_field(const struct ustctl_field *first, /* Check the field layout. */ switch (first->type.atype) { - case ustctl_atype_integer: - case ustctl_atype_enum: - case ustctl_atype_string: - case ustctl_atype_float: - if (!match_ustctl_field_raw_basic_type(first->type.atype, + case lttng_ust_ctl_atype_integer: + case lttng_ust_ctl_atype_enum: + case lttng_ust_ctl_atype_string: + case lttng_ust_ctl_atype_float: + if (!match_lttng_ust_ctl_field_raw_basic_type(first->type.atype, &first->type.u.legacy.basic, second->type.atype, &second->type.u.legacy.basic)) { goto no_match; } break; - case ustctl_atype_sequence: + case lttng_ust_ctl_atype_sequence: /* Match element type of the sequence. */ - if (!match_ustctl_field_basic_type(&first->type.u.legacy.sequence.elem_type, + if (!match_lttng_ust_ctl_field_basic_type(&first->type.u.legacy.sequence.elem_type, &second->type.u.legacy.sequence.elem_type)) { goto no_match; } /* Match length type of the sequence. */ - if (!match_ustctl_field_basic_type(&first->type.u.legacy.sequence.length_type, + if (!match_lttng_ust_ctl_field_basic_type(&first->type.u.legacy.sequence.length_type, &second->type.u.legacy.sequence.length_type)) { goto no_match; } break; - case ustctl_atype_array: + case lttng_ust_ctl_atype_array: /* Match element type of the array. */ - if (!match_ustctl_field_basic_type(&first->type.u.legacy.array.elem_type, + if (!match_lttng_ust_ctl_field_basic_type(&first->type.u.legacy.array.elem_type, &second->type.u.legacy.array.elem_type)) { goto no_match; } @@ -249,7 +249,7 @@ int match_ustctl_field(const struct ustctl_field *first, goto no_match; } break; - case ustctl_atype_variant: + case lttng_ust_ctl_atype_variant: /* Compare number of choice of the variants. */ if (first->type.u.legacy.variant.nr_choices != second->type.u.legacy.variant.nr_choices) { @@ -263,13 +263,13 @@ int match_ustctl_field(const struct ustctl_field *first, goto no_match; } break; - case ustctl_atype_struct: + case lttng_ust_ctl_atype_struct: /* Compare number of fields of the structs. */ if (first->type.u.legacy._struct.nr_fields != second->type.u.legacy._struct.nr_fields) { goto no_match; } break; - case ustctl_atype_sequence_nestable: + case lttng_ust_ctl_atype_sequence_nestable: if (first->type.u.sequence_nestable.alignment != second->type.u.sequence_nestable.alignment) { goto no_match; } @@ -281,7 +281,7 @@ int match_ustctl_field(const struct ustctl_field *first, } /* Comparison will be done when marshalling following items. */ break; - case ustctl_atype_array_nestable: + case lttng_ust_ctl_atype_array_nestable: if (first->type.u.array_nestable.alignment != second->type.u.array_nestable.alignment) { goto no_match; } @@ -291,7 +291,7 @@ int match_ustctl_field(const struct ustctl_field *first, } /* Comparison of element type will be done when marshalling following item. */ break; - case ustctl_atype_enum_nestable: + case lttng_ust_ctl_atype_enum_nestable: if (first->type.u.enum_nestable.id != second->type.u.enum_nestable.id) { goto no_match; } @@ -303,7 +303,7 @@ int match_ustctl_field(const struct ustctl_field *first, } /* Comparison of element type will be done when marshalling following item. */ break; - case ustctl_atype_struct_nestable: + case lttng_ust_ctl_atype_struct_nestable: if (first->type.u.struct_nestable.alignment != second->type.u.struct_nestable.alignment) { goto no_match; } @@ -312,7 +312,7 @@ int match_ustctl_field(const struct ustctl_field *first, goto no_match; } break; - case ustctl_atype_variant_nestable: + case lttng_ust_ctl_atype_variant_nestable: if (first->type.u.variant_nestable.alignment != second->type.u.variant_nestable.alignment) { goto no_match; }