goto error_unlock;
}
- ret = ustctl_get_current_timestamp(stream->ustream, &ts);
+ ret = lttng_ustconsumer_get_current_timestamp(stream, &ts);
if (ret < 0) {
ERR("Failed to get the current timestamp");
goto error_unlock;
}
- ustctl_flush_buffer(stream->ustream, 1);
- ret = ustctl_snapshot(stream->ustream);
+ lttng_ustconsumer_flush_buffer(stream, 1);
+ ret = lttng_ustconsumer_take_snapshot(stream);
if (ret < 0) {
if (ret != -EAGAIN) {
ERR("Taking UST snapshot");
return ustctl_snapshot_get_consumed(stream->ustream, pos);
}
+void lttng_ustconsumer_flush_buffer(struct lttng_consumer_stream *stream,
+ int producer)
+{
+ assert(stream);
+ assert(stream->ustream);
+
+ ustctl_flush_buffer(stream->ustream, producer);
+}
+
+int lttng_ustconsumer_get_current_timestamp(
+ struct lttng_consumer_stream *stream, uint64_t *ts)
+{
+ assert(stream);
+ assert(stream->ustream);
+ assert(ts);
+
+ return ustctl_get_current_timestamp(stream->ustream, ts);
+}
+
/*
* Called when the stream signal the consumer that it has hang up.
*/
struct lttng_consumer_channel *channel, int timer, int wait);
int lttng_ustconsumer_sync_metadata(struct lttng_consumer_local_data *ctx,
struct lttng_consumer_stream *metadata);
+void lttng_ustconsumer_flush_buffer(struct lttng_consumer_stream *stream,
+ int producer);
+int lttng_ustconsumer_get_current_timestamp(
+ struct lttng_consumer_stream *stream, uint64_t *ts);
#else /* HAVE_LIBLTTNG_UST_CTL */
}
static inline
int lttng_ustconsumer_request_metadata(struct lttng_consumer_local_data *ctx,
- struct lttng_consumer_channel *channel, int timer)
+ struct lttng_consumer_channel *channel, int timer, int wait)
{
return -ENOSYS;
}
{
return -ENOSYS;
}
+static inline
+void lttng_ustconsumer_flush_buffer(struct lttng_consumer_stream *stream,
+ int producer)
+{
+}
+static inline
+int lttng_ustconsumer_get_current_timestamp(
+ struct lttng_consumer_stream *stream, uint64_t *ts)
+{
+ return -ENOSYS;
+}
#endif /* HAVE_LIBLTTNG_UST_CTL */
#endif /* _LTTNG_USTCONSUMER_H */