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 <jeremie.galarneau@efficios.com>
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:
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;
}
}