X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fview.cpp;fp=src%2Fbin%2Flttng%2Fcommands%2Fview.cpp;h=d2ac61bb57365f2039188ac12565f88408c8b8cb;hp=cff6941f58b96933bd7cde48bdf257536338045a;hb=28ab034a2c3582d07d3423d2d746731f87d3969f;hpb=52e345b9ac912d033c2a2c25a170a01cf209839d diff --git a/src/bin/lttng/commands/view.cpp b/src/bin/lttng/commands/view.cpp index cff6941f5..d2ac61bb5 100644 --- a/src/bin/lttng/commands/view.cpp +++ b/src/bin/lttng/commands/view.cpp @@ -6,6 +6,10 @@ */ #define _LGPL_SOURCE +#include "../command.hpp" + +#include + #include #include #include @@ -14,16 +18,13 @@ #include #include -#include -#include "../command.hpp" - static char *opt_viewer; static char *opt_trace_path; #ifdef LTTNG_EMBED_HELP static const char help_msg[] = #include -; + ; #endif enum { @@ -33,11 +34,11 @@ 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}, - {"viewer", 'e', POPT_ARG_STRING, &opt_viewer, 0, 0, 0}, - {"trace-path", 't', POPT_ARG_STRING, &opt_trace_path, 0, 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 }, + { "viewer", 'e', POPT_ARG_STRING, &opt_viewer, 0, 0, 0 }, + { "trace-path", 't', POPT_ARG_STRING, &opt_trace_path, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0 } }; /* Is the session we are trying to view is in live mode. */ @@ -58,8 +59,7 @@ static char *build_live_path(char *session_name) goto error; } - ret = asprintf(&path, "net://localhost/host/%s/%s", hostname, - session_name); + ret = asprintf(&path, "net://localhost/host/%s/%s", hostname, session_name); if (ret < 0) { PERROR("asprintf live path"); goto error; @@ -122,8 +122,7 @@ static int view_trace(const char *arg_session_name) /* Getting all sessions */ count = lttng_list_sessions(&sessions); if (count < 0) { - ERR("Unable to list sessions. Session name %s not found.", - session_name); + ERR("Unable to list sessions. Session name %s not found.", session_name); MSG("Is there a session daemon running?"); ret = CMD_ERROR; goto free_error; @@ -149,7 +148,7 @@ static int view_trace(const char *arg_session_name) if (sessions[i].enabled && !session_live_mode) { WARN("Session %s is running. Please stop it before reading it.", - session_name); + session_name); ret = CMD_ERROR; goto free_sessions; }