From 4931a13e87ddbbabe4911e622e78c85b2197ecbf Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Mon, 27 Jun 2011 12:02:21 -0400 Subject: [PATCH] Build libringbuffer, remove kernel includes Signed-off-by: Mathieu Desnoyers --- Makefile.am | 2 +- configure.ac | 1 + libringbuffer/Makefile.am | 22 ++++++++++++++++++++++ libringbuffer/api.h | 8 ++++---- libringbuffer/backend.h | 13 ++----------- libringbuffer/backend_internal.h | 7 +++---- libringbuffer/backend_types.h | 3 --- libringbuffer/frontend.h | 22 +--------------------- libringbuffer/frontend_api.h | 3 +-- libringbuffer/frontend_internal.h | 8 ++++---- libringbuffer/frontend_types.h | 7 +++---- libringbuffer/iterator.h | 4 ++-- libringbuffer/ring_buffer_backend.c | 17 +++-------------- libringbuffer/ring_buffer_frontend.c | 14 +++++--------- libringbuffer/ring_buffer_iterator.c | 5 +---- libringbuffer/ring_buffer_vfs.c | 11 +++-------- libringbuffer/vatomic.h | 3 --- libringbuffer/vfs.h | 3 --- 18 files changed, 56 insertions(+), 97 deletions(-) create mode 100644 libringbuffer/Makefile.am diff --git a/Makefile.am b/Makefile.am index fe0bbaa3..0950ff54 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 6ab6e3c2..6fdb2790 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 00000000..bc2c7a72 --- /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 f8a1145b..aa23e401 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 47bc1798..b50bae1a 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 d6c1c823..2c3de67a 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 1d301de2..99de9f11 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 01af77a2..1eb4ae92 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 391e5937..93b28e43 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 3bd5721e..37e046bc 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 fe208b67..f89d803c 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 f2bd50dd..49149299 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 332a1d23..5ff38f0d 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 ecc72ab8..a3f14f3d 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 df8d485a..ff8e582b 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 9786d353..3aa3acaa 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 b944dd63..eea6d049 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 0a09637a..a27f8c50 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; -- 2.34.1