_UST_CMDW(0x51, struct lttng_ust_channel)
#define LTTNG_UST_SESSION_START _UST_CMD(0x52)
#define LTTNG_UST_SESSION_STOP _UST_CMD(0x53)
+#define LTTNG_UST_SESSION_STATEDUMP _UST_CMD(0x54)
/* Channel FD commands */
#define LTTNG_UST_STREAM _UST_CMD(0x60)
struct lttng_session *lttng_session_create(void);
int lttng_session_enable(struct lttng_session *session);
int lttng_session_disable(struct lttng_session *session);
+int lttng_session_statedump(struct lttng_session *session);
void lttng_session_destroy(struct lttng_session *session);
struct lttng_channel *lttng_channel_create(struct lttng_session *session,
return 0;
}
+/*
+ * Ensure that a state-dump will be performed for this session at the end
+ * of the current handle_message().
+ */
+int lttng_session_statedump(struct lttng_session *session)
+{
+ session->statedump_pending = 1;
+ lttng_ust_sockinfo_session_enabled(session->owner);
+ return 0;
+}
int lttng_session_enable(struct lttng_session *session)
{
CMM_ACCESS_ONCE(session->active) = 1;
CMM_ACCESS_ONCE(session->been_active) = 1;
- session->statedump_pending = 1;
- lttng_ust_sockinfo_session_enabled(session->owner);
+ ret = lttng_session_statedump(session);
+ if (ret)
+ return ret;
end:
return ret;
}
case LTTNG_UST_SESSION_STOP:
case LTTNG_UST_DISABLE:
return lttng_session_disable(session);
+ case LTTNG_UST_SESSION_STATEDUMP:
+ return lttng_session_statedump(session);
default:
return -EINVAL;
}