From: Mathieu Desnoyers Date: Mon, 27 Jun 2011 16:02:21 +0000 (-0400) Subject: Build libringbuffer, remove kernel includes X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=4931a13e87ddbbabe4911e622e78c85b2197ecbf;p=ust.git Build libringbuffer, remove kernel includes Signed-off-by: Mathieu Desnoyers --- diff --git a/Makefile.am b/Makefile.am index fe0bbaa..0950ff5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,7 +5,7 @@ ACLOCAL_AMFLAGS = -I config # libust and '.' (that contains the linker script). However, '.' # must be installed after libust so it can overwrite libust.so with # the linker script. -SUBDIRS = snprintf libust include doc +SUBDIRS = snprintf libringbuffer libust include doc #temporarily disabled # . tests libustinstr-malloc libustfork diff --git a/configure.ac b/configure.ac index 6ab6e3c..6fdb279 100644 --- a/configure.ac +++ b/configure.ac @@ -141,6 +141,7 @@ AC_CONFIG_FILES([ doc/man/Makefile doc/info/Makefile include/Makefile + libringbuffer/Makefile libust/Makefile tests/Makefile tests/hello/Makefile diff --git a/libringbuffer/Makefile.am b/libringbuffer/Makefile.am new file mode 100644 index 0000000..bc2c7a7 --- /dev/null +++ b/libringbuffer/Makefile.am @@ -0,0 +1,22 @@ +AM_CPPFLAGS = -I$(top_srcdir)/include +AM_CFLAGS = -fno-strict-aliasing + +lib_LTLIBRARIES = libringbuffer.la + +libringbuffer_la_SOURCES = \ + ring_buffer_backend.c \ + ring_buffer_frontend.c \ + ring_buffer_iterator.c \ + ring_buffer_vfs.c \ + ring_buffer_splice.c \ + ring_buffer_mmap.c \ + ../libprio_heap/lttng_prio_heap.c + +libringbuffer_la_LDFLAGS = -no-undefined -version-info 0:0:0 + +libringbuffer_la_LIBADD = \ + -lpthread \ + -lrt \ + $(top_builddir)/snprintf/libustsnprintf.la + +libringbuffer_la_CFLAGS = -DUST_COMPONENT="libringbuffer" -fno-strict-aliasing diff --git a/libringbuffer/api.h b/libringbuffer/api.h index f8a1145..aa23e40 100644 --- a/libringbuffer/api.h +++ b/libringbuffer/api.h @@ -11,15 +11,15 @@ * Dual LGPL v2.1/GPL v2 license. */ -#include "../../wrapper/ringbuffer/backend.h" -#include "../../wrapper/ringbuffer/frontend.h" -#include "../../wrapper/ringbuffer/vfs.h" +#include "backend.h" +#include "frontend.h" +#include "vfs.h" /* * ring_buffer_frontend_api.h contains static inline functions that depend on * client static inlines. Hence the inclusion of this "api" header only * within the client. */ -#include "../../wrapper/ringbuffer/frontend_api.h" +#include "frontend_api.h" #endif /* _LINUX_RING_BUFFER_API_H */ diff --git a/libringbuffer/backend.h b/libringbuffer/backend.h index 47bc179..b50bae1 100644 --- a/libringbuffer/backend.h +++ b/libringbuffer/backend.h @@ -14,18 +14,9 @@ * the reader in flight recorder mode. */ -#include -#include -#include -#include -#include -#include -#include -#include - /* Internal helpers */ -#include "../../wrapper/ringbuffer/backend_internal.h" -#include "../../wrapper/ringbuffer/frontend_internal.h" +#include "backend_internal.h" +#include "frontend_internal.h" /* Ring buffer backend API */ diff --git a/libringbuffer/backend_internal.h b/libringbuffer/backend_internal.h index d6c1c82..2c3de67 100644 --- a/libringbuffer/backend_internal.h +++ b/libringbuffer/backend_internal.h @@ -11,10 +11,9 @@ * Dual LGPL v2.1/GPL v2 license. */ -#include "../../wrapper/ringbuffer/config.h" -#include "../../wrapper//ringbuffer/backend_types.h" -#include "../../wrapper/ringbuffer/frontend_types.h" -#include +#include "config.h" +#include "backend_types.h" +#include "frontend_types.h" /* Ring buffer backend API presented to the frontend */ diff --git a/libringbuffer/backend_types.h b/libringbuffer/backend_types.h index 1d301de..99de9f1 100644 --- a/libringbuffer/backend_types.h +++ b/libringbuffer/backend_types.h @@ -11,9 +11,6 @@ * Dual LGPL v2.1/GPL v2 license. */ -#include -#include - struct lib_ring_buffer_backend_page { void *virt; /* page virtual address (cached) */ struct page *page; /* pointer to page structure */ diff --git a/libringbuffer/frontend.h b/libringbuffer/frontend.h index 01af77a..1eb4ae9 100644 --- a/libringbuffer/frontend.h +++ b/libringbuffer/frontend.h @@ -16,28 +16,8 @@ * Dual LGPL v2.1/GPL v2 license. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - /* Internal helpers */ -#include "../../wrapper/ringbuffer/frontend_internal.h" +#include "frontend_internal.h" /* Buffer creation/removal and setup operations */ diff --git a/libringbuffer/frontend_api.h b/libringbuffer/frontend_api.h index 391e593..93b28e4 100644 --- a/libringbuffer/frontend_api.h +++ b/libringbuffer/frontend_api.h @@ -17,8 +17,7 @@ * Dual LGPL v2.1/GPL v2 license. */ -#include "../../wrapper/ringbuffer/frontend.h" -#include +#include "frontend.h" /** * lib_ring_buffer_get_cpu - Precedes ring buffer reserve/commit. diff --git a/libringbuffer/frontend_internal.h b/libringbuffer/frontend_internal.h index 3bd5721..37e046b 100644 --- a/libringbuffer/frontend_internal.h +++ b/libringbuffer/frontend_internal.h @@ -16,10 +16,10 @@ * Dual LGPL v2.1/GPL v2 license. */ -#include "../../wrapper/ringbuffer/config.h" -#include "../../wrapper/ringbuffer/backend_types.h" -#include "../../wrapper/ringbuffer/frontend_types.h" -#include "../../lib/prio_heap/lttng_prio_heap.h" /* For per-CPU read-side iterator */ +#include "config.h" +#include "backend_types.h" +#include "frontend_types.h" +#include "../lib_prio_heap/lttng_prio_heap.h" /* For per-CPU read-side iterator */ /* Buffer offset macros */ diff --git a/libringbuffer/frontend_types.h b/libringbuffer/frontend_types.h index fe208b6..f89d803 100644 --- a/libringbuffer/frontend_types.h +++ b/libringbuffer/frontend_types.h @@ -16,10 +16,9 @@ * Dual LGPL v2.1/GPL v2 license. */ -#include -#include "../../wrapper/ringbuffer/config.h" -#include "../../wrapper/ringbuffer/backend_types.h" -#include "../../lib/prio_heap/lttng_prio_heap.h" /* For per-CPU read-side iterator */ +#include "config.h" +#include "backend_types.h" +#include "../lib_prio_heap/lttng_prio_heap.h" /* For per-CPU read-side iterator */ /* * A switch is done during tracing or as a final flush after tracing (so it diff --git a/libringbuffer/iterator.h b/libringbuffer/iterator.h index f2bd50d..4914929 100644 --- a/libringbuffer/iterator.h +++ b/libringbuffer/iterator.h @@ -14,8 +14,8 @@ * Dual LGPL v2.1/GPL v2 license. */ -#include "../../wrapper/ringbuffer/backend.h" -#include "../../wrapper/ringbuffer/frontend.h" +#include "backend.h" +#include "frontend.h" /* * lib_ring_buffer_get_next_record advances the buffer read position to the next diff --git a/libringbuffer/ring_buffer_backend.c b/libringbuffer/ring_buffer_backend.c index 332a1d2..5ff38f0 100644 --- a/libringbuffer/ring_buffer_backend.c +++ b/libringbuffer/ring_buffer_backend.c @@ -6,20 +6,9 @@ * Dual LGPL v2.1/GPL v2 license. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "../../wrapper/vmalloc.h" /* for wrapper_vmalloc_sync_all() */ -#include "../../wrapper/ringbuffer/config.h" -#include "../../wrapper/ringbuffer/backend.h" -#include "../../wrapper/ringbuffer/frontend.h" +#include "config.h" +#include "backend.h" +#include "frontend.h" /** * lib_ring_buffer_backend_allocate - allocate a channel buffer diff --git a/libringbuffer/ring_buffer_frontend.c b/libringbuffer/ring_buffer_frontend.c index ecc72ab..a3f14f3 100644 --- a/libringbuffer/ring_buffer_frontend.c +++ b/libringbuffer/ring_buffer_frontend.c @@ -38,15 +38,11 @@ * Dual LGPL v2.1/GPL v2 license. */ -#include -#include -#include - -#include "../../wrapper/ringbuffer/config.h" -#include "../../wrapper/ringbuffer/backend.h" -#include "../../wrapper/ringbuffer/frontend.h" -#include "../../wrapper/ringbuffer/iterator.h" -#include "../../wrapper/ringbuffer/nohz.h" +#include "config.h" +#include "backend.h" +#include "frontend.h" +#include "iterator.h" +#include "nohz.h" /* * Internal structure representing offsets to use at a sub-buffer switch. diff --git a/libringbuffer/ring_buffer_iterator.c b/libringbuffer/ring_buffer_iterator.c index df8d485..ff8e582 100644 --- a/libringbuffer/ring_buffer_iterator.c +++ b/libringbuffer/ring_buffer_iterator.c @@ -13,10 +13,7 @@ * Dual LGPL v2.1/GPL v2 license. */ -#include "../../wrapper/ringbuffer/iterator.h" -#include -#include -#include +#include "iterator.h" /* * Safety factor taking into account internal kernel interrupt latency. diff --git a/libringbuffer/ring_buffer_vfs.c b/libringbuffer/ring_buffer_vfs.c index 9786d35..3aa3aca 100644 --- a/libringbuffer/ring_buffer_vfs.c +++ b/libringbuffer/ring_buffer_vfs.c @@ -8,14 +8,9 @@ * Dual LGPL v2.1/GPL v2 license. */ -#include -#include -#include - -#include "../../wrapper/ringbuffer/backend.h" -#include "../../wrapper/ringbuffer/frontend.h" -#include "../../wrapper/ringbuffer/vfs.h" -#include "../../wrapper/poll.h" +#include "backend.h" +#include "frontend.h" +#include "vfs.h" static int put_ulong(unsigned long val, unsigned long arg) { diff --git a/libringbuffer/vatomic.h b/libringbuffer/vatomic.h index b944dd6..eea6d04 100644 --- a/libringbuffer/vatomic.h +++ b/libringbuffer/vatomic.h @@ -9,9 +9,6 @@ * Dual LGPL v2.1/GPL v2 license. */ -#include -#include - /* * Same data type (long) accessed differently depending on configuration. * v field is for non-atomic access (protected by mutual exclusion). diff --git a/libringbuffer/vfs.h b/libringbuffer/vfs.h index 0a09637..a27f8c5 100644 --- a/libringbuffer/vfs.h +++ b/libringbuffer/vfs.h @@ -14,9 +14,6 @@ * Dual LGPL v2.1/GPL v2 license. */ -#include -#include - /* VFS API */ extern const struct file_operations lib_ring_buffer_file_operations;