X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fcommon%2Fconditions%2Fbuffer-usage.c;h=a97f6d59f74b36b6d9eb9f1ef5c4994968659a00;hb=1aa9c49c60b7d7370ceafc3ac076de423de22b7f;hp=54affe765d682378649d68fb3e20c2721bd5c4aa;hpb=f66473ac08601dfdbed5a33a8d41957293372b45;p=lttng-tools.git diff --git a/src/common/conditions/buffer-usage.c b/src/common/conditions/buffer-usage.c index 54affe765..a97f6d59f 100644 --- a/src/common/conditions/buffer-usage.c +++ b/src/common/conditions/buffer-usage.c @@ -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;