From: David Goulet Date: Thu, 9 May 2013 15:54:20 +0000 (-0400) Subject: Fix: print an error if tracefile-size is missing with count X-Git-Tag: v2.2.0-rc3~91 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=d16dee89723b8d5826d75073314378162f0f0e3f;p=lttng-tools.git Fix: print an error if tracefile-size is missing with count The command will also stop and inform the user that an option is missing. Reported-by: Christian Babeux Signed-off-by: David Goulet --- diff --git a/src/bin/lttng/commands/enable_channels.c b/src/bin/lttng/commands/enable_channels.c index caada7deb..49e16abf4 100644 --- a/src/bin/lttng/commands/enable_channels.c +++ b/src/bin/lttng/commands/enable_channels.c @@ -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 ")",