return -1;
}
-static
-int get_event_type(xmlChar *event_type)
+LTTNG_HIDDEN
+int config_get_event_type(const char *event_type)
{
int ret;
goto error;
}
- if (!strcmp((char *) event_type, config_event_type_all)) {
+ if (!strcmp(event_type, config_event_type_all)) {
ret = LTTNG_EVENT_ALL;
- } else if (!strcmp((char *) event_type, config_event_type_tracepoint)) {
+ } else if (!strcmp(event_type, config_event_type_tracepoint)) {
ret = LTTNG_EVENT_TRACEPOINT;
- } else if (!strcmp((char *) event_type, config_event_type_probe)) {
+ } else if (!strcmp(event_type, config_event_type_probe)) {
ret = LTTNG_EVENT_PROBE;
- } else if (!strcmp((char *) event_type, config_event_type_function)) {
+ } else if (!strcmp(event_type, config_event_type_function)) {
ret = LTTNG_EVENT_FUNCTION;
- } else if (!strcmp((char *) event_type,
+ } else if (!strcmp(event_type,
config_event_type_function_entry)) {
ret = LTTNG_EVENT_FUNCTION_ENTRY;
- } else if (!strcmp((char *) event_type, config_event_type_noop)) {
+ } else if (!strcmp(event_type, config_event_type_noop)) {
ret = LTTNG_EVENT_NOOP;
- } else if (!strcmp((char *) event_type, config_event_type_syscall)) {
+ } else if (!strcmp(event_type, config_event_type_syscall)) {
ret = LTTNG_EVENT_SYSCALL;
} else {
goto error;
goto end;
}
- ret = get_event_type(content);
+ ret = config_get_event_type((char *) content);
free(content);
if (ret < 0) {
ret = -LTTNG_ERR_LOAD_INVALID_CONFIG;
#include <common/config/config-session-abi.h>
#include <common/macros.h>
#include <lttng/domain.h>
+#include <lttng/event.h>
#include <stdint.h>
struct config_entry {
LTTNG_HIDDEN
const char *config_get_domain_str(enum lttng_domain_type domain);
+/*
+ * Return the event_type int value of lttng_event_type enumeration based on the
+ * passed string.
+ */
+LTTNG_HIDDEN
+int config_get_event_type(const char *event_type);
+
/*
* A config_entry_handler_cb receives config_entry structures belonging to the
* sections the handler has been registered to.