Introduce lttng_domain_type_str utility
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 29 Sep 2020 15:46:24 +0000 (11:46 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 28 Oct 2020 20:41:06 +0000 (16:41 -0400)
Change-Id: I1d2c7be968da6658e93407cdba26a6042177badd
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
include/Makefile.am
include/lttng/domain-internal.h [new file with mode: 0644]
src/common/Makefile.am
src/common/domain.c [new file with mode: 0644]

index 658a567531d877426b0a7252e9989e65831bdf9a..5a3b5b5f3bbcfdbfcf49628d0c28d3091d27f2f2 100644 (file)
@@ -172,6 +172,7 @@ noinst_HEADERS = \
        lttng/endpoint-internal.h \
        lttng/notification/channel-internal.h \
        lttng/channel-internal.h \
+       lttng/domain-internal.h \
        lttng/event-internal.h \
        lttng/rotate-internal.h \
        lttng/ref-internal.h \
diff --git a/include/lttng/domain-internal.h b/include/lttng/domain-internal.h
new file mode 100644 (file)
index 0000000..877fa28
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2020 Simon Marchi <simon.marchi@efficios.com>
+ *
+ * SPDX-License-Identifier: LGPL-2.1-only
+ *
+ */
+
+#ifndef LTTNG_DOMAIN_INTERNAL_H
+#define LTTNG_DOMAIN_INTERNAL_H
+
+#include "lttng/domain.h"
+#include "common/macros.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+LTTNG_HIDDEN
+const char *lttng_domain_type_str(enum lttng_domain_type domain_type);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* LTTNG_DOMAIN_INTERNAL_H */
index f6918b54c79d1d1466f8a34006f4168fc7a31999..0376e59d293d85e255f1ea23ea5e96285c9bd6b4 100644 (file)
@@ -42,6 +42,7 @@ libcommon_la_SOURCES = \
        credentials.c credentials.h \
        daemonize.c daemonize.h \
        defaults.c \
+       domain.c \
        dynamic-array.c dynamic-array.h \
        dynamic-buffer.c dynamic-buffer.h \
        endpoint.c \
diff --git a/src/common/domain.c b/src/common/domain.c
new file mode 100644 (file)
index 0000000..277fc80
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2020 Simon Marchi <simon.marchi@efficios.com>
+ *
+ * SPDX-License-Identifier: LGPL-2.1-only
+ *
+ */
+
+#include "lttng/domain-internal.h"
+#include "common/macros.h"
+
+LTTNG_HIDDEN
+const char *lttng_domain_type_str(enum lttng_domain_type domain_type)
+{
+       switch (domain_type) {
+       case LTTNG_DOMAIN_NONE:
+               return "none";
+       case LTTNG_DOMAIN_KERNEL:
+               return "kernel";
+       case LTTNG_DOMAIN_UST:
+               return "ust";
+       case LTTNG_DOMAIN_JUL:
+               return "jul";
+       case LTTNG_DOMAIN_LOG4J:
+               return "log4j";
+       case LTTNG_DOMAIN_PYTHON:
+               return "python";
+       default:
+               return "???";
+       }
+}
This page took 0.026563 seconds and 4 git commands to generate.