#include "../command.h"
+#include <common/sessiond-comm/sessiond-comm.h>
+
static char *opt_session_name;
enum {
*/
static void usage(FILE *ofp)
{
- fprintf(ofp, "usage: lttng start [options] [NAME]\n");
+ fprintf(ofp, "usage: lttng start [NAME] [OPTIONS]\n");
fprintf(ofp, "\n");
fprintf(ofp, "Where NAME is an optional session name. If not specified, lttng will\n");
fprintf(ofp, "get it from the configuration directory (.lttng).\n");
fprintf(ofp, "\n");
+ fprintf(ofp, "Options:\n");
fprintf(ofp, " -h, --help Show this help\n");
fprintf(ofp, " --list-options Simple listing of options\n");
fprintf(ofp, "\n");
ret = lttng_start_tracing(session_name);
if (ret < 0) {
- /* Don't set ret so lttng can interpret the sessiond error. */
+ switch (-ret) {
+ case LTTNG_ERR_TRACE_ALREADY_STARTED:
+ WARN("Tracing already started for session %s", session_name);
+ break;
+ default:
+ ERR("%s", lttng_strerror(ret));
+ break;
+ }
goto free_name;
}