X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fkernel-consumer%2Fkernel-consumer.c;h=a8abcd7901121c62dc27ec94f7d01cee62d2a6fa;hp=65dcce40b34f2b07e892c7f7a1298b9709bbd180;hb=f0b03c2289d0f84c1e2dc41be70cd0bcc222e181;hpb=04151c371f67ad69919159ff0fb74c67f12149fd diff --git a/src/common/kernel-consumer/kernel-consumer.c b/src/common/kernel-consumer/kernel-consumer.c index 65dcce40b..a8abcd790 100644 --- a/src/common/kernel-consumer/kernel-consumer.c +++ b/src/common/kernel-consumer/kernel-consumer.c @@ -1085,15 +1085,27 @@ static int get_index_values(struct ctf_packet_index *index, int infd) ret = kernctl_get_instance_id(infd, &index->stream_instance_id); if (ret < 0) { - PERROR("kernctl_get_instance_id"); - goto error; + if (ret == -ENOTTY) { + /* Command not implemented by lttng-modules. */ + index->stream_instance_id = -1ULL; + ret = 0; + } else { + PERROR("kernctl_get_instance_id"); + goto error; + } } index->stream_instance_id = htobe64(index->stream_instance_id); ret = kernctl_get_sequence_number(infd, &index->packet_seq_num); if (ret < 0) { - PERROR("kernctl_get_sequence_number"); - goto error; + if (ret == -ENOTTY) { + /* Command not implemented by lttng-modules. */ + index->packet_seq_num = -1ULL; + ret = 0; + } else { + PERROR("kernctl_get_sequence_number"); + goto error; + } } index->packet_seq_num = htobe64(index->packet_seq_num); @@ -1145,8 +1157,14 @@ int update_stream_stats(struct lttng_consumer_stream *stream) ret = kernctl_get_sequence_number(stream->wait_fd, &seq); if (ret < 0) { - PERROR("kernctl_get_sequence_number"); - goto end; + if (ret == -ENOTTY) { + /* Command not implemented by lttng-modules. */ + seq = -1ULL; + ret = 0; + } else { + PERROR("kernctl_get_sequence_number"); + goto end; + } } /* @@ -1205,6 +1223,14 @@ int metadata_stream_check_version(int infd, struct lttng_consumer_stream *stream ret = kernctl_get_metadata_version(infd, &cur_version); if (ret < 0) { + if (ret == -ENOTTY) { + /* + * LTTng-modules does not implement this + * command. + */ + ret = 0; + goto end; + } ERR("Failed to get the metadata version"); goto end; }