X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fbin%2Flttng-relayd%2Fmain.c;h=3b9f6708a3685e61e0a6918e94732046a9b9151f;hb=ae9c20bc3d88d014d850b9e9b7df6b0f1e7ff894;hp=156fc83ee6d534599bbb6d44a1b747099eeb08c2;hpb=be96a7d15e24cd8742c404cf3a76d14c75b00f06;p=lttng-tools.git diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c index 156fc83ee..3b9f6708a 100644 --- a/src/bin/lttng-relayd/main.c +++ b/src/bin/lttng-relayd/main.c @@ -105,12 +105,12 @@ static void usage(void) { fprintf(stderr, "Usage: %s OPTIONS\n\nOptions:\n", progname); - fprintf(stderr, " -h, --help Display this usage.\n"); - fprintf(stderr, " -d, --daemonize Start as a daemon.\n"); - fprintf(stderr, " -C, --control-port Control port listening (URI)\n"); - fprintf(stderr, " -D, --data-port Data port listening (URI)\n"); - fprintf(stderr, " -o, --output Output path for traces (PATH)\n"); - fprintf(stderr, " -v, --verbose Verbose mode. Activate DBG() macro.\n"); + fprintf(stderr, " -h, --help Display this usage.\n"); + fprintf(stderr, " -d, --daemonize Start as a daemon.\n"); + fprintf(stderr, " -C, --control-port URL Control port listening.\n"); + fprintf(stderr, " -D, --data-port URL Data port listening.\n"); + fprintf(stderr, " -o, --output PATH Output path for traces. Must use an absolute path.\n"); + fprintf(stderr, " -v, --verbose Verbose mode. Activate DBG() macro.\n"); } static @@ -1636,6 +1636,8 @@ int relay_process_data(struct relay_command *cmd, struct lttng_ht *streams_ht) goto end; } stream->fd = ret; + /* Reset current size because we just perform a stream rotation. */ + stream->tracefile_size_current = 0; } stream->tracefile_size_current += data_size; do { @@ -2069,6 +2071,11 @@ int main(int argc, char **argv) /* Try to create directory if -o, --output is specified. */ if (opt_output_path) { + if (*opt_output_path != '/') { + ERR("Please specify an absolute path for -o, --output PATH"); + goto exit; + } + ret = utils_mkdir_recursive(opt_output_path, S_IRWXU | S_IRWXG); if (ret < 0) { ERR("Unable to create %s", opt_output_path);