Add variant type support to ust registry and metadata
[lttng-tools.git] / src / bin / lttng-sessiond / ust-registry.c
index 80ea2e57054de736ac0801b01d4ed0bb8b0cb6a5..1990655ef638368955a52b1f705422cc606db20b 100644 (file)
@@ -188,12 +188,22 @@ int validate_event_field(struct ustctl_field *field,
                const char *event_name,
                struct ust_app *app)
 {
+       int ret = 0;
+
        switch(field->type.atype) {
        case ustctl_atype_integer:
        case ustctl_atype_enum:
        case ustctl_atype_array:
        case ustctl_atype_sequence:
        case ustctl_atype_string:
+       case ustctl_atype_variant:
+               break;
+       case ustctl_atype_struct:
+               if (field->type.u._struct.nr_fields != 0) {
+                       WARN("Unsupported non-empty struct field.");
+                       ret = -EINVAL;
+                       goto end;
+               }
                break;
 
        case ustctl_atype_float:
@@ -205,16 +215,19 @@ int validate_event_field(struct ustctl_field *field,
                                field->type.u.basic._float.mant_dig,
                                field->name,
                                event_name);
-                       return -EINVAL;
+                       ret = -EINVAL;
+                       goto end;
                default:
                        break;
                }
                break;
 
        default:
-               return -ENOENT;
+               ret = -ENOENT;
+               goto end;
        }
-       return 0;
+end:
+       return ret;
 }
 
 static
This page took 0.023202 seconds and 4 git commands to generate.