Notify java agent of enabled application contexts
[lttng-tools.git] / src / bin / lttng-sessiond / channel.c
index 06a6d616af7a01d4c9207e6d7b86156e2d3b499e..7c95a0d2194d4e6de2e43e726b98ee05fcb2d2cd 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
+ * Copyright (C) 2016 - Jérémie Galarneau <jeremie.galarneau@efficios.com>
  *
  * 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:
This page took 0.0248 seconds and 5 git commands to generate.