actions: introduce snapshot session action
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 2 Dec 2019 20:20:38 +0000 (15:20 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 12 Jun 2020 20:23:10 +0000 (16:23 -0400)
This patch introduces the API for the "snapshot session" action.

A snapshot session action is created using the
lttng_action_snapshot_session_create function. It is mandatory to set a
session name using lttng_action_snapshot_session_set_session_name before
using the action in a trigger.

It is possible, but optional, to provide a snapshot name with
lttng_action_snapshot_session_set_snapshot_name.

The patch adds the code for serializing the action and deserializing it
on the sessiond side, but not the code for executing it.

Change-Id: I2b76680d44bf69eb705f2a238fffef2519b82534
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
include/Makefile.am
include/lttng/action/action.h
include/lttng/action/snapshot-session-internal.h [new file with mode: 0644]
include/lttng/action/snapshot-session.h [new file with mode: 0644]
include/lttng/lttng.h
include/lttng/snapshot-internal.h
src/common/Makefile.am
src/common/actions/action.c
src/common/actions/snapshot-session.c [new file with mode: 0644]
src/common/snapshot.c
src/common/snapshot.h

index 21efe4076c7a4056f03dac8471739c7a1c6f936a..af89a3372d644b5ef621dba715ab5972a710aeea 100644 (file)
@@ -123,6 +123,7 @@ lttngactioninclude_HEADERS= \
        lttng/action/action.h \
        lttng/action/notify.h \
        lttng/action/rotate-session.h \
+       lttng/action/snapshot-session.h \
        lttng/action/start-session.h \
        lttng/action/stop-session.h
 
@@ -148,6 +149,7 @@ noinst_HEADERS = \
        lttng/action/action-internal.h \
        lttng/action/notify-internal.h \
        lttng/action/rotate-session-internal.h \
+       lttng/action/snapshot-session-internal.h \
        lttng/action/start-session-internal.h \
        lttng/action/stop-session-internal.h \
        lttng/condition/condition-internal.h \
index 03f2964f3ae08cef8c2d265a2bfaffade7e78217..3cd2460f80e6c698be3f2fe02734611e2301f007 100644 (file)
@@ -20,6 +20,7 @@ enum lttng_action_type {
        LTTNG_ACTION_TYPE_START_SESSION = 1,
        LTTNG_ACTION_TYPE_STOP_SESSION = 2,
        LTTNG_ACTION_TYPE_ROTATE_SESSION = 3,
+       LTTNG_ACTION_TYPE_SNAPSHOT_SESSION = 4,
 };
 
 enum lttng_action_status {
diff --git a/include/lttng/action/snapshot-session-internal.h b/include/lttng/action/snapshot-session-internal.h
new file mode 100644 (file)
index 0000000..87fbfa4
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2019 Simon Marchi <simon.marchi@efficios.com>
+ *
+ * SPDX-License-Identifier: LGPL-2.1-only
+ *
+ */
+
+#ifndef LTTNG_ACTION_SNAPSHOT_SESSION_INTERNAL_H
+#define LTTNG_ACTION_SNAPSHOT_SESSION_INTERNAL_H
+
+#include <sys/types.h>
+
+#include <common/macros.h>
+
+struct lttng_action;
+struct lttng_payload_view;
+
+/*
+ * Create a "snapshot session" action from a payload view.
+ *
+ * On success, return the number of bytes consumed from `view`, and the created
+ * action in `*action`. On failure, return -1.
+ */
+LTTNG_HIDDEN
+extern ssize_t lttng_action_snapshot_session_create_from_payload(
+               struct lttng_payload_view *view,
+               struct lttng_action **action);
+
+#endif /* LTTNG_ACTION_SNAPSHOT_SESSION_INTERNAL_H */
diff --git a/include/lttng/action/snapshot-session.h b/include/lttng/action/snapshot-session.h
new file mode 100644 (file)
index 0000000..f8d7ee3
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2019 Simon Marchi <simon.marchi@efficios.com>
+ *
+ * SPDX-License-Identifier: LGPL-2.1-only
+ *
+ */
+
+#ifndef LTTNG_ACTION_SNAPSHOT_SESSION_H
+#define LTTNG_ACTION_SNAPSHOT_SESSION_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct lttng_action;
+struct lttng_snapshot_output;
+
+/*
+ * Create a newly allocated snapshot-session action object.
+ *
+ * A snapshot session action object must have a session name set to be
+ * considered valid when used with a trigger object (lttng_trigger). A name can
+ * be set using `lttng_action_snapshot_session_set_session_name`.
+ *
+ * Returns a new action on success, NULL on failure. This action must be
+ * destroyed using lttng_action_destroy().
+ */
+extern struct lttng_action *lttng_action_snapshot_session_create(void);
+
+/*
+ * Set the session name of an lttng_action object of type
+ * LTTNG_ACTION_TYPE_SNAPSHOT_SESSION.
+ */
+extern enum lttng_action_status lttng_action_snapshot_session_set_session_name(
+               struct lttng_action *action, const char *session_name);
+
+/*
+ * Get the session name of an lttng_action object of type
+ * LTTNG_ACTION_TYPE_SNAPSHOT_SESSION.
+ */
+extern enum lttng_action_status lttng_action_snapshot_session_get_session_name(
+               const struct lttng_action *action, const char **session_name);
+
+/*
+ * Set an explicit snapshot output for this snapshot session action.
+ *
+ * The given snapshot output will be used instead of the session's
+ * default snapshot output.
+ *
+ * This function takes ownership of the given snapshot output.
+ */
+extern enum lttng_action_status lttng_action_snapshot_session_set_output(
+               struct lttng_action *action,
+               struct lttng_snapshot_output *output);
+
+/*
+ * Get the explicit snapshot output for this snapshot session action.
+ */
+extern enum lttng_action_status lttng_action_snapshot_session_get_output(
+               const struct lttng_action *action,
+               const struct lttng_snapshot_output **output);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* LTTNG_ACTION_SNAPSHOT_SESSION_H */
index b3465cb936c087a055794ea097dfb7bce75ae32b..f22fad5530294ebfa162f268d93262f8c4cfe991 100644 (file)
@@ -19,6 +19,7 @@
 #include <lttng/action/action.h>
 #include <lttng/action/notify.h>
 #include <lttng/action/rotate-session.h>
+#include <lttng/action/snapshot-session.h>
 #include <lttng/action/start-session.h>
 #include <lttng/action/stop-session.h>
 #include <lttng/channel.h>
index 72d4922375c1c029420184aeceeb291ee77bae3d..8012a1e4ea58303456f4d6c23fb0e624e3f7278f 100644 (file)
@@ -50,7 +50,7 @@ struct lttng_snapshot_output_list {
        size_t count;
 
        /*
-        * Containes snapshot output object.
+        * Contains snapshot output object.
         */
        struct lttng_snapshot_output *array;
 };
index 5b186ce1f1e95f7efea53a1b70a19cfd6b6b82ed..f8a207534bc0bd1425db36df2746578da618c461 100644 (file)
@@ -30,6 +30,7 @@ libcommon_la_SOURCES = \
        actions/action.c \
        actions/notify.c \
        actions/rotate-session.c \
+       actions/snapshot-session.c \
        actions/start-session.c \
        actions/stop-session.c \
        buffer-usage.c \
index c6b57b9cff5c7a50a42325b68b5d8e3175f27794..7325a532c8ae15078ee9cc82907a8906dadfd1ed 100644 (file)
@@ -10,6 +10,7 @@
 #include <lttng/action/action-internal.h>
 #include <lttng/action/notify-internal.h>
 #include <lttng/action/rotate-session-internal.h>
+#include <lttng/action/snapshot-session-internal.h>
 #include <lttng/action/start-session-internal.h>
 #include <lttng/action/stop-session-internal.h>
 
@@ -22,6 +23,8 @@ static const char *lttng_action_type_string(enum lttng_action_type action_type)
                return "NOTIFY";
        case LTTNG_ACTION_TYPE_ROTATE_SESSION:
                return "ROTATE_SESSION";
+       case LTTNG_ACTION_TYPE_SNAPSHOT_SESSION:
+               return "SNAPSHOT_SESSION";
        case LTTNG_ACTION_TYPE_START_SESSION:
                return "START_SESSION";
        case LTTNG_ACTION_TYPE_STOP_SESSION:
@@ -139,6 +142,10 @@ ssize_t lttng_action_create_from_payload(struct lttng_payload_view *view,
                create_from_payload_cb =
                                lttng_action_rotate_session_create_from_payload;
                break;
+       case LTTNG_ACTION_TYPE_SNAPSHOT_SESSION:
+               create_from_payload_cb =
+                               lttng_action_snapshot_session_create_from_payload;
+               break;
        case LTTNG_ACTION_TYPE_START_SESSION:
                create_from_payload_cb =
                                lttng_action_start_session_create_from_payload;
diff --git a/src/common/actions/snapshot-session.c b/src/common/actions/snapshot-session.c
new file mode 100644 (file)
index 0000000..9e8e435
--- /dev/null
@@ -0,0 +1,422 @@
+/*
+ * Copyright (C) 2019 Simon Marchi <simon.marchi@efficios.com>
+ *
+ * SPDX-License-Identifier: LGPL-2.1-only
+ *
+ */
+
+#include <assert.h>
+#include <common/error.h>
+#include <common/macros.h>
+#include <common/snapshot.h>
+#include <common/sessiond-comm/payload.h>
+#include <common/sessiond-comm/payload-view.h>
+#include <lttng/action/action-internal.h>
+#include <lttng/action/snapshot-session-internal.h>
+#include <lttng/action/snapshot-session.h>
+#include <lttng/snapshot.h>
+#include <lttng/snapshot-internal.h>
+#include <inttypes.h>
+
+#define IS_SNAPSHOT_SESSION_ACTION(action) \
+       (lttng_action_get_type_const(action) == LTTNG_ACTION_TYPE_SNAPSHOT_SESSION)
+
+struct lttng_action_snapshot_session {
+       struct lttng_action parent;
+
+       /* Owned by this. */
+       char *session_name;
+
+       /*
+        * When non-NULL, use this custom output when taking the snapshot,
+        * rather than the session's registered snapshot output.
+        *
+        * Owned by this.
+        */
+       struct lttng_snapshot_output *output;
+};
+
+struct lttng_action_snapshot_session_comm {
+       /* All string lengths include the trailing \0. */
+       uint32_t session_name_len;
+       uint32_t snapshot_output_len;
+
+       /*
+        * Variable data (all strings are null-terminated):
+        *
+        *  - session name string
+        *  - snapshot output object
+        *
+        */
+       char data[];
+} LTTNG_PACKED;
+
+static struct lttng_action_snapshot_session *
+action_snapshot_session_from_action(struct lttng_action *action)
+{
+       assert(action);
+
+       return container_of(
+                       action, struct lttng_action_snapshot_session, parent);
+}
+
+static const struct lttng_action_snapshot_session *
+action_snapshot_session_from_action_const(const struct lttng_action *action)
+{
+       assert(action);
+
+       return container_of(
+                       action, struct lttng_action_snapshot_session, parent);
+}
+
+static bool lttng_action_snapshot_session_validate(struct lttng_action *action)
+{
+       bool valid = false;
+       struct lttng_action_snapshot_session *action_snapshot_session;
+
+       if (!action) {
+               goto end;
+       }
+
+       action_snapshot_session = action_snapshot_session_from_action(action);
+
+       /* A non-empty session name is mandatory. */
+       if (!action_snapshot_session->session_name ||
+                       strlen(action_snapshot_session->session_name) == 0) {
+               goto end;
+       }
+
+       if (action_snapshot_session->output &&
+                       !lttng_snapshot_output_validate(action_snapshot_session->output)) {
+               goto end;
+       }
+
+       valid = true;
+end:
+       return valid;
+}
+
+static bool lttng_action_snapshot_session_is_equal(
+               const struct lttng_action *_a, const struct lttng_action *_b)
+{
+       bool is_equal = false;
+       const struct lttng_action_snapshot_session *a, *b;
+
+       a = action_snapshot_session_from_action_const(_a);
+       b = action_snapshot_session_from_action_const(_b);
+
+       /* Action is not valid if this is not true. */
+       assert(a->session_name);
+       assert(b->session_name);
+       if (strcmp(a->session_name, b->session_name)) {
+               goto end;
+       }
+
+       if (a->output && b->output &&
+                       !lttng_snapshot_output_is_equal(a->output, b->output)) {
+               goto end;
+       } else if (!!a->output != !!b->output) {
+               goto end;
+       }
+
+       is_equal = true;
+end:
+       return is_equal;
+}
+
+static size_t serialize_strlen(const char *s)
+{
+
+       size_t len = 0;
+
+       if (s) {
+               len = strlen(s) + 1;
+       }
+
+       return len;
+}
+
+static int lttng_action_snapshot_session_serialize(
+               struct lttng_action *action, struct lttng_payload *payload)
+{
+       struct lttng_action_snapshot_session *action_snapshot_session;
+       struct lttng_action_snapshot_session_comm comm = {};
+       int ret;
+       size_t size_before_comm;
+
+       assert(action);
+       assert(payload);
+
+       size_before_comm = payload->buffer.size;
+       size_before_comm = size_before_comm + sizeof(comm);
+
+       action_snapshot_session = action_snapshot_session_from_action(action);
+       comm.session_name_len =
+               serialize_strlen(action_snapshot_session->session_name);
+
+       /* Add header. */
+       ret = lttng_dynamic_buffer_append(
+                       &payload->buffer, &comm, sizeof(comm));
+       if (ret) {
+               goto end;
+       }
+
+       assert(action_snapshot_session->session_name);
+       DBG("Serializing snapshot session action: session-name: %s",
+                       action_snapshot_session->session_name);
+
+       /* Add session name. */
+       ret = lttng_dynamic_buffer_append(&payload->buffer,
+                       action_snapshot_session->session_name,
+                       comm.session_name_len);
+       if (ret) {
+               goto end;
+       }
+
+       /* Serialize the snapshot output object, if any. */
+       if (action_snapshot_session->output) {
+               const size_t size_before_output = payload->buffer.size;
+               struct lttng_action_snapshot_session_comm *comm_in_payload;
+
+               ret = lttng_snapshot_output_serialize(
+                               action_snapshot_session->output,
+                               payload);
+               if (ret) {
+                       goto end;
+               }
+
+               /* Adjust action length in header. */
+               comm_in_payload = (typeof(comm_in_payload))(
+                               payload->buffer.data + size_before_comm);
+               comm_in_payload->snapshot_output_len =
+                               payload->buffer.size - size_before_output;
+       }
+
+end:
+       return ret;
+}
+
+static void lttng_action_snapshot_session_destroy(struct lttng_action *action)
+{
+       struct lttng_action_snapshot_session *action_snapshot_session;
+
+       if (!action) {
+               goto end;
+       }
+
+       action_snapshot_session = action_snapshot_session_from_action(action);
+
+       free(action_snapshot_session->session_name);
+       lttng_snapshot_output_destroy(action_snapshot_session->output);
+       free(action_snapshot_session);
+
+end:
+       return;
+}
+
+ssize_t lttng_action_snapshot_session_create_from_payload(
+               struct lttng_payload_view *view,
+               struct lttng_action **p_action)
+{
+       ssize_t consumed_len;
+       const struct lttng_action_snapshot_session_comm *comm;
+       const char *variable_data;
+       struct lttng_action *action;
+       enum lttng_action_status status;
+       struct lttng_snapshot_output *snapshot_output = NULL;
+
+       action = lttng_action_snapshot_session_create();
+       if (!action) {
+               goto error;
+       }
+
+       comm = (typeof(comm)) view->buffer.data;
+       variable_data = (const char *) &comm->data;
+
+       consumed_len = sizeof(struct lttng_action_snapshot_session_comm);
+
+       if (!lttng_buffer_view_contains_string(
+                       &view->buffer, variable_data, comm->session_name_len)) {
+               goto error;
+       }
+
+       status = lttng_action_snapshot_session_set_session_name(
+                       action, variable_data);
+       if (status != LTTNG_ACTION_STATUS_OK) {
+               goto error;
+       }
+
+       variable_data += comm->session_name_len;
+       consumed_len += comm->session_name_len;
+
+       /* If there is a snapshot output object, deserialize it. */
+       if (comm->snapshot_output_len > 0) {
+               ssize_t snapshot_output_consumed_len;
+               enum lttng_action_status action_status;
+               struct lttng_payload_view snapshot_output_buffer_view =
+                       lttng_payload_view_from_view(view, consumed_len,
+                               comm->snapshot_output_len);
+
+               if (!snapshot_output_buffer_view.buffer.data) {
+                       fprintf(stderr, "Failed to create buffer view for snapshot output.\n");
+                       goto error;
+               }
+
+               snapshot_output_consumed_len =
+                               lttng_snapshot_output_create_from_payload(
+                                               &snapshot_output_buffer_view,
+                                               &snapshot_output);
+               if (snapshot_output_consumed_len != comm->snapshot_output_len) {
+                       fprintf(stderr,
+                                       "Failed to deserialize snapshot output object: "
+                                       "consumed-len: %zd, expected-len: %" PRIu32,
+                                       snapshot_output_consumed_len,
+                                       comm->snapshot_output_len);
+                       goto error;
+               }
+
+               action_status = lttng_action_snapshot_session_set_output(
+                       action, snapshot_output);
+               if (action_status != LTTNG_ACTION_STATUS_OK) {
+                       goto error;
+               }
+
+               /* Ownership has been transferred to the action. */
+               snapshot_output = NULL;
+       }
+
+       variable_data += comm->snapshot_output_len;
+       consumed_len += comm->snapshot_output_len;
+       *p_action = action;
+       action = NULL;
+
+       goto end;
+
+error:
+       consumed_len = -1;
+
+end:
+       lttng_action_snapshot_session_destroy(action);
+       lttng_snapshot_output_destroy(snapshot_output);
+
+       return consumed_len;
+}
+
+struct lttng_action *lttng_action_snapshot_session_create(void)
+{
+       struct lttng_action *action;
+
+       action = zmalloc(sizeof(struct lttng_action_snapshot_session));
+       if (!action) {
+               goto end;
+       }
+
+       lttng_action_init(action, LTTNG_ACTION_TYPE_SNAPSHOT_SESSION,
+                       lttng_action_snapshot_session_validate,
+                       lttng_action_snapshot_session_serialize,
+                       lttng_action_snapshot_session_is_equal,
+                       lttng_action_snapshot_session_destroy);
+
+end:
+       return action;
+}
+
+enum lttng_action_status lttng_action_snapshot_session_set_session_name(
+               struct lttng_action *action, const char *session_name)
+{
+       struct lttng_action_snapshot_session *action_snapshot_session;
+       enum lttng_action_status status;
+
+       if (!action || !IS_SNAPSHOT_SESSION_ACTION(action) || !session_name ||
+                       strlen(session_name) == 0) {
+               status = LTTNG_ACTION_STATUS_INVALID;
+               goto end;
+       }
+
+       action_snapshot_session = action_snapshot_session_from_action(action);
+
+       free(action_snapshot_session->session_name);
+
+       action_snapshot_session->session_name = strdup(session_name);
+       if (!action_snapshot_session->session_name) {
+               status = LTTNG_ACTION_STATUS_ERROR;
+               goto end;
+       }
+
+       status = LTTNG_ACTION_STATUS_OK;
+end:
+       return status;
+}
+
+enum lttng_action_status lttng_action_snapshot_session_get_session_name(
+               const struct lttng_action *action, const char **session_name)
+{
+       const struct lttng_action_snapshot_session *action_snapshot_session;
+       enum lttng_action_status status;
+
+       if (!action || !IS_SNAPSHOT_SESSION_ACTION(action) || !session_name) {
+               status = LTTNG_ACTION_STATUS_INVALID;
+               goto end;
+       }
+
+       action_snapshot_session = action_snapshot_session_from_action_const(action);
+
+       if (action_snapshot_session->session_name) {
+               *session_name = action_snapshot_session->session_name;
+               status = LTTNG_ACTION_STATUS_OK;
+       } else {
+               status = LTTNG_ACTION_STATUS_UNSET;
+       }
+
+end:
+
+       return status;
+}
+
+enum lttng_action_status lttng_action_snapshot_session_set_output(
+               struct lttng_action *action,
+               struct lttng_snapshot_output *output)
+{
+       struct lttng_action_snapshot_session *action_snapshot_session;
+       enum lttng_action_status status;
+
+       if (!action || !IS_SNAPSHOT_SESSION_ACTION(action) || !output) {
+               status = LTTNG_ACTION_STATUS_INVALID;
+               goto end;
+       }
+
+       action_snapshot_session = action_snapshot_session_from_action(action);
+
+       lttng_snapshot_output_destroy(action_snapshot_session->output);
+       action_snapshot_session->output = output;
+
+       status = LTTNG_ACTION_STATUS_OK;
+
+end:
+       return status;
+}
+
+enum lttng_action_status lttng_action_snapshot_session_get_output(
+               const struct lttng_action *action,
+               const struct lttng_snapshot_output **output)
+{
+       const struct lttng_action_snapshot_session *action_snapshot_session;
+       enum lttng_action_status status;
+
+       if (!action || !IS_SNAPSHOT_SESSION_ACTION(action)|| !output) {
+               status = LTTNG_ACTION_STATUS_INVALID;
+               goto end;
+       }
+
+       action_snapshot_session = action_snapshot_session_from_action_const(action);
+
+       if (action_snapshot_session->output) {
+               *output = action_snapshot_session->output;
+               status = LTTNG_ACTION_STATUS_OK;
+       } else {
+               status = LTTNG_ACTION_STATUS_UNSET;
+       }
+
+end:
+       return status;
+}
index 9d1627fcb142f6858c2516ca54df3eb6c642fffe..c2efcc02b80523bd4193f21d2b3f126c980d5c7b 100644 (file)
@@ -5,8 +5,8 @@
  *
  */
 
-#include <common/buffer-view.h>
-#include <common/dynamic-buffer.h>
+#include <common/sessiond-comm/payload.h>
+#include <common/sessiond-comm/payload-view.h>
 #include <common/snapshot.h>
 #include <lttng/snapshot-internal.h>
 #include <lttng/snapshot.h>
@@ -92,7 +92,7 @@ struct lttng_snapshot_output_comm {
 LTTNG_HIDDEN
 int lttng_snapshot_output_serialize(
                const struct lttng_snapshot_output *output,
-               struct lttng_dynamic_buffer *buf)
+               struct lttng_payload *payload)
 {
        struct lttng_snapshot_output_comm comm;
        int ret;
@@ -105,17 +105,20 @@ int lttng_snapshot_output_serialize(
                goto end;
        }
 
-       ret = lttng_strncpy(comm.ctrl_url, output->ctrl_url, sizeof(comm.ctrl_url));
+       ret = lttng_strncpy(
+                       comm.ctrl_url, output->ctrl_url, sizeof(comm.ctrl_url));
        if (ret) {
                goto end;
        }
 
-       ret = lttng_strncpy(comm.data_url, output->data_url, sizeof(comm.data_url));
+       ret = lttng_strncpy(
+                       comm.data_url, output->data_url, sizeof(comm.data_url));
        if (ret) {
                goto end;
        }
 
-       ret = lttng_dynamic_buffer_append(buf, &comm, sizeof(comm));
+       ret = lttng_dynamic_buffer_append(
+                       &payload->buffer, &comm, sizeof(comm));
        if (ret) {
                goto end;
        }
@@ -125,15 +128,15 @@ end:
 }
 
 LTTNG_HIDDEN
-ssize_t lttng_snapshot_output_create_from_buffer(
-               const struct lttng_buffer_view *view,
+ssize_t lttng_snapshot_output_create_from_payload(
+               struct lttng_payload_view *view,
                struct lttng_snapshot_output **output_p)
 {
        const struct lttng_snapshot_output_comm *comm;
        struct lttng_snapshot_output *output = NULL;
        int ret;
 
-       if (view->size != sizeof(*comm)) {
+       if (view->buffer.size != sizeof(*comm)) {
                ret = -1;
                goto end;
        }
@@ -144,7 +147,7 @@ ssize_t lttng_snapshot_output_create_from_buffer(
                goto end;
        }
 
-       comm = (const struct lttng_snapshot_output_comm *) view->data;
+       comm = (typeof(comm)) view->buffer.data;
 
        output->id = comm->id;
        output->max_size = comm->max_size;
@@ -154,12 +157,14 @@ ssize_t lttng_snapshot_output_create_from_buffer(
                goto end;
        }
 
-       ret = lttng_strncpy(output->ctrl_url, comm->ctrl_url, sizeof(output->ctrl_url));
+       ret = lttng_strncpy(output->ctrl_url, comm->ctrl_url,
+                       sizeof(output->ctrl_url));
        if (ret) {
                goto end;
        }
 
-       ret = lttng_strncpy(output->data_url, comm->data_url, sizeof(output->data_url));
+       ret = lttng_strncpy(output->data_url, comm->data_url,
+                       sizeof(output->data_url));
        if (ret) {
                goto end;
        }
index 95a63e13b42e0d1995ef9b70e6ac99107a41b77b..58e855767ad0e33c17a9dba9831a026e4a527a6d 100644 (file)
@@ -12,8 +12,8 @@
 
 #include <stdbool.h>
 
-struct lttng_buffer_view;
-struct lttng_dynamic_buffer;
+struct lttng_payload_view;
+struct lttng_payload;
 struct lttng_snapshot_output;
 
 LTTNG_HIDDEN
@@ -27,11 +27,11 @@ bool lttng_snapshot_output_is_equal(
 LTTNG_HIDDEN
 int lttng_snapshot_output_serialize(
                const struct lttng_snapshot_output *output,
-               struct lttng_dynamic_buffer *buf);
+               struct lttng_payload *payload);
 
 LTTNG_HIDDEN
-ssize_t lttng_snapshot_output_create_from_buffer(
-               const struct lttng_buffer_view *view,
+ssize_t lttng_snapshot_output_create_from_payload(
+               struct lttng_payload_view *view,
                struct lttng_snapshot_output **output_p);
 
 #endif /* COMMON_SNAPSHOT_H */
This page took 0.035709 seconds and 4 git commands to generate.