X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fchannel.c;h=7c95a0d2194d4e6de2e43e726b98ee05fcb2d2cd;hp=06a6d616af7a01d4c9207e6d7b86156e2d3b499e;hb=bdf640139afb02572eb23f014e4a61ad68fdfeb1;hpb=e9492550eb58aff5f2a20ffd654fb46f8b9a87ea diff --git a/src/bin/lttng-sessiond/channel.c b/src/bin/lttng-sessiond/channel.c index 06a6d616a..7c95a0d21 100644 --- a/src/bin/lttng-sessiond/channel.c +++ b/src/bin/lttng-sessiond/channel.c @@ -1,5 +1,6 @@ /* * Copyright (C) 2011 - David Goulet + * Copyright (C) 2016 - Jérémie Galarneau * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2 only, @@ -38,6 +39,7 @@ struct lttng_channel *channel_new_default_attr(int dom, enum lttng_buffer_type type) { struct lttng_channel *chan; + const char *channel_name = DEFAULT_CHANNEL_NAME; chan = zmalloc(sizeof(struct lttng_channel)); if (chan == NULL) { @@ -45,12 +47,6 @@ struct lttng_channel *channel_new_default_attr(int dom, goto error_alloc; } - if (snprintf(chan->name, sizeof(chan->name), "%s", - DEFAULT_CHANNEL_NAME) < 0) { - PERROR("snprintf default channel name"); - goto error; - } - /* Same for all domains. */ chan->attr.overwrite = DEFAULT_CHANNEL_OVERWRITE; chan->attr.tracefile_size = DEFAULT_CHANNEL_TRACEFILE_SIZE; @@ -67,7 +63,17 @@ struct lttng_channel *channel_new_default_attr(int dom, chan->attr.read_timer_interval = DEFAULT_KERNEL_CHANNEL_READ_TIMER; chan->attr.live_timer_interval = DEFAULT_KERNEL_CHANNEL_LIVE_TIMER; break; + case LTTNG_DOMAIN_JUL: + channel_name = DEFAULT_JUL_CHANNEL_NAME; + goto common_ust; + case LTTNG_DOMAIN_LOG4J: + channel_name = DEFAULT_LOG4J_CHANNEL_NAME; + goto common_ust; + case LTTNG_DOMAIN_PYTHON: + channel_name = DEFAULT_PYTHON_CHANNEL_NAME; + goto common_ust; case LTTNG_DOMAIN_UST: +common_ust: switch (type) { case LTTNG_BUFFER_PER_UID: chan->attr.subbuf_size = default_get_ust_uid_channel_subbuf_size(); @@ -98,6 +104,11 @@ struct lttng_channel *channel_new_default_attr(int dom, goto error; /* Not implemented */ } + if (snprintf(chan->name, sizeof(chan->name), "%s", + channel_name) < 0) { + PERROR("snprintf default channel name"); + goto error; + } return chan; error: