X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fconsumer%2Fconsumer.c;h=6773fbae868af95b5634d0d63d6724519caa7cdf;hb=a74a5f4a84e873edb42c8c0221064147912befd9;hp=cb05a1eb411c9f522b37efaf8600ecdca930352f;hpb=40063ead9b2f76ae2b442fcca98bb5b50ab9d2a1;p=lttng-tools.git diff --git a/src/common/consumer/consumer.c b/src/common/consumer/consumer.c index cb05a1eb4..6773fbae8 100644 --- a/src/common/consumer/consumer.c +++ b/src/common/consumer/consumer.c @@ -1021,7 +1021,7 @@ struct lttng_consumer_channel *consumer_allocate_channel(uint64_t key, CDS_INIT_LIST_HEAD(&channel->streams.head); - DBG("Allocated channel (key %" PRIu64 ")", channel->key) + DBG("Allocated channel (key %" PRIu64 ")", channel->key); end: return channel; @@ -1232,6 +1232,7 @@ void lttng_consumer_should_exit(struct lttng_consumer_local_data *ctx) void lttng_consumer_sync_trace_file(struct lttng_consumer_stream *stream, off_t orig_offset) { + int ret; int outfd = stream->out_fd; /* @@ -1262,8 +1263,12 @@ void lttng_consumer_sync_trace_file(struct lttng_consumer_stream *stream, * defined. So it can be expected to lead to lower throughput in * streaming. */ - posix_fadvise(outfd, orig_offset - stream->max_sb_size, + ret = posix_fadvise(outfd, orig_offset - stream->max_sb_size, stream->max_sb_size, POSIX_FADV_DONTNEED); + if (ret && ret != -ENOSYS) { + errno = ret; + PERROR("posix_fadvise on fd %i", outfd); + } } /*