Implement statedump command in UST
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 14 Apr 2016 19:13:05 +0000 (15:13 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 30 Jun 2016 18:02:38 +0000 (14:02 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/ust-abi.h
include/lttng/ust-events.h
liblttng-ust/lttng-events.c
liblttng-ust/lttng-ust-abi.c

index 8cae00e65ee4e8165ff44b8d5b444f6ee5ded8f1..379e02315ad687fa643a677f4c050f1a6deb960a 100644 (file)
@@ -273,6 +273,7 @@ struct lttng_ust_event_exclusion {
        _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)
index 9f6aa06296bb23744e4ec333f7094114d176c17f..039b2ccba1b5db86726ec0a4512e8c52e10c6139 100644 (file)
@@ -606,6 +606,7 @@ struct lttng_transport {
 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,
index d09c97ca2b1995a7de7d875145f7c9d79573f94e..373995d08e61135bdd71b7991ba10749132d9116 100644 (file)
@@ -384,6 +384,16 @@ int lttng_create_all_ctx_enums(size_t nr_fields,
        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)
 {
@@ -453,8 +463,9 @@ 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;
 }
index 762c9017aca96bf35b9971a8dd3b63409f19f2e3..d8150b6b15627cb2cee21adfabfd315e0a70bc63 100644 (file)
@@ -573,6 +573,8 @@ long lttng_session_cmd(int objd, unsigned int cmd, unsigned long arg,
        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;
        }
This page took 0.029656 seconds and 4 git commands to generate.