From d16dee89723b8d5826d75073314378162f0f0e3f Mon Sep 17 00:00:00 2001 From: David Goulet Date: Thu, 9 May 2013 11:54:20 -0400 Subject: [PATCH] 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 --- src/bin/lttng/commands/enable_channels.c | 7 +++++++ 1 file changed, 7 insertions(+) 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 ")", -- 2.34.1