Add -j/--jul to lttng UI and ABI
[lttng-tools.git] / src / bin / lttng / utils.c
index e40c3fd708e3d4c3d18bfcc7a0e8be1b7ee89ea3..556728da23773f19935d0ea8b484a1b2cf901664 100644 (file)
@@ -16,6 +16,7 @@
  */
 
 #define _GNU_SOURCE
+#include <assert.h>
 #include <stdlib.h>
 #include <ctype.h>
 #include <limits.h>
 #include "utils.h"
 #include "command.h"
 
+static const char *str_kernel = "Kernel";
+static const char *str_ust = "UST";
+static const char *str_jul = "JUL";
+
 /*
  *  get_session_name
  *
@@ -249,3 +254,25 @@ int get_count_order_ulong(unsigned long x)
 
        return fls_ulong(x - 1);
 }
+
+const char *get_domain_str(enum lttng_domain_type domain)
+{
+       const char *str_dom;
+
+       switch (domain) {
+       case LTTNG_DOMAIN_KERNEL:
+               str_dom = str_kernel;
+               break;
+       case LTTNG_DOMAIN_UST:
+               str_dom = str_ust;
+               break;
+       case LTTNG_DOMAIN_JUL:
+               str_dom = str_jul;
+               break;
+       default:
+               /* Should not have an unknown domain or else define it. */
+               assert(0);
+       }
+
+       return str_dom;
+}
This page took 0.025515 seconds and 5 git commands to generate.