consumer: fix: possible unaligned access in packed structure
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 14 Sep 2019 18:25:25 +0000 (14:25 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 26 Sep 2019 19:29:51 +0000 (15:29 -0400)
Fix the warnings that unaligned pointers can be passed as parameters
emitted when sampling buffer statistics.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/consumer/consumer-timer.c

index 557d96b2935c4c8abbe43f9246e11fc4969b01f2..06c9f1a1e007e3c4d18b9e9fc55962d48329adf0 100644 (file)
@@ -711,6 +711,7 @@ void monitor_timer(struct lttng_consumer_local_data *ctx,
        sample_positions_cb sample;
        get_consumed_cb get_consumed;
        get_produced_cb get_produced;
+       uint64_t lowest = 0, highest = 0;
 
        assert(channel);
 
@@ -734,11 +735,13 @@ void monitor_timer(struct lttng_consumer_local_data *ctx,
                abort();
        }
 
-       ret = sample_channel_positions(channel, &msg.highest, &msg.lowest,
+       ret = sample_channel_positions(channel, &highest, &lowest,
                        sample, get_consumed, get_produced);
        if (ret) {
                return;
        }
+       msg.highest = highest;
+       msg.lowest = lowest;
 
        /*
         * Writes performed here are assumed to be atomic which is only
This page took 0.026405 seconds and 4 git commands to generate.