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.4.2~3 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=abffd1e027df3e0c82b3e0e602b9d0b218f990a6;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 c1a7fec25..65c9fd3c2 100644 --- a/src/common/consumer-timer.c +++ b/src/common/consumer-timer.c @@ -26,7 +26,6 @@ #include #include #include -#include #include "consumer-timer.h" #include "consumer-testpoint.h" @@ -213,7 +212,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 f45b19944..93f8f50a9 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -2382,3 +2382,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 */