From: David Goulet Date: Tue, 21 Feb 2012 22:46:24 +0000 (-0500) Subject: Fix consumer to handle compat layer X-Git-Tag: v2.0.0-rc2~37 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=fbb2c21aac1386b7752f6254b2bd0bf001fa0ac1;p=lttng-tools.git Fix consumer to handle compat layer Signed-off-by: David Goulet --- diff --git a/src/common/Makefile.am b/src/common/Makefile.am index 37f9acb9a..ba93810a8 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -10,6 +10,17 @@ noinst_LTLIBRARIES = libcommon.la libcommon_la_SOURCES = runas.c runas.h common.h +if COMPAT_EPOLL +COMPAT=compat/compat-epoll.c +else +COMPAT=compat/compat-poll.c +endif + +noinst_LTLIBRARIES += libcompat.la + +libcompat_la_SOURCES = compat/poll.h compat/fcntl.h compat/splice.h compat/endian.h \ + compat/socket.h compat/compat-fcntl.c $(COMPAT) + # Consumer library noinst_LTLIBRARIES += libconsumer.la @@ -18,19 +29,10 @@ libconsumer_la_SOURCES = consumer.c consumer.h libconsumer_la_LIBADD = \ $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la \ $(top_builddir)/src/common/kernel-consumer/libkernel-consumer.la \ - $(top_builddir)/src/common/hashtable/libhashtable.la + $(top_builddir)/src/common/hashtable/libhashtable.la \ + $(top_builddir)/src/common/libcompat.la if HAVE_LIBLTTNG_UST_CTL libconsumer_la_LIBADD += \ $(top_builddir)/src/common/ust-consumer/libust-consumer.la endif - -if COMPAT_EPOLL -COMPAT=compat/compat-epoll.c -else -COMPAT=compat/compat-poll.c -endif - -noinst_LTLIBRARIES += libcompat.la - -libcompat_la_SOURCES = compat/poll.h $(COMPAT) diff --git a/src/common/consumer.c b/src/common/consumer.c index b605591e4..80dedd5c6 100644 --- a/src/common/consumer.c +++ b/src/common/consumer.c @@ -19,7 +19,6 @@ #define _GNU_SOURCE #include -#include #include #include #include @@ -601,7 +600,7 @@ void lttng_consumer_sync_trace_file( if (orig_offset < stream->chan->max_sb_size) { return; } - sync_file_range(outfd, orig_offset - stream->chan->max_sb_size, + lttng_sync_file_range(outfd, orig_offset - stream->chan->max_sb_size, stream->chan->max_sb_size, SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE @@ -742,6 +741,8 @@ int lttng_consumer_on_read_subbuffer_mmap( ERR("Unknown consumer_data type"); assert(0); } + + return 0; } /* diff --git a/src/common/consumer.h b/src/common/consumer.h index dc5fc9968..35a72b50f 100644 --- a/src/common/consumer.h +++ b/src/common/consumer.h @@ -26,7 +26,8 @@ #include -#include "src/common/hashtable/hashtable.h" +#include +#include /* * When the receiving thread dies, we need to have a way to make the polling diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c index 9a5775b8e..e81f05041 100644 --- a/src/common/ust-consumer/ust-consumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -19,7 +19,6 @@ #define _GNU_SOURCE #include -#include #include #include #include