lttng: start: move static symbols to anonymous namespace
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 19 Apr 2023 19:15:26 +0000 (15:15 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 26 Apr 2023 17:55:24 +0000 (13:55 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I295b39aa2f286bc494a0d2eb0b5c8528e0b6afc3

src/bin/lttng/commands/start.cpp

index 556c1120dddc94b86ccba2b9dd7a18ff59f17bd9..1d787ce653a09730448570089f33df2cb77ac7de 100644 (file)
 #include <sys/types.h>
 #include <unistd.h>
 
-static struct mi_writer *writer;
-
-#ifdef LTTNG_EMBED_HELP
-static const char help_msg[] =
-#include <lttng-start.1.h>
-       ;
-#endif
-
 enum {
        OPT_HELP = 1,
        OPT_LIST_OPTIONS,
@@ -36,7 +28,16 @@ enum {
        OPT_ALL,
 };
 
-static struct poptOption long_options[] = {
+namespace {
+struct mi_writer *writer;
+
+#ifdef LTTNG_EMBED_HELP
+const char help_msg[] =
+#include <lttng-start.1.h>
+       ;
+#endif
+
+struct poptOption long_options[] = {
        /* longName, shortName, argInfo, argPtr, value, descrip, argDesc */
        { "help", 'h', POPT_ARG_NONE, nullptr, OPT_HELP, nullptr, nullptr },
        { "list-options", 0, POPT_ARG_NONE, nullptr, OPT_LIST_OPTIONS, nullptr, nullptr },
@@ -45,7 +46,7 @@ static struct poptOption long_options[] = {
        { nullptr, 0, 0, nullptr, 0, nullptr, nullptr }
 };
 
-static int mi_print_session(const char *session_name, int enabled)
+int mi_print_session(const char *session_name, int enabled)
 {
        int ret;
 
@@ -78,7 +79,7 @@ end:
  *
  *  Start tracing for all trace of the session.
  */
-static int start_tracing(const char *session_name)
+int start_tracing(const char *session_name)
 {
        int ret;
 
@@ -117,7 +118,7 @@ error:
        return ret;
 }
 
-static int start_tracing(const struct session_spec& spec)
+int start_tracing(const struct session_spec& spec)
 {
        int ret = CMD_SUCCESS;
        bool had_warning = false;
@@ -148,6 +149,7 @@ static int start_tracing(const struct session_spec& spec)
 
        return ret;
 }
+} /* namespace */
 
 /*
  *  cmd_start
This page took 0.025424 seconds and 4 git commands to generate.