Move get_config_domain_str to session-config
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Wed, 22 Jun 2016 22:07:40 +0000 (18:07 -0400)
committerJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Mon, 11 Jul 2016 15:20:32 +0000 (11:20 -0400)
rename it to config_get_domaain_str

src/bin/lttng-sessiond/save.c
src/common/config/session-config.c
src/common/config/session-config.h

index 7c72ff790cbae050260c80887ed1cd49ae703243..3bd838a648ae3c7abc7dc6cf4ab499ef48cfc076 100644 (file)
@@ -1283,34 +1283,6 @@ end:
        return ret;
 }
 
-static
-const char *get_config_domain_str(enum lttng_domain_type domain)
-{
-       const char *str_dom;
-
-       switch (domain) {
-       case LTTNG_DOMAIN_KERNEL:
-               str_dom = config_domain_type_kernel;
-               break;
-       case LTTNG_DOMAIN_UST:
-               str_dom = config_domain_type_ust;
-               break;
-       case LTTNG_DOMAIN_JUL:
-               str_dom = config_domain_type_jul;
-               break;
-       case LTTNG_DOMAIN_LOG4J:
-               str_dom = config_domain_type_log4j;
-               break;
-       case LTTNG_DOMAIN_PYTHON:
-               str_dom = config_domain_type_python;
-               break;
-       default:
-               assert(0);
-       }
-
-       return str_dom;
-}
-
 static
 int save_pid_tracker(struct config_writer *writer,
        struct ltt_session *sess, int domain)
@@ -1425,7 +1397,7 @@ int save_ust_domain(struct config_writer *writer,
                goto end;
        }
 
-       config_domain_name = get_config_domain_str(domain);
+       config_domain_name = config_get_domain_str(domain);
        if (!config_domain_name) {
                ret = LTTNG_ERR_INVALID;
                goto end;
index f250a6743194ace3424000b2007e42be2e748077..0b731867d31a5eab000bf301f25a94180274a305 100644 (file)
@@ -220,6 +220,34 @@ end:
        return ret;
 }
 
+LTTNG_HIDDEN
+const char *config_get_domain_str(enum lttng_domain_type domain)
+{
+       const char *str_dom;
+
+       switch (domain) {
+       case LTTNG_DOMAIN_KERNEL:
+               str_dom = config_domain_type_kernel;
+               break;
+       case LTTNG_DOMAIN_UST:
+               str_dom = config_domain_type_ust;
+               break;
+       case LTTNG_DOMAIN_JUL:
+               str_dom = config_domain_type_jul;
+               break;
+       case LTTNG_DOMAIN_LOG4J:
+               str_dom = config_domain_type_log4j;
+               break;
+       case LTTNG_DOMAIN_PYTHON:
+               str_dom = config_domain_type_python;
+               break;
+       default:
+               assert(0);
+       }
+
+       return str_dom;
+}
+
 LTTNG_HIDDEN
 int config_get_section_entries(const char *override_path, const char *section,
                config_entry_handler_cb handler, void *user_data)
index 7b068e838c1da68f782e5e8b3b225b0dbbec2ab6..af3d6ff85260b0021018b4fa82ae2541d7ef8f91 100644 (file)
@@ -21,6 +21,7 @@
 #include <common/config/ini.h>
 #include <common/config/config-session-abi.h>
 #include <common/macros.h>
+#include <lttng/domain.h>
 #include <stdint.h>
 
 struct config_entry {
@@ -38,6 +39,12 @@ struct config_document;
 
 struct config_element;
 
+/*
+ * Return the config string representation of a kernel type.
+ */
+LTTNG_HIDDEN
+const char *config_get_domain_str(enum lttng_domain_type domain);
+
 /*
  * A config_entry_handler_cb receives config_entry structures belonging to the
  * sections the handler has been registered to.
This page took 0.042875 seconds and 5 git commands to generate.