From: David Goulet Date: Mon, 14 Jul 2014 19:49:02 +0000 (-0400) Subject: Fix: ustctl_get_stream_id without UST support X-Git-Tag: v2.6.0-rc1~144 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=70190e1c2ba092cd35a9e0b53c0ce8a6bf260d50;p=lttng-tools.git Fix: ustctl_get_stream_id without UST support Signed-off-by: David Goulet --- diff --git a/src/common/consumer-timer.c b/src/common/consumer-timer.c index d36e2bccf..140805243 100644 --- a/src/common/consumer-timer.c +++ b/src/common/consumer-timer.c @@ -27,7 +27,6 @@ #include #include #include -#include #include "consumer-timer.h" #include "consumer-testpoint.h" @@ -214,7 +213,7 @@ static int check_ust_stream(struct lttng_consumer_stream *stream) ret = -1; goto error_unlock; } - ret = ustctl_get_stream_id(stream->ustream, &stream_id); + ret = lttng_ustconsumer_get_stream_id(stream, &stream_id); if (ret < 0) { PERROR("ustctl_get_stream_id"); goto error_unlock; diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c index 4435bf3fd..01f79d68f 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -2383,3 +2383,15 @@ end: pthread_mutex_unlock(&ctx->metadata_socket_lock); return ret; } + +/* + * Return the ustctl call for the get stream id. + */ +int lttng_ustconsumer_get_stream_id(struct lttng_consumer_stream *stream, + uint64_t *stream_id) +{ + assert(stream); + assert(stream_id); + + return ustctl_get_stream_id(stream->ustream, stream_id); +} diff --git a/src/common/ust-consumer/ust-consumer.h b/src/common/ust-consumer/ust-consumer.h index ac29857b3..4357380a6 100644 --- a/src/common/ust-consumer/ust-consumer.h +++ b/src/common/ust-consumer/ust-consumer.h @@ -50,6 +50,8 @@ void lttng_ustconsumer_on_stream_hangup(struct lttng_consumer_stream *stream); int lttng_ustctl_get_mmap_read_offset(struct lttng_consumer_stream *stream, unsigned long *off); void *lttng_ustctl_get_mmap_base(struct lttng_consumer_stream *stream); +int lttng_ustconsumer_get_stream_id(struct lttng_consumer_stream *stream, + uint64_t *stream_id); int lttng_ustconsumer_data_pending(struct lttng_consumer_stream *stream); void lttng_ustconsumer_close_all_metadata(struct lttng_ht *ht); void lttng_ustconsumer_close_metadata(struct lttng_consumer_channel *metadata); @@ -204,6 +206,12 @@ int lttng_ustconsumer_get_current_timestamp( { return -ENOSYS; } +static inline +int lttng_ustconsumer_get_stream_id(struct lttng_consumer_stream *stream, + uint64_t *stream_id) +{ + return -ENOSYS; +} #endif /* HAVE_LIBLTTNG_UST_CTL */ #endif /* _LTTNG_USTCONSUMER_H */