Fix: loading of live session within userspace domains
[lttng-tools.git] / src / common / config / session-config.c
index 8a0a95157f4a8a28955f2a1938090c9216e567eb..48094c59a427f9636e5b222c09bd85c6b5c3a0d9 100644 (file)
@@ -95,23 +95,23 @@ const char * const config_element_output_type = "output_type";
 const char * const config_element_tracefile_size = "tracefile_size";
 const char * const config_element_tracefile_count = "tracefile_count";
 const char * const config_element_live_timer_interval = "live_timer_interval";
-const char * const config_element_discarded_events = "discarded_events";
-const char * const config_element_lost_packets = "lost_packets";
+LTTNG_HIDDEN const char * const config_element_discarded_events = "discarded_events";
+LTTNG_HIDDEN const char * const config_element_lost_packets = "lost_packets";
 const char * const config_element_type = "type";
 const char * const config_element_buffer_type = "buffer_type";
 const char * const config_element_session = "session";
 const char * const config_element_sessions = "sessions";
-const char * const config_element_context_perf = "perf";
-const char * const config_element_context_app = "app";
-const char * const config_element_context_app_provider_name = "provider_name";
-const char * const config_element_context_app_ctx_name = "ctx_name";
+LTTNG_HIDDEN const char * const config_element_context_perf = "perf";
+LTTNG_HIDDEN const char * const config_element_context_app = "app";
+LTTNG_HIDDEN const char * const config_element_context_app_provider_name = "provider_name";
+LTTNG_HIDDEN const char * const config_element_context_app_ctx_name = "ctx_name";
 const char * const config_element_config = "config";
 const char * const config_element_started = "started";
 const char * const config_element_snapshot_mode = "snapshot_mode";
 const char * const config_element_loglevel = "loglevel";
 const char * const config_element_loglevel_type = "loglevel_type";
 const char * const config_element_filter = "filter";
-const char * const config_element_filter_expression = "filter_expression";
+LTTNG_HIDDEN const char * const config_element_filter_expression = "filter_expression";
 const char * const config_element_snapshot_outputs = "snapshot_outputs";
 const char * const config_element_consumer_output = "consumer_output";
 const char * const config_element_destination = "destination";
@@ -171,11 +171,11 @@ const char * const config_event_context_pthread_id = "PTHREAD_ID";
 const char * const config_event_context_hostname = "HOSTNAME";
 const char * const config_event_context_ip = "IP";
 const char * const config_event_context_perf_thread_counter = "PERF_THREAD_COUNTER";
-const char * const config_event_context_app = "APP";
-const char * const config_event_context_interruptible = "INTERRUPTIBLE";
-const char * const config_event_context_preemptible = "PREEMPTIBLE";
-const char * const config_event_context_need_reschedule = "NEED_RESCHEDULE";
-const char * const config_event_context_migratable = "MIGRATABLE";
+LTTNG_HIDDEN const char * const config_event_context_app = "APP";
+LTTNG_HIDDEN const char * const config_event_context_interruptible = "INTERRUPTIBLE";
+LTTNG_HIDDEN const char * const config_event_context_preemptible = "PREEMPTIBLE";
+LTTNG_HIDDEN const char * const config_event_context_need_reschedule = "NEED_RESCHEDULE";
+LTTNG_HIDDEN const char * const config_event_context_migratable = "MIGRATABLE";
 
 struct consumer_output {
        int enabled;
@@ -1151,17 +1151,16 @@ end:
 }
 
 static
-int create_session_net_output(const char *name, struct lttng_domain *domain,
-       const char *control_uri, const char *data_uri)
+int create_session_net_output(const char *name, const char *control_uri,
+               const char *data_uri)
 {
        int ret;
        struct lttng_handle *handle;
        const char *uri = NULL;
 
        assert(name);
-       assert(domain);
 
-       handle = lttng_create_handle(name, domain);
+       handle = lttng_create_handle(name, NULL);
        if (!handle) {
                ret = -LTTNG_ERR_NOMEM;
                goto end;
@@ -1343,11 +1342,6 @@ int create_session(const char *name,
        }
 
        if (output.control_uri || output.data_uri) {
-               int i;
-               struct lttng_domain *domain;
-               struct lttng_domain *domains[] =
-                       { kernel_domain, ust_domain, jul_domain, log4j_domain };
-
                /* network destination */
                if (live_timer_interval && live_timer_interval != UINT64_MAX) {
                        /*
@@ -1363,18 +1357,12 @@ int create_session(const char *name,
                        goto end;
                }
 
-               for (i = 0; i < (sizeof(domains) / sizeof(domains[0])); i++) {
-                       domain = domains[i];
-                       if (!domain) {
-                               continue;
-                       }
-
-                       ret = create_session_net_output(name, domain, output.control_uri,
-                                       output.data_uri);
-                       if (ret) {
-                               goto end;
-                       }
+               ret = create_session_net_output(name, output.control_uri,
+                               output.data_uri);
+               if (ret) {
+                       goto end;
                }
+
        } else {
                /* either local output or no output */
                ret = lttng_create_session(name, output.path);
This page took 0.024973 seconds and 4 git commands to generate.