[lttng-dev] [Patch LTTng-tools 1/4] Add or update data structures to support CTF named metadata
Mathieu Desnoyers
mathieu.desnoyers at efficios.com
Thu Jan 30 20:42:43 EST 2014
----- Original Message -----
> From: "Geneviève Bastien" <gbastien+lttng at versatic.net>
> To: lttng-dev at lists.lttng.org
> Sent: Friday, January 24, 2014 3:07:22 PM
> Subject: [lttng-dev] [Patch LTTng-tools 1/4] Add or update data structures to support CTF named metadata
>
> The structures match the LTTng-UST structure for supporting named metadata
> in general and CTF enumerations in particular.
>
> Signed-off-by: Geneviève Bastien <gbastien+lttng at versatic.net>
> ---
> src/bin/lttng-sessiond/lttng-ust-ctl.h | 36
> +++++++++++++++++++++++++++++++++-
> 1 file changed, 35 insertions(+), 1 deletion(-)
>
> diff --git a/src/bin/lttng-sessiond/lttng-ust-ctl.h
> b/src/bin/lttng-sessiond/lttng-ust-ctl.h
> index 7f59b86..b5acd0f 100644
> --- a/src/bin/lttng-sessiond/lttng-ust-ctl.h
> +++ b/src/bin/lttng-sessiond/lttng-ust-ctl.h
> @@ -274,13 +274,23 @@ struct ustctl_float_type {
> char padding[USTCTL_UST_FLOAT_TYPE_PADDING];
> } LTTNG_PACKED;
>
> -#define USTCTL_UST_BASIC_TYPE_PADDING 296
> +#define USTCTL_UST_ENUM_ENTRY_PADDING 296
> +struct ustctl_enum_entry {
> + unsigned long long start, end; /* start and end are inclusive */
> + char string[LTTNG_UST_SYM_NAME_LEN];
> + char padding[USTCTL_UST_ENUM_ENTRY_PADDING];
> +};
> +
> +#define USTCTL_UST_BASIC_TYPE_PADDING 40
> union _ustctl_basic_type {
> struct ustctl_integer_type integer;
> struct {
> enum ustctl_string_encodings encoding;
> } string;
> struct ustctl_float_type _float;
> + struct {
> + char name[LTTNG_UST_SYM_NAME_LEN];
> + } enumeration;
> char padding[USTCTL_UST_BASIC_TYPE_PADDING];
> } LTTNG_PACKED;
>
> @@ -308,6 +318,30 @@ struct ustctl_type {
> } u;
> } LTTNG_PACKED;
>
> +#define USTCTL_UST_ENUM_TYPE_PADDING 296
> +struct ustctl_enum {
> + char name[LTTNG_UST_SYM_NAME_LEN];
> + struct ustctl_integer_type container_type;
> + struct ustctl_enum_entry *entries;
> + unsigned int len;
> + char padding[USTCTL_UST_ENUM_TYPE_PADDING];
> +} LTTNG_PACKED;
> +
> +/* CTF Metadata types for named metadata described outside event
> descriptions */
> +enum ustctl_metadata_types {
> + ustctl_mtype_enum,
> + NR_USTCTL_METADATA_TYPES,
> +};
> +
> +#define USTCTL_UST_NAMED_METADATA_PADDING 640
> +struct ustctl_named_metadata {
> + enum ustctl_metadata_types mtype;
Same comment as for UST: we should change this field to a
fixed-size field (e.g. int32_t). We can still use the enum internally
in the code when interacting with the values read/stored from/into the
field though.
Thanks,
Mathieu
> + union {
> + struct ustctl_enum ctf_enum;
> + char padding[USTCTL_UST_NAMED_METADATA_PADDING];
> + } u;
> +};
> +
> #define USTCTL_UST_FIELD_PADDING 28
> struct ustctl_field {
> char name[LTTNG_UST_SYM_NAME_LEN];
> --
> 1.8.5.3
>
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
More information about the lttng-dev
mailing list