From: David Goulet Date: Fri, 27 Sep 2013 18:20:51 +0000 (-0400) Subject: Fix: compile without UST support X-Git-Tag: v2.4.0-rc1~141 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=84a182ce022e128395c8d1e5762883f5825582d7;p=lttng-tools.git Fix: compile without UST support Signed-off-by: David Goulet --- diff --git a/src/common/consumer-timer.c b/src/common/consumer-timer.c index 0f5d4ba96..05a09c234 100644 --- a/src/common/consumer-timer.c +++ b/src/common/consumer-timer.c @@ -191,13 +191,13 @@ static int check_ust_stream(struct lttng_consumer_stream *stream) 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"); diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c index 2d3d89c7c..6a508143e 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -1573,6 +1573,25 @@ int lttng_ustconsumer_get_consumed_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. */ diff --git a/src/common/ust-consumer/ust-consumer.h b/src/common/ust-consumer/ust-consumer.h index bf005c30d..2dfd2e43c 100644 --- a/src/common/ust-consumer/ust-consumer.h +++ b/src/common/ust-consumer/ust-consumer.h @@ -60,6 +60,10 @@ int lttng_ustconsumer_request_metadata(struct lttng_consumer_local_data *ctx, 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 */ @@ -174,7 +178,7 @@ int lttng_ustconsumer_recv_metadata(int sock, uint64_t key, uint64_t offset, } 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; } @@ -184,6 +188,17 @@ int lttng_ustconsumer_sync_metadata(struct lttng_consumer_local_data *ctx, { 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 */