+/*
+ * destroy_all_sessions
+ *
+ * Call destroy_sessions for each registered sessions
+ */
+static int destroy_all_sessions()
+{
+ int count, i, ret = CMD_SUCCESS;
+ struct lttng_session *sessions;
+
+ count = lttng_list_sessions(&sessions);
+ if (count == 0) {
+ MSG("No session found, nothing to do.");
+ }
+ for (i = 0; i < count; i++) {
+ ret = destroy_session(sessions[i].name);
+ if (ret < 0) {
+ goto error;
+ }