Skip to contentSkip to conversation

Fix: lost packet accounting always lost on snapshot

PATCH Jérémie Galarneau 1 participant 1 message Sep 18, 2017 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

This was merged a while ago, but it seems I never sent an acknowledgement.

Thanks!
Jérémie

Quoted 86 lines · Julien Desfossez

Because of the continue when we fail to get a subbuff, the lost_packet count is always reset to 0 before we can account it in the channel. Now we account it directly before the continue.

---
 src/common/kernel-consumer/kernel-consumer.c | 11 +----------
 src/common/ust-consumer/ust-consumer.c       | 11 +----------
 2 files changed, 2 insertions(+), 20 deletions(-)
src/common/kernel-consumer/kernel-consumer.c +1 -10
index 8d00a0d..7686356 100644
@@ -249,7 +249,6 @@ int lttng_kconsumer_snapshot_channel(uint64_t key, char *path,
                while (consumed_pos < produced_pos) {
                        ssize_t read_len;
                        unsigned long len, padded_len;
-                       int lost_packet = 0;
 
                        health_code_update();
 
@@ -270,7 +269,7 @@ int lttng_kconsumer_snapshot_channel(uint64_t key, char *path,
                                 * content of the final snapshot).
                                 */
                                if (!before_first_packet) {
-                                       lost_packet = 1;
+                                       stream->chan->lost_packets++;
                                }
                                continue;
                        }
@@ -313,14 +312,6 @@ int lttng_kconsumer_snapshot_channel(uint64_t key, char *path,
                        }
                        consumed_pos += stream->max_sb_size;
 
-                       /*
-                        * Only account lost packets located between
-                        * succesfully extracted packets (do not account before
-                        * and after since they are not visible in the
-                        * resulting snapshot).
-                        */
-                       stream->chan->lost_packets += lost_packet;
-                       lost_packet = 0;
                        before_first_packet = false;
                }
 
src/common/ust-consumer/ust-consumer.c +1 -11
index 4297d60..74853cd 100644
@@ -1150,7 +1150,6 @@ static int snapshot_channel(uint64_t key, char *path, uint64_t relayd_id,
                while (consumed_pos < produced_pos) {
                        ssize_t read_len;
                        unsigned long len, padded_len;
-                       int lost_packet = 0;
 
                        health_code_update();
 
@@ -1171,7 +1170,7 @@ static int snapshot_channel(uint64_t key, char *path, uint64_t relayd_id,
                                 * content of the final snapshot).
                                 */
                                if (!before_first_packet) {
-                                       lost_packet = 1;
+                                       stream->chan->lost_packets++;
                                }
                                continue;
                        }
@@ -1209,14 +1208,6 @@ static int snapshot_channel(uint64_t key, char *path, uint64_t relayd_id,
                        }
                        consumed_pos += stream->max_sb_size;
 
-                       /*
-                        * Only account lost packets located between
-                        * succesfully extracted packets (do not account before
-                        * and after since they are not visible in the
-                        * resulting snapshot).
-                        */
-                       stream->chan->lost_packets += lost_packet;
-                       lost_packet = 0;
                        before_first_packet = false;
                }
 
--

2.7.4

Signature · 7 lines
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev