Clean-up: lttng-stop: move static symbols to anonymous namespace
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 20 Apr 2023 15:54:57 +0000 (11:54 -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: I4cb91315993ffa4f0f53698f7912540fe2aa4075

src/bin/lttng/commands/stop.cpp

index ce66b096a7e591ee4248fd60ed54bbdebc3ebe17..2d3e7cb9e8bd5477311f8dac504edbd6a62bba2b 100644 (file)
 #include <sys/types.h>
 #include <unistd.h>
 
-static int opt_no_wait;
-static struct mi_writer *writer;
+enum {
+       OPT_HELP = 1,
+       OPT_LIST_OPTIONS,
+       OPT_ENABLE_GLOB,
+       OPT_ALL,
+};
 
+namespace {
 #ifdef LTTNG_EMBED_HELP
 static const char help_msg[] =
 #include <lttng-stop.1.h>
        ;
 #endif
 
-enum {
-       OPT_HELP = 1,
-       OPT_LIST_OPTIONS,
-       OPT_ENABLE_GLOB,
-       OPT_ALL,
-};
+int opt_no_wait;
+struct mi_writer *writer;
 
-static struct poptOption long_options[] = {
+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 },
@@ -50,7 +51,7 @@ static struct poptOption long_options[] = {
 /*
  * Mi print of partial session
  */
-static int mi_print_session(const char *session_name, int enabled)
+int mi_print_session(const char *session_name, int enabled)
 {
        int ret;
        LTTNG_ASSERT(writer);
@@ -84,7 +85,7 @@ end:
 /*
  * Start tracing for all trace of the session.
  */
-static int stop_tracing(const char *session_name)
+int stop_tracing(const char *session_name)
 {
        int ret;
 
@@ -135,7 +136,7 @@ error:
        return ret;
 }
 
-static int stop_tracing(const struct session_spec& spec)
+int stop_tracing(const struct session_spec& spec)
 {
        int ret = CMD_SUCCESS;
 
@@ -153,6 +154,7 @@ static int stop_tracing(const struct session_spec& spec)
 
        return ret;
 }
+} /* namespace */
 
 /*
  *  cmd_stop
This page took 0.026503 seconds and 4 git commands to generate.