condition: buffer usage: validation does not check for ratio and bytes threshold
[lttng-tools.git] / src / common / conditions / buffer-usage.c
index 54affe765d682378649d68fb3e20c2721bd5c4aa..a97f6d59f74b36b6d9eb9f1ef5c4994968659a00 100644 (file)
@@ -62,8 +62,8 @@ bool lttng_condition_buffer_usage_validate(
                ERR("Invalid buffer condition: a target channel name must be set.");
                goto end;
        }
-       if (!usage->threshold_ratio.set && !usage->threshold_bytes.set) {
-               ERR("Invalid buffer condition: a threshold must be set.");
+       if (usage->threshold_ratio.set == usage->threshold_bytes.set) {
+               ERR("Invalid buffer condition: a threshold must be set or both type cannot be used simultaneously.");
                goto end;
        }
        if (!usage->domain.set) {
@@ -84,7 +84,7 @@ int lttng_condition_buffer_usage_serialize(
        int ret;
        struct lttng_condition_buffer_usage *usage;
        size_t session_name_len, channel_name_len;
-       struct lttng_condition_buffer_usage_comm usage_comm;
+       struct lttng_condition_buffer_usage_comm usage_comm = {};
 
        if (!condition || !IS_USAGE_CONDITION(condition)) {
                ret = -1;
This page took 0.024468 seconds and 5 git commands to generate.