#include <string.h>
#include <unistd.h>
-#include <common/sessiond-comm/sessiond-comm.h>
-#include <common/lttngerr.h>
#include <common/common.h>
#include <common/defaults.h>
+#include <common/sessiond-comm/sessiond-comm.h>
#include "channel.h"
#include "kernel.h"
chan->attr.output = DEFAULT_KERNEL_CHANNEL_OUTPUT;
break;
case LTTNG_DOMAIN_UST:
+#if 0
case LTTNG_DOMAIN_UST_PID:
+ 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.num_subbuf = DEFAULT_UST_CHANNEL_SUBBUF_NUM;
chan->attr.output = DEFAULT_UST_CHANNEL_OUTPUT;
/* Enable channel for global domain */
ret = ust_app_enable_channel_glb(usess, uchan);
break;
+#if 0
case LTTNG_DOMAIN_UST_PID:
case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN:
case LTTNG_DOMAIN_UST_EXEC_NAME:
- ret = LTTCOMM_NOT_IMPLEMENTED;
+#endif
+ default:
+ ret = LTTCOMM_UND;
goto error;
}
attr = defattr;
}
+ /*
+ * Validate UST buffer size and number of buffers: must both be
+ * power of 2 and nonzero. We validate right here for UST,
+ * because applications will not report the error to the user
+ * (unlike kernel tracing).
+ */
+ if (!attr->attr.subbuf_size || (attr->attr.subbuf_size & (attr->attr.subbuf_size - 1))) {
+ ret = LTTCOMM_INVALID;
+ goto error;
+ }
+ if (!attr->attr.num_subbuf || (attr->attr.num_subbuf & (attr->attr.num_subbuf - 1))) {
+ ret = LTTCOMM_INVALID;
+ goto error;
+ }
+
/* Create UST channel */
uchan = trace_ust_create_channel(attr, usess->pathname);
if (uchan == NULL) {
/* Enable channel for global domain */
ret = ust_app_create_channel_glb(usess, uchan);
break;
+#if 0
case LTTNG_DOMAIN_UST_PID:
case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN:
case LTTNG_DOMAIN_UST_EXEC_NAME:
+#endif
default:
- ret = LTTCOMM_NOT_IMPLEMENTED;
+ ret = LTTCOMM_UND;
goto error_free_chan;
}
/* Disable channel for global domain */
ret = ust_app_disable_channel_glb(usess, uchan);
break;
+#if 0
case LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN:
case LTTNG_DOMAIN_UST_EXEC_NAME:
case LTTNG_DOMAIN_UST_PID:
- ret = LTTCOMM_NOT_IMPLEMENTED;
+#endif
+ default:
+ ret = LTTCOMM_UND;
goto error;
}