Add log4j default event and channel name handling
[lttng-tools.git] / src / bin / lttng-sessiond / save.c
index e92ed8d88c2020015041556de8487e710614e415..2c38df97292fd34fc3619d0c8bdc20d15a1ac1d6 100644 (file)
@@ -1056,7 +1056,8 @@ int save_ust_session(struct config_writer *writer,
                int agent_channel;
 
                ust_chan = caa_container_of(node, struct ltt_ust_channel, node);
-               agent_channel = !strcmp(DEFAULT_JUL_CHANNEL_NAME, ust_chan->name);
+               agent_channel = !strcmp(DEFAULT_JUL_CHANNEL_NAME, ust_chan->name) ||
+                       !strcmp(DEFAULT_LOG4J_CHANNEL_NAME, ust_chan->name);
                if (!(save_agent ^ agent_channel)) {
                        ret = save_ust_channel(writer, ust_chan, session->ust_session);
                        if (ret) {
@@ -1139,7 +1140,7 @@ int save_domains(struct config_writer *writer, struct ltt_session *session)
        }
 
        if (session->ust_session &&
-               session->ust_session->agent.being_used) {
+                       lttng_ht_get_count(session->ust_session->agents) > 0) {
                ret = config_writer_open_element(writer,
                        config_element_domain);
                if (ret) {
@@ -1514,7 +1515,7 @@ int save_session(struct ltt_session *session,
        }
        file_opened = 1;
 
-       writer = config_writer_create(fd);
+       writer = config_writer_create(fd, 1);
        if (!writer) {
                ret = LTTNG_ERR_NOMEM;
                goto end;
This page took 0.023956 seconds and 4 git commands to generate.