From: Jérémie Galarneau Date: Fri, 11 Mar 2016 23:36:17 +0000 (-0500) Subject: Fix: Initialize events discarded and packet lost counters to zero X-Git-Tag: v2.8.0-rc1~80 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=7c79cc89f4765951545b01d272ef2dc212874086 Fix: Initialize events discarded and packet lost counters to zero The runtime stats functions would only set the counter value matching the current buffer-switching policy resulting in uninitialized discarded event counts in "overwrite" mode, and uninitialized lost packet counts in "discard" mode. Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index 9a766e4ab..987bb0e1c 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -5945,9 +5945,11 @@ int ust_app_uid_get_channel_runtime_stats(uint64_t ust_session_id, if (overwrite) { ret = consumer_get_lost_packets(ust_session_id, consumer_chan_key, consumer, lost); + *discarded = 0; } else { ret = consumer_get_discarded_events(ust_session_id, consumer_chan_key, consumer, discarded); + *lost = 0; } end: @@ -5990,10 +5992,12 @@ int ust_app_pid_get_channel_runtime_stats(struct ltt_ust_session *usess, if (overwrite) { ret = consumer_get_lost_packets(usess->id, ua_chan->key, consumer, lost); + *discarded = 0; goto end; } else { ret = consumer_get_discarded_events(usess->id, ua_chan->key, consumer, discarded); + *lost = 0; goto end; } }