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)
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;
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)
#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 {
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.