*/
#define _LGPL_SOURCE
+#include "../command.hpp"
+
+#include <common/mi-lttng.hpp>
+#include <common/sessiond-comm/sessiond-comm.hpp>
+
#include <popt.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
-#include <common/sessiond-comm/sessiond-comm.hpp>
-#include <common/mi-lttng.hpp>
-
-#include "../command.hpp"
-
static int opt_no_wait;
static struct mi_writer *writer;
#ifdef LTTNG_EMBED_HELP
static const char help_msg[] =
#include <lttng-stop.1.h>
-;
+ ;
#endif
enum {
static struct poptOption long_options[] = {
/* longName, shortName, argInfo, argPtr, value, descrip, argDesc */
- {"help", 'h', POPT_ARG_NONE, 0, OPT_HELP, 0, 0},
- {"list-options", 0, POPT_ARG_NONE, NULL, OPT_LIST_OPTIONS, NULL, NULL},
- {"no-wait", 'n', POPT_ARG_VAL, &opt_no_wait, 1, 0, 0},
- {0, 0, 0, 0, 0, 0, 0}
+ { "help", 'h', POPT_ARG_NONE, 0, OPT_HELP, 0, 0 },
+ { "list-options", 0, POPT_ARG_NONE, NULL, OPT_LIST_OPTIONS, NULL, NULL },
+ { "no-wait", 'n', POPT_ARG_VAL, &opt_no_wait, 1, 0, 0 },
+ { 0, 0, 0, 0, 0, 0, 0 }
};
/*
}
/* Print session name element */
- ret = mi_lttng_writer_write_element_string(writer, config_element_name,
- session_name);
+ ret = mi_lttng_writer_write_element_string(writer, config_element_name, session_name);
if (ret) {
goto end;
}
/* Is enabled ? */
- ret = mi_lttng_writer_write_element_bool(writer, config_element_enabled,
- enabled);
+ ret = mi_lttng_writer_write_element_bool(writer, config_element_enabled, enabled);
if (ret) {
goto end;
}
}
/* Open command element */
- ret = mi_lttng_writer_command_open(writer,
- mi_lttng_element_command_stop);
+ ret = mi_lttng_writer_command_open(writer, mi_lttng_element_command_stop);
if (ret) {
ret = CMD_ERROR;
goto end;
}
/* Open output element */
- ret = mi_lttng_writer_open_element(writer,
- mi_lttng_element_command_output);
+ ret = mi_lttng_writer_open_element(writer, mi_lttng_element_command_output);
if (ret) {
ret = CMD_ERROR;
goto end;
* Open sessions element
* For validation
*/
- ret = mi_lttng_writer_open_element(writer,
- config_element_sessions);
+ ret = mi_lttng_writer_open_element(writer, config_element_sessions);
if (ret) {
ret = CMD_ERROR;
goto end;
}
/* Success ? */
- ret = mi_lttng_writer_write_element_bool(writer,
- mi_lttng_element_command_success, success);
+ ret = mi_lttng_writer_write_element_bool(
+ writer, mi_lttng_element_command_success, success);
if (ret) {
ret = CMD_ERROR;
goto end;