From 5330763e3853c0549ef3993085ae609456bd84d5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Thu, 20 Apr 2023 11:54:57 -0400 Subject: [PATCH] Clean-up: lttng-stop: move static symbols to anonymous namespace MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau Change-Id: I4cb91315993ffa4f0f53698f7912540fe2aa4075 --- src/bin/lttng/commands/stop.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/bin/lttng/commands/stop.cpp b/src/bin/lttng/commands/stop.cpp index ce66b096a..2d3e7cb9e 100644 --- a/src/bin/lttng/commands/stop.cpp +++ b/src/bin/lttng/commands/stop.cpp @@ -21,23 +21,24 @@ #include #include -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 ; #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 -- 2.34.1