/* Prototypes */
static int process_client_opt(void);
static int process_opt_list_apps(void);
+static int process_opt_list_sessions(void);
static void sighandler(int sig);
static int set_signal_handler(void);
}
}
+ if (opt_list_session) {
+ ret = process_opt_list_sessions();
+ if (ret < 0) {
+ goto end;
+ }
+ }
+
return 0;
end:
return ret;
}
+/*
+ * process_opt_list_sessions
+ *
+ * Get the list of available sessions from
+ * the session daemon and print it to user.
+ */
+static int process_opt_list_sessions(void)
+{
+ int ret, count, i;
+ struct lttng_session *sess;
+
+ count = lttng_list_sessions(&sess);
+ if (count < 0) {
+ ret = count;
+ goto error;
+ }
+
+ MSG("Available sessions [Name (uuid)]:");
+ for (i = 0; i < count; i++) {
+ MSG("\tName: %s (uuid: %s)", sess[i].name, sess[i].uuid);
+ }
+
+ free(sess);
+ MSG("\nTo select a session, use --session UUID.");
+
+ return 0;
+
+error:
+ return ret;
+}
+
/*
* process_opt_list_apps
*
/* Spawn session daemon and tell
* it to signal us when ready.
*/
- ret = execlp(pathname, "ltt-sessiond", "--sig-parent", NULL);
+ ret = execlp(pathname, "ltt-sessiond", "--sig-parent", "--quiet", NULL);
if (ret < 0) {
if (errno == ENOENT) {
ERR("No session daemon found. Use --sessiond-path.");