Use bytecode seqnum to force the evaluation ordering of capture bytecode
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Thu, 16 Apr 2020 20:31:16 +0000 (16:31 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 12 Mar 2021 20:56:14 +0000 (15:56 -0500)
This ensure that the resulting payload is ordered as expected.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I74c87cdc7098030e05b060f287561b4177739cc1
Depends-on: lttng-ust: I8423c510bf6af2f9bf85256e8d6f931d36f7054b

src/bin/lttng-sessiond/ust-app.c

index cc027be99f17f76f426171f0830871e5fe61c26e..43864bd0fc27d3bae0c759c2ac797ccca080869e 100644 (file)
@@ -1579,9 +1579,12 @@ error:
 
 /*
  * Set a capture bytecode for the passed object.
+ * The sequence number enforces the ordering at runtime and on reception of
+ * the captured payloads.
  */
 static int set_ust_capture(struct ust_app *app,
                const struct lttng_bytecode *bytecode,
+               unsigned int capture_seqnum,
                struct lttng_ust_object_data *ust_object)
 {
        int ret;
@@ -1595,6 +1598,11 @@ static int set_ust_capture(struct ust_app *app,
                goto error;
        }
 
+       /*
+        * Set the sequence number to ensure the capture of fields is ordered.
+        */
+       ust_bytecode->seqnum = capture_seqnum;
+
        pthread_mutex_lock(&app->sock_lock);
        ret = ustctl_set_capture(app->sock, ust_bytecode,
                        ust_object);
@@ -2159,7 +2167,7 @@ static int create_ust_event_notifier(struct ust_app *app,
                                lttng_condition_event_rule_get_capture_bytecode_at_index(
                                                condition, i);
 
-               ret = set_ust_capture(app, capture_bytecode,
+               ret = set_ust_capture(app, capture_bytecode, i,
                                ua_event_notifier_rule->obj);
                if (ret < 0) {
                        goto error;
This page took 0.028585 seconds and 4 git commands to generate.