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);
+ uchan = trace_ust_create_channel(attr);
if (uchan == NULL) {
ret = LTTNG_ERR_FATAL;
goto error;