X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fcmd.c;h=c1f5a4e70b7ce83545ce0858db2f781b563fdc26;hb=b747c300c074c13b115d7f6d3f35d157e1c33f32;hp=339a7659e5ae63b00d8547d6ac47656cb81e69a8;hpb=2e4e8c2d5207b86e35092e7b6ee3b0d1463138b1;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 339a7659e..c1f5a4e70 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -850,6 +850,16 @@ int cmd_enable_channel(struct ltt_session *session, rcu_read_lock(); + /* + * The ringbuffer (both in user space and kernel) behave badly in overwrite + * mode and with less than 2 subbuf so block it right away and send back an + * invalid attribute error. + */ + if (attr->attr.overwrite && attr->attr.num_subbuf < 2) { + ret = LTTNG_ERR_INVALID; + goto error; + } + switch (domain->type) { case LTTNG_DOMAIN_KERNEL: { @@ -1769,6 +1779,17 @@ int cmd_set_consumer_uri(int domain, struct ltt_session *session, } } + /* + * Make sure to set the session in output mode after we set URI since a + * session can be created without URL (thus flagged in no output mode). + */ + session->output_traces = 1; + if (ksess) { + ksess->output_traces = 1; + } else if (usess) { + usess->output_traces = 1; + } + /* All good! */ ret = LTTNG_OK;