X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fchannel.c;h=bb5b3d1de32cc00c19cba668a060d26982dc774f;hb=a74934bae19f96845f7af4b95a8fae5c2f860747;hp=6c7422b292dcb3ffd21665468c0f15cc6a728180;hpb=7972aab22f74b18faa168c0482216a3dd711a075;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/channel.c b/src/bin/lttng-sessiond/channel.c index 6c7422b29..bb5b3d1de 100644 --- a/src/bin/lttng-sessiond/channel.c +++ b/src/bin/lttng-sessiond/channel.c @@ -272,6 +272,26 @@ int channel_ust_create(struct ltt_ust_session *usess, goto error; } + /* + * The tracefile_size should not be < to the subbuf_size, otherwise + * we won't be able to write the packets on disk + */ + if ((attr->attr.tracefile_size > 0) && + (attr->attr.tracefile_size < attr->attr.subbuf_size)) { + ret = LTTNG_ERR_INVALID; + goto error; + } + + /* Validate buffer type. */ + switch (type) { + case LTTNG_BUFFER_PER_PID: + case LTTNG_BUFFER_PER_UID: + break; + default: + ret = LTTNG_ERR_BUFFER_NOT_SUPPORTED; + goto error; + } + /* Create UST channel */ uchan = trace_ust_create_channel(attr, usess->pathname); if (uchan == NULL) {