/*
* Return allocated channel attributes.
*/
-static struct lttng_channel *init_default_attr(int dom)
+struct lttng_channel *channel_new_default_attr(int dom)
{
struct lttng_channel *chan;
/* Creating channel attributes if needed */
if (attr == NULL) {
- attr = init_default_attr(LTTNG_DOMAIN_KERNEL);
+ attr = channel_new_default_attr(LTTNG_DOMAIN_KERNEL);
if (attr == NULL) {
ret = LTTCOMM_FATAL;
goto error;
/* Creating channel attributes if needed */
if (attr == NULL) {
- attr = init_default_attr(LTTNG_DOMAIN_UST_PID);
+ attr = channel_new_default_attr(LTTNG_DOMAIN_UST_PID);
if (attr == NULL) {
ret = LTTCOMM_FATAL;
goto error;
int channel_ust_enable(struct ltt_ust_session *usession,
struct ltt_ust_channel *uchan, int sock);
+struct lttng_channel *channel_new_default_attr(int domain);
+
#endif /* _LTT_CHANNEL_H */
{
int ret;
struct ltt_kernel_channel *kchan;
+ struct lttng_channel *attr;
switch (domain) {
case LTTNG_DOMAIN_KERNEL:
kchan = trace_kernel_get_channel_by_name(channel_name,
session->kernel_session);
if (kchan == NULL) {
+ attr = channel_new_default_attr(domain);
+ if (attr == NULL) {
+ ret = LTTCOMM_FATAL;
+ goto error;
+ }
+ snprintf(attr->name, NAME_MAX, "%s", channel_name);
+
/* This call will notify the kernel thread */
ret = channel_kernel_create(session->kernel_session,
- NULL, kernel_poll_pipe[1]);
+ attr, kernel_poll_pipe[1]);
if (ret != LTTCOMM_OK) {
goto error;
}