X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fchannel.c;h=ae53c672c6c2a5792ba981324f37097e7f596f6d;hp=8b9adfba8370894050c5fd214c64c5282682fed8;hb=95e047ff8e01767e2e18b892f7a1ba9bf28abcbe;hpb=49c336c1679295a31b92223dca05feccfe3e3464 diff --git a/src/bin/lttng-sessiond/channel.c b/src/bin/lttng-sessiond/channel.c index 8b9adfba8..ae53c672c 100644 --- a/src/bin/lttng-sessiond/channel.c +++ b/src/bin/lttng-sessiond/channel.c @@ -54,7 +54,8 @@ struct lttng_channel *channel_new_default_attr(int dom) switch (dom) { case LTTNG_DOMAIN_KERNEL: - chan->attr.subbuf_size = DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE; + chan->attr.subbuf_size = + default_get_kernel_channel_subbuf_size(); chan->attr.num_subbuf = DEFAULT_KERNEL_CHANNEL_SUBBUF_NUM; chan->attr.output = DEFAULT_KERNEL_CHANNEL_OUTPUT; break; @@ -64,7 +65,7 @@ struct lttng_channel *channel_new_default_attr(int dom) case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN: case LTTNG_DOMAIN_UST_EXEC_NAME: #endif - chan->attr.subbuf_size = DEFAULT_UST_CHANNEL_SUBBUF_SIZE; + chan->attr.subbuf_size = default_get_ust_channel_subbuf_size(); chan->attr.num_subbuf = DEFAULT_UST_CHANNEL_SUBBUF_NUM; chan->attr.output = DEFAULT_UST_CHANNEL_OUTPUT; break; @@ -239,6 +240,11 @@ int channel_ust_create(struct ltt_ust_session *usess, int domain, attr = defattr; } + if (attr->attr.subbuf_size < DEFAULT_UST_CHANNEL_SUBBUF_SIZE) { + ret = LTTNG_ERR_INVALID; + goto error; + } + /* * Validate UST buffer size and number of buffers: must both be * power of 2 and nonzero. We validate right here for UST,