+ goto end;
+ }
+
+ count = lttng_list_sessions(&sessions);
+ if (count < 0) {
+ ret = CMD_ERROR;
+ ERR("%s", lttng_strerror(count));
+ goto end;
+ }
+
+ for (i = 0; i < count; i++) {
+ if (strncmp(sessions[i].name, opt_session_name, NAME_MAX) == 0) {
+ session_found = 1;
+ break;
+ }
+ }
+
+ if (!session_found) {
+ ERR("Session '%s' not found", opt_session_name);
+ ret = CMD_ERROR;