*/
#define _LGPL_SOURCE
-#include <assert.h>
#include <inttypes.h>
#include <signal.h>
struct lttng_consumer_channel *channel;
channel = si->si_value.sival_ptr;
- assert(channel);
+ LTTNG_ASSERT(channel);
if (channel->switch_timer_error) {
return;
break;
case LTTNG_CONSUMER_KERNEL:
case LTTNG_CONSUMER_UNKNOWN:
- assert(0);
+ abort();
break;
}
}
ERR("Failed to get the current timestamp");
goto end;
}
- lttng_ustconsumer_flush_buffer(stream, 1);
+ ret = lttng_ustconsumer_flush_buffer(stream, 1);
+ if (ret < 0) {
+ ERR("Failed to flush buffer while flushing index");
+ goto end;
+ }
ret = lttng_ustconsumer_take_snapshot(stream);
if (ret < 0) {
if (ret != -EAGAIN) {
}
ret = lttng_ustconsumer_get_stream_id(stream, &stream_id);
if (ret < 0) {
- PERROR("ustctl_get_stream_id");
+ PERROR("lttng_ust_ctl_get_stream_id");
goto end;
}
DBG("Stream %" PRIu64 " empty, sending beacon", stream->key);
consumer_flush_ust_index;
channel = si->si_value.sival_ptr;
- assert(channel);
+ LTTNG_ASSERT(channel);
if (channel->switch_timer_error) {
goto error;
struct sigevent sev = {};
struct itimerspec its;
- assert(channel);
- assert(channel->key);
+ LTTNG_ASSERT(channel);
+ LTTNG_ASSERT(channel->key);
if (timer_interval_us == 0) {
/* No creation needed; not an error. */
{
int ret;
- assert(channel);
- assert(channel->key);
+ LTTNG_ASSERT(channel);
+ LTTNG_ASSERT(channel->key);
ret = consumer_channel_timer_start(&channel->switch_timer, channel,
switch_timer_interval_us, LTTNG_CONSUMER_SIG_SWITCH);
{
int ret;
- assert(channel);
+ LTTNG_ASSERT(channel);
ret = consumer_channel_timer_stop(&channel->switch_timer,
LTTNG_CONSUMER_SIG_SWITCH);
{
int ret;
- assert(channel);
- assert(channel->key);
+ LTTNG_ASSERT(channel);
+ LTTNG_ASSERT(channel->key);
ret = consumer_channel_timer_start(&channel->live_timer, channel,
live_timer_interval_us, LTTNG_CONSUMER_SIG_LIVE);
{
int ret;
- assert(channel);
+ LTTNG_ASSERT(channel);
ret = consumer_channel_timer_stop(&channel->live_timer,
LTTNG_CONSUMER_SIG_LIVE);
{
int ret;
- assert(channel);
- assert(channel->key);
- assert(!channel->monitor_timer_enabled);
+ LTTNG_ASSERT(channel);
+ LTTNG_ASSERT(channel->key);
+ LTTNG_ASSERT(!channel->monitor_timer_enabled);
ret = consumer_channel_timer_start(&channel->monitor_timer, channel,
monitor_timer_interval_us, LTTNG_CONSUMER_SIG_MONITOR);
{
int ret;
- assert(channel);
- assert(channel->monitor_timer_enabled);
+ LTTNG_ASSERT(channel);
+ LTTNG_ASSERT(channel->monitor_timer_enabled);
ret = consumer_channel_timer_stop(&channel->monitor_timer,
LTTNG_CONSUMER_SIG_MONITOR);
get_produced_cb get_produced;
uint64_t lowest = 0, highest = 0, total_consumed = 0;
- assert(channel);
+ LTTNG_ASSERT(channel);
if (channel_monitor_pipe < 0) {
return;
* Writes performed here are assumed to be atomic which is only
* guaranteed for sizes < than PIPE_BUF.
*/
- assert(sizeof(msg) <= PIPE_BUF);
+ LTTNG_ASSERT(sizeof(msg) <= PIPE_BUF);
do {
ret = write(channel_monitor_pipe, &msg, sizeof(msg));
channel = info.si_value.sival_ptr;
monitor_timer(channel);
} else if (signr == LTTNG_CONSUMER_SIG_EXIT) {
- assert(CMM_LOAD_SHARED(consumer_quit));
+ LTTNG_ASSERT(CMM_LOAD_SHARED(consumer_quit));
goto end;
} else {
ERR("Unexpected signal %d\n", info.si_signo);