Fix: print an error if tracefile-size is missing with count
authorDavid Goulet <dgoulet@efficios.com>
Thu, 9 May 2013 15:54:20 +0000 (11:54 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Thu, 9 May 2013 15:54:20 +0000 (11:54 -0400)
The command will also stop and inform the user that an option is
missing.

Reported-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
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.025616 seconds and 4 git commands to generate.