Fix: print an error if tracefile-size is missing with count
[lttng-tools.git] / src / bin / lttng / commands / enable_channels.c
index caada7deb038efd75a6e953ab730dd1826e47566..49e16abf43f5184c35ad0274e9641096c3853192 100644 (file)
@@ -220,6 +220,13 @@ static int enable_channel(char *session_name)
 
        set_default_attr(&dom);
 
+       if (chan.attr.tracefile_size == 0 && chan.attr.tracefile_count) {
+               ERR("Missing option --tracefile-size. "
+                               "A file count without a size won't do anything.");
+               ret = CMD_ERROR;
+               goto error;
+       }
+
        if ((chan.attr.tracefile_size > 0) &&
                        (chan.attr.tracefile_size < chan.attr.subbuf_size)) {
                WARN("Tracefile size rounded up from (%" PRIu64 ") to subbuffer size (%" PRIu64 ")",
This page took 0.026206 seconds and 5 git commands to generate.