From 10a8a2237343699e3923d87e24dbf2d7fe225377 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Fri, 20 Jan 2012 13:17:16 -0500 Subject: [PATCH] Complete change of the source directory tree For the sake of clearness and awesomeness :P, this change was needed for better semantic across the code and better organization of source files. src/ --> Contains source files of the project bin/ --> Contains every binaries this git tree builds (lttng, lttng-sessiond and lttng-consumerd). lib/ --> Contains exported libraries (lttng-ctl). common/ --> Contains shared code for the entire project. (internal libraries mostly) Every internal headers are moved from include/ to src/common. The include directory only contains exported public headers now (lttng/lttng.h). The -I$(top_srcdir)/src is also added for all Makefiles. The consumerd APIs are not exported anymore. The reason is that the consumer will get completely re-engineered in the next months. It's our safety net for the APIs breakage of the coming year concerning the consumerd library. Renaming is done also on some internal libraries to follow the naming convention. The public library liblttngctl is renamed to liblttng-ctl making it linkable now with "-llttng-ctl" deprecating the old "-llttngctl". No code is changed with this commit except #include statements added/removed/renamed. This is why there is yet files and internal API calls that does not follow the naming convention (Ex: lttngerr.h, lttng-share.h in src/common). Signed-off-by: David Goulet --- .gitignore | 7 ++--- Makefile.am | 22 +++------------ common/Makefile.am | 7 ----- configure.ac | 28 ++++++++++--------- include/Makefile.am | 6 +--- libkernelctl/Makefile.am | 5 ---- liblttng-consumer/Makefile.am | 15 ---------- liblttng-kconsumer/Makefile.am | 8 ------ liblttng-sessiond-comm/Makefile.am | 5 ---- liblttng-ustconsumer/Makefile.am | 10 ------- liblttngctl/Makefile.am | 8 ------ lttng-consumerd/Makefile.am | 15 ---------- src/Makefile.am | 1 + src/bin/Makefile.am | 8 ++++++ src/bin/lttng-consumerd/Makefile.am | 15 ++++++++++ .../bin/lttng-consumerd}/lttng-consumerd.c | 13 +++++---- .../bin/lttng-consumerd}/lttng-consumerd.h | 0 .../bin/lttng-sessiond}/Makefile.am | 12 ++++---- .../bin/lttng-sessiond}/channel.c | 7 ++--- .../bin/lttng-sessiond}/channel.h | 0 .../bin/lttng-sessiond}/compat/compat-epoll.c | 2 +- .../bin/lttng-sessiond}/compat/compat-poll.c | 0 .../bin/lttng-sessiond}/compat/poll.h | 2 +- .../bin/lttng-sessiond}/context.c | 5 ++-- .../bin/lttng-sessiond}/context.h | 0 .../bin/lttng-sessiond}/event.c | 5 ++-- .../bin/lttng-sessiond}/event.h | 2 -- .../bin/lttng-sessiond}/futex.c | 2 +- .../bin/lttng-sessiond}/futex.h | 0 .../bin/lttng-sessiond}/kernel.c | 5 ++-- .../bin/lttng-sessiond}/kernel.h | 0 .../bin/lttng-sessiond}/lttng-sessiond.h | 3 ++ .../bin/lttng-sessiond}/lttng-ust-abi.h | 0 .../bin/lttng-sessiond}/lttng-ust-ctl.h | 0 .../bin/lttng-sessiond}/main.c | 15 ++++------ .../bin/lttng-sessiond}/session.c | 7 +++-- .../bin/lttng-sessiond}/session.h | 0 .../bin/lttng-sessiond}/shm.c | 2 +- .../bin/lttng-sessiond}/shm.h | 0 .../bin/lttng-sessiond}/trace-kernel.c | 3 +- .../bin/lttng-sessiond}/trace-kernel.h | 2 +- .../bin/lttng-sessiond}/trace-ust.c | 5 ++-- .../bin/lttng-sessiond}/trace-ust.h | 2 +- .../bin/lttng-sessiond}/ust-app.c | 8 ++---- .../bin/lttng-sessiond}/ust-app.h | 1 - .../bin/lttng-sessiond}/ust-consumer.c | 9 +++--- .../bin/lttng-sessiond}/ust-consumer.h | 0 .../bin/lttng-sessiond}/ust-ctl.h | 0 .../bin/lttng-sessiond}/utils.c | 2 +- .../bin/lttng-sessiond}/utils.h | 0 {lttng => src/bin/lttng}/Makefile.am | 5 ++-- {lttng => src/bin/lttng}/cmd.h | 5 ++-- .../bin/lttng}/commands/add_context.c | 0 {lttng => src/bin/lttng}/commands/calibrate.c | 0 {lttng => src/bin/lttng}/commands/create.c | 0 {lttng => src/bin/lttng}/commands/destroy.c | 0 .../bin/lttng}/commands/disable_channels.c | 0 .../bin/lttng}/commands/disable_events.c | 0 .../bin/lttng}/commands/enable_channels.c | 0 .../bin/lttng}/commands/enable_events.c | 0 {lttng => src/bin/lttng}/commands/list.c | 0 .../bin/lttng}/commands/set_session.c | 0 {lttng => src/bin/lttng}/commands/start.c | 0 {lttng => src/bin/lttng}/commands/stop.c | 0 {lttng => src/bin/lttng}/commands/version.c | 0 {lttng => src/bin/lttng}/conf.c | 3 +- {lttng => src/bin/lttng}/conf.h | 0 {lttng => src/bin/lttng}/lttng.c | 2 +- {lttng => src/bin/lttng}/utils.c | 3 +- {lttng => src/bin/lttng}/utils.h | 0 src/common/Makefile.am | 24 ++++++++++++++++ .../lttng-consumer.c => src/common/consumer.c | 14 ++++++---- .../lttng-consumer.h => src/common/consumer.h | 3 +- .../common/hashtable}/Makefile.am | 6 ++-- .../common/hashtable/hashtable.c | 6 ++-- .../common/hashtable/hashtable.h | 5 ++-- .../common/hashtable}/rculfhash-internal.h | 0 .../common/hashtable}/rculfhash-mm-chunk.c | 0 .../common/hashtable}/rculfhash-mm-mmap.c | 0 .../common/hashtable}/rculfhash-mm-order.c | 0 .../common/hashtable}/rculfhash.c | 0 .../common/hashtable}/rculfhash.h | 0 .../common/hashtable}/urcu-flavor.h | 0 {liblttng-ht => src/common/hashtable}/utils.c | 0 {liblttng-ht => src/common/hashtable}/utils.h | 0 src/common/kernel-consumer/Makefile.am | 8 ++++++ .../common/kernel-consumer/kernel-consumer.c | 10 +++---- .../common/kernel-consumer/kernel-consumer.h | 2 +- src/common/kernel-ctl/Makefile.am | 5 ++++ .../common/kernel-ctl/kernel-ctl.c | 3 +- .../common/kernel-ctl/kernel-ctl.h | 2 +- .../common/kernel-ctl}/kernel-ioctl.h | 0 {include => src/common}/lttng-kernel.h | 2 -- {include => src/common}/lttng-share.h | 2 -- {include => src/common}/lttngerr.h | 0 {common => src/common}/runas.c | 2 +- {common => src/common}/runas.h | 0 src/common/sessiond-comm/Makefile.am | 5 ++++ .../common/sessiond-comm/sessiond-comm.c | 2 +- .../common/sessiond-comm/sessiond-comm.h | 0 src/common/ust-consumer/Makefile.am | 8 ++++++ .../common/ust-consumer/ust-consumer.c | 10 +++---- .../common/ust-consumer/ust-consumer.h | 3 +- src/lib/Makefile.am | 1 + src/lib/lttng-ctl/Makefile.am | 6 ++++ .../lib/lttng-ctl/lttng-ctl.c | 6 ++-- tests/Makefile.am | 22 +++++++-------- tests/test_kernel_data_trace.c | 4 ++- tests/test_sessions.c | 4 +-- tests/test_ust_data_trace.c | 11 ++++---- tests/ust-nprocesses/run | 2 +- tests/utils.sh | 14 +++++----- 112 files changed, 234 insertions(+), 250 deletions(-) delete mode 100644 common/Makefile.am delete mode 100644 libkernelctl/Makefile.am delete mode 100644 liblttng-consumer/Makefile.am delete mode 100644 liblttng-kconsumer/Makefile.am delete mode 100644 liblttng-sessiond-comm/Makefile.am delete mode 100644 liblttng-ustconsumer/Makefile.am delete mode 100644 liblttngctl/Makefile.am delete mode 100644 lttng-consumerd/Makefile.am create mode 100644 src/Makefile.am create mode 100644 src/bin/Makefile.am create mode 100644 src/bin/lttng-consumerd/Makefile.am rename {lttng-consumerd => src/bin/lttng-consumerd}/lttng-consumerd.c (97%) rename {include => src/bin/lttng-consumerd}/lttng-consumerd.h (100%) rename {lttng-sessiond => src/bin/lttng-sessiond}/Makefile.am (77%) rename {lttng-sessiond => src/bin/lttng-sessiond}/channel.c (98%) rename {lttng-sessiond => src/bin/lttng-sessiond}/channel.h (100%) rename {lttng-sessiond => src/bin/lttng-sessiond}/compat/compat-epoll.c (99%) rename {lttng-sessiond => src/bin/lttng-sessiond}/compat/compat-poll.c (100%) rename {lttng-sessiond => src/bin/lttng-sessiond}/compat/poll.h (99%) rename {lttng-sessiond => src/bin/lttng-sessiond}/context.c (99%) rename {lttng-sessiond => src/bin/lttng-sessiond}/context.h (100%) rename {lttng-sessiond => src/bin/lttng-sessiond}/event.c (99%) rename {lttng-sessiond => src/bin/lttng-sessiond}/event.h (98%) rename {lttng-sessiond => src/bin/lttng-sessiond}/futex.c (98%) rename {lttng-sessiond => src/bin/lttng-sessiond}/futex.h (100%) rename {lttng-sessiond => src/bin/lttng-sessiond}/kernel.c (99%) rename {lttng-sessiond => src/bin/lttng-sessiond}/kernel.h (100%) rename {lttng-sessiond => src/bin/lttng-sessiond}/lttng-sessiond.h (97%) rename {lttng-sessiond => src/bin/lttng-sessiond}/lttng-ust-abi.h (100%) rename {lttng-sessiond => src/bin/lttng-sessiond}/lttng-ust-ctl.h (100%) rename {lttng-sessiond => src/bin/lttng-sessiond}/main.c (99%) rename {lttng-sessiond => src/bin/lttng-sessiond}/session.c (97%) rename {lttng-sessiond => src/bin/lttng-sessiond}/session.h (100%) rename {lttng-sessiond => src/bin/lttng-sessiond}/shm.c (99%) rename {lttng-sessiond => src/bin/lttng-sessiond}/shm.h (100%) rename {lttng-sessiond => src/bin/lttng-sessiond}/trace-kernel.c (99%) rename {lttng-sessiond => src/bin/lttng-sessiond}/trace-kernel.h (99%) rename {lttng-sessiond => src/bin/lttng-sessiond}/trace-ust.c (99%) rename {lttng-sessiond => src/bin/lttng-sessiond}/trace-ust.h (99%) rename {lttng-sessiond => src/bin/lttng-sessiond}/ust-app.c (99%) rename {lttng-sessiond => src/bin/lttng-sessiond}/ust-app.h (99%) rename {lttng-sessiond => src/bin/lttng-sessiond}/ust-consumer.c (97%) rename {lttng-sessiond => src/bin/lttng-sessiond}/ust-consumer.h (100%) rename {lttng-sessiond => src/bin/lttng-sessiond}/ust-ctl.h (100%) rename {lttng-sessiond => src/bin/lttng-sessiond}/utils.c (97%) rename {lttng-sessiond => src/bin/lttng-sessiond}/utils.h (100%) rename {lttng => src/bin/lttng}/Makefile.am (77%) rename {lttng => src/bin/lttng}/cmd.h (96%) rename {lttng => src/bin/lttng}/commands/add_context.c (100%) rename {lttng => src/bin/lttng}/commands/calibrate.c (100%) rename {lttng => src/bin/lttng}/commands/create.c (100%) rename {lttng => src/bin/lttng}/commands/destroy.c (100%) rename {lttng => src/bin/lttng}/commands/disable_channels.c (100%) rename {lttng => src/bin/lttng}/commands/disable_events.c (100%) rename {lttng => src/bin/lttng}/commands/enable_channels.c (100%) rename {lttng => src/bin/lttng}/commands/enable_events.c (100%) rename {lttng => src/bin/lttng}/commands/list.c (100%) rename {lttng => src/bin/lttng}/commands/set_session.c (100%) rename {lttng => src/bin/lttng}/commands/start.c (100%) rename {lttng => src/bin/lttng}/commands/stop.c (100%) rename {lttng => src/bin/lttng}/commands/version.c (100%) rename {lttng => src/bin/lttng}/conf.c (99%) rename {lttng => src/bin/lttng}/conf.h (100%) rename {lttng => src/bin/lttng}/lttng.c (99%) rename {lttng => src/bin/lttng}/utils.c (96%) rename {lttng => src/bin/lttng}/utils.h (100%) create mode 100644 src/common/Makefile.am rename liblttng-consumer/lttng-consumer.c => src/common/consumer.c (99%) rename include/lttng/lttng-consumer.h => src/common/consumer.h (99%) rename {liblttng-ht => src/common/hashtable}/Makefile.am (71%) rename liblttng-ht/lttng-ht.c => src/common/hashtable/hashtable.c (98%) rename include/lttng-ht.h => src/common/hashtable/hashtable.h (96%) rename {liblttng-ht => src/common/hashtable}/rculfhash-internal.h (100%) rename {liblttng-ht => src/common/hashtable}/rculfhash-mm-chunk.c (100%) rename {liblttng-ht => src/common/hashtable}/rculfhash-mm-mmap.c (100%) rename {liblttng-ht => src/common/hashtable}/rculfhash-mm-order.c (100%) rename {liblttng-ht => src/common/hashtable}/rculfhash.c (100%) rename {liblttng-ht => src/common/hashtable}/rculfhash.h (100%) rename {liblttng-ht => src/common/hashtable}/urcu-flavor.h (100%) rename {liblttng-ht => src/common/hashtable}/utils.c (100%) rename {liblttng-ht => src/common/hashtable}/utils.h (100%) create mode 100644 src/common/kernel-consumer/Makefile.am rename liblttng-kconsumer/lttng-kconsumer.c => src/common/kernel-consumer/kernel-consumer.c (98%) rename include/lttng/lttng-kconsumer.h => src/common/kernel-consumer/kernel-consumer.h (98%) create mode 100644 src/common/kernel-ctl/Makefile.am rename libkernelctl/kernelctl.c => src/common/kernel-ctl/kernel-ctl.c (99%) rename include/lttng-kernel-ctl.h => src/common/kernel-ctl/kernel-ctl.h (98%) rename {libkernelctl => src/common/kernel-ctl}/kernel-ioctl.h (100%) rename {include => src/common}/lttng-kernel.h (99%) rename {include => src/common}/lttng-share.h (99%) rename {include => src/common}/lttngerr.h (100%) rename {common => src/common}/runas.c (99%) rename {common => src/common}/runas.h (100%) create mode 100644 src/common/sessiond-comm/Makefile.am rename liblttng-sessiond-comm/lttng-sessiond-comm.c => src/common/sessiond-comm/sessiond-comm.c (99%) rename include/lttng-sessiond-comm.h => src/common/sessiond-comm/sessiond-comm.h (100%) create mode 100644 src/common/ust-consumer/Makefile.am rename liblttng-ustconsumer/lttng-ustconsumer.c => src/common/ust-consumer/ust-consumer.c (98%) rename include/lttng/lttng-ustconsumer.h => src/common/ust-consumer/ust-consumer.h (99%) create mode 100644 src/lib/Makefile.am create mode 100644 src/lib/lttng-ctl/Makefile.am rename liblttngctl/lttngctl.c => src/lib/lttng-ctl/lttng-ctl.c (99%) diff --git a/.gitignore b/.gitignore index afa850578..0eacb03bb 100644 --- a/.gitignore +++ b/.gitignore @@ -30,10 +30,9 @@ config/ !config/epoll.m4 !config/config_feature.m4 -lttng-sessiond/lttng-sessiond -lttng/lttng -lttng-kconsumerd/lttng-kconsumerd -lttng-consumerd/lttng-consumerd +src/bin/lttng-sessiond/lttng-sessiond +src/bin/lttng/lttng +src/bin/lttng-consumerd/lttng-consumerd tests/test_sessions tests/test_kernel_data_trace diff --git a/Makefile.am b/Makefile.am index 3b6344fa6..7184340a9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,20 +1,6 @@ ACLOCAL_AMFLAGS = -I config -SUBDIRS = common \ - liblttng-sessiond-comm \ - libkernelctl \ - liblttng-ht \ - liblttng-kconsumer \ - liblttng-ustconsumer \ - liblttng-consumer \ - lttng-consumerd - -if ! BUILD_CONSUMERD_ONLY -SUBDIRS += liblttngctl \ - lttng \ - lttng-sessiond -endif - -SUBDIRS += tests \ - include \ - doc +SUBDIRS = src \ + tests \ + include \ + doc diff --git a/common/Makefile.am b/common/Makefile.am deleted file mode 100644 index 1c6eb9b1d..000000000 --- a/common/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include - -AM_CFLAGS = -fno-strict-aliasing - -noinst_LTLIBRARIES = libcommon.la - -libcommon_la_SOURCES = runas.c runas.h diff --git a/configure.ac b/configure.ac index f98c874a6..072cc8516 100644 --- a/configure.ac +++ b/configure.ac @@ -122,7 +122,7 @@ LT_INIT CFLAGS="-Wall $CFLAGS -g -fno-strict-aliasing" -DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir)" +DEFAULT_INCLUDES="-I\$(top_srcdir) -I\$(top_builddir) -I\$(top_builddir)/src -I\$(top_builddir)/include" lttngincludedir="${includedir}/lttng" @@ -131,22 +131,24 @@ AC_SUBST(DEFAULT_INCLUDES) AC_CONFIG_FILES([ Makefile + doc/Makefile include/Makefile - common/Makefile - libkernelctl/Makefile - liblttng-consumer/Makefile - liblttng-kconsumer/Makefile - liblttng-ustconsumer/Makefile - liblttngctl/Makefile - liblttng-sessiond-comm/Makefile - liblttng-ht/Makefile - lttng-consumerd/Makefile - lttng-sessiond/Makefile - lttng/Makefile + src/Makefile + src/common/Makefile + src/common/kernel-ctl/Makefile + src/common/kernel-consumer/Makefile + src/common/ust-consumer/Makefile + src/common/hashtable/Makefile + src/common/sessiond-comm/Makefile + src/lib/Makefile + src/lib/lttng-ctl/Makefile + src/bin/Makefile + src/bin/lttng-consumerd/Makefile + src/bin/lttng-sessiond/Makefile + src/bin/lttng/Makefile tests/Makefile tests/ust-nevents/Makefile tests/ust-nprocesses/Makefile - doc/Makefile ]) AC_OUTPUT diff --git a/include/Makefile.am b/include/Makefile.am index fd212f22f..bf9187f8a 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,5 +1 @@ -lttnginclude_HEADERS = lttng/lttng.h lttng/lttng-kconsumer.h \ - lttng/lttng-ustconsumer.h lttng/lttng-consumer.h - -noinst_HEADERS = lttngerr.h lttng-kernel.h lttng-consumerd.h lttng-share.h \ - lttng-sessiond-comm.h lttng-kernel-ctl.h lttng-ht.h +lttnginclude_HEADERS = lttng/lttng.h diff --git a/libkernelctl/Makefile.am b/libkernelctl/Makefile.am deleted file mode 100644 index cabdeedd9..000000000 --- a/libkernelctl/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include - -noinst_LTLIBRARIES = libkernelctl.la - -libkernelctl_la_SOURCES = kernelctl.c kernel-ioctl.h diff --git a/liblttng-consumer/Makefile.am b/liblttng-consumer/Makefile.am deleted file mode 100644 index aadba52b5..000000000 --- a/liblttng-consumer/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include - -lib_LTLIBRARIES = liblttng-consumer.la - -liblttng_consumer_la_SOURCES = lttng-consumer.c - -liblttng_consumer_la_LIBADD = \ - $(top_builddir)/liblttng-sessiond-comm/liblttng-sessiond-comm.la \ - $(top_builddir)/liblttng-kconsumer/liblttng-kconsumer.la \ - $(top_builddir)/liblttng-ht/liblttng-ht.la - -if HAVE_LIBLTTNG_UST_CTL -liblttng_consumer_la_LIBADD += \ - $(top_builddir)/liblttng-ustconsumer/liblttng-ustconsumer.la -endif diff --git a/liblttng-kconsumer/Makefile.am b/liblttng-kconsumer/Makefile.am deleted file mode 100644 index 15021cd05..000000000 --- a/liblttng-kconsumer/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include - -noinst_LTLIBRARIES = liblttng-kconsumer.la - -liblttng_kconsumer_la_SOURCES = lttng-kconsumer.c - -liblttng_kconsumer_la_LIBADD = \ - $(top_builddir)/libkernelctl/libkernelctl.la diff --git a/liblttng-sessiond-comm/Makefile.am b/liblttng-sessiond-comm/Makefile.am deleted file mode 100644 index 61d6882ea..000000000 --- a/liblttng-sessiond-comm/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include - -noinst_LTLIBRARIES = liblttng-sessiond-comm.la - -liblttng_sessiond_comm_la_SOURCES = lttng-sessiond-comm.c diff --git a/liblttng-ustconsumer/Makefile.am b/liblttng-ustconsumer/Makefile.am deleted file mode 100644 index e01064fd7..000000000 --- a/liblttng-ustconsumer/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include - -if HAVE_LIBLTTNG_UST_CTL -noinst_LTLIBRARIES = liblttng-ustconsumer.la - -liblttng_ustconsumer_la_SOURCES = lttng-ustconsumer.c - -liblttng_ustconsumer_la_LIBADD = -llttng-ust-ctl - -endif diff --git a/liblttngctl/Makefile.am b/liblttngctl/Makefile.am deleted file mode 100644 index 87b94dc86..000000000 --- a/liblttngctl/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include - -lib_LTLIBRARIES = liblttngctl.la - -liblttngctl_la_SOURCES = lttngctl.c - -liblttngctl_la_LIBADD = \ - $(top_builddir)/liblttng-sessiond-comm/liblttng-sessiond-comm.la diff --git a/lttng-consumerd/Makefile.am b/lttng-consumerd/Makefile.am deleted file mode 100644 index 9e8d036da..000000000 --- a/lttng-consumerd/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include - -bin_PROGRAMS = lttng-consumerd - -lttng_consumerd_SOURCES = lttng-consumerd.c - -lttng_consumerd_LDADD = \ - $(top_builddir)/libkernelctl/libkernelctl.la \ - $(top_builddir)/liblttng-consumer/liblttng-consumer.la \ - $(top_builddir)/liblttng-sessiond-comm/liblttng-sessiond-comm.la \ - $(top_builddir)/common/libcommon.la - -if HAVE_LIBLTTNG_UST_CTL -lttng_consumerd_LDADD += -llttng-ust-ctl -endif diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 000000000..103337c45 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = common lib bin diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am new file mode 100644 index 000000000..07b694918 --- /dev/null +++ b/src/bin/Makefile.am @@ -0,0 +1,8 @@ +ACLOCAL_AMFLAGS = -I config + +SUBDIRS = lttng-consumerd + +if ! BUILD_CONSUMERD_ONLY +SUBDIRS += lttng \ + lttng-sessiond +endif diff --git a/src/bin/lttng-consumerd/Makefile.am b/src/bin/lttng-consumerd/Makefile.am new file mode 100644 index 000000000..25cd6e922 --- /dev/null +++ b/src/bin/lttng-consumerd/Makefile.am @@ -0,0 +1,15 @@ +AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src + +bin_PROGRAMS = lttng-consumerd + +lttng_consumerd_SOURCES = lttng-consumerd.c + +lttng_consumerd_LDADD = \ + $(top_builddir)/src/common/kernel-ctl/libkernel-ctl.la \ + $(top_builddir)/src/common/libconsumer.la \ + $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la \ + $(top_builddir)/src/common/libcommon.la + +if HAVE_LIBLTTNG_UST_CTL +lttng_consumerd_LDADD += -llttng-ust-ctl +endif diff --git a/lttng-consumerd/lttng-consumerd.c b/src/bin/lttng-consumerd/lttng-consumerd.c similarity index 97% rename from lttng-consumerd/lttng-consumerd.c rename to src/bin/lttng-consumerd/lttng-consumerd.c index e8e511702..8cb264ab1 100644 --- a/lttng-consumerd/lttng-consumerd.c +++ b/src/bin/lttng-consumerd/lttng-consumerd.c @@ -40,12 +40,13 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include + +#include "lttng-consumerd.h" /* TODO : support UST (all direct kernctl accesses). */ diff --git a/include/lttng-consumerd.h b/src/bin/lttng-consumerd/lttng-consumerd.h similarity index 100% rename from include/lttng-consumerd.h rename to src/bin/lttng-consumerd/lttng-consumerd.h diff --git a/lttng-sessiond/Makefile.am b/src/bin/lttng-sessiond/Makefile.am similarity index 77% rename from lttng-sessiond/Makefile.am rename to src/bin/lttng-sessiond/Makefile.am index 8fcea947e..e824d4939 100644 --- a/lttng-sessiond/Makefile.am +++ b/src/bin/lttng-sessiond/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include \ +AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src \ -DINSTALL_BIN_PATH=\""$(bindir)"\" \ -DINSTALL_LIB_PATH=\""$(libdir)"\" @@ -34,11 +34,11 @@ lttng_sessiond_SOURCES += lttng-sessiond.h main.c # link on liblttngctl for check if sessiond is already alive. lttng_sessiond_LDADD = -lrt -lurcu-common -lurcu \ - $(top_builddir)/liblttng-sessiond-comm/liblttng-sessiond-comm.la \ - $(top_builddir)/libkernelctl/libkernelctl.la \ - $(top_builddir)/liblttngctl/liblttngctl.la \ - $(top_builddir)/common/libcommon.la \ - $(top_builddir)/liblttng-ht/liblttng-ht.la + $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la \ + $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la \ + $(top_builddir)/src/common/kernel-ctl/libkernel-ctl.la \ + $(top_builddir)/src/common/hashtable/libhashtable.la \ + $(top_builddir)/src/common/libcommon.la if HAVE_LIBLTTNG_UST_CTL lttng_sessiond_LDADD += -llttng-ust-ctl diff --git a/lttng-sessiond/channel.c b/src/bin/lttng-sessiond/channel.c similarity index 98% rename from lttng-sessiond/channel.c rename to src/bin/lttng-sessiond/channel.c index 0e8b16720..df411b228 100644 --- a/lttng-sessiond/channel.c +++ b/src/bin/lttng-sessiond/channel.c @@ -19,10 +19,9 @@ #include #include -#include -#include -#include -#include +#include +#include +#include #include "channel.h" #include "kernel.h" diff --git a/lttng-sessiond/channel.h b/src/bin/lttng-sessiond/channel.h similarity index 100% rename from lttng-sessiond/channel.h rename to src/bin/lttng-sessiond/channel.h diff --git a/lttng-sessiond/compat/compat-epoll.c b/src/bin/lttng-sessiond/compat/compat-epoll.c similarity index 99% rename from lttng-sessiond/compat/compat-epoll.c rename to src/bin/lttng-sessiond/compat/compat-epoll.c index aca80f331..5e969ee01 100644 --- a/lttng-sessiond/compat/compat-epoll.c +++ b/src/bin/lttng-sessiond/compat/compat-epoll.c @@ -23,7 +23,7 @@ #include #include -#include +#include #include "poll.h" diff --git a/lttng-sessiond/compat/compat-poll.c b/src/bin/lttng-sessiond/compat/compat-poll.c similarity index 100% rename from lttng-sessiond/compat/compat-poll.c rename to src/bin/lttng-sessiond/compat/compat-poll.c diff --git a/lttng-sessiond/compat/poll.h b/src/bin/lttng-sessiond/compat/poll.h similarity index 99% rename from lttng-sessiond/compat/poll.h rename to src/bin/lttng-sessiond/compat/poll.h index 3e804305f..a7766400d 100644 --- a/lttng-sessiond/compat/poll.h +++ b/src/bin/lttng-sessiond/compat/poll.h @@ -21,7 +21,7 @@ #include #include -#include +#include /* * Value taken from the hard limit allowed by the kernel when using setrlimit diff --git a/lttng-sessiond/context.c b/src/bin/lttng-sessiond/context.c similarity index 99% rename from lttng-sessiond/context.c rename to src/bin/lttng-sessiond/context.c index e29cc09a5..7fc455438 100644 --- a/lttng-sessiond/context.c +++ b/src/bin/lttng-sessiond/context.c @@ -22,9 +22,8 @@ #include #include -#include -#include -#include +#include +#include #include "context.h" #include "kernel.h" diff --git a/lttng-sessiond/context.h b/src/bin/lttng-sessiond/context.h similarity index 100% rename from lttng-sessiond/context.h rename to src/bin/lttng-sessiond/context.h diff --git a/lttng-sessiond/event.c b/src/bin/lttng-sessiond/event.c similarity index 99% rename from lttng-sessiond/event.c rename to src/bin/lttng-sessiond/event.c index 106870743..31c0c9715 100644 --- a/lttng-sessiond/event.c +++ b/src/bin/lttng-sessiond/event.c @@ -21,9 +21,8 @@ #include #include -#include -#include -#include +#include +#include #include "channel.h" #include "event.h" diff --git a/lttng-sessiond/event.h b/src/bin/lttng-sessiond/event.h similarity index 98% rename from lttng-sessiond/event.h rename to src/bin/lttng-sessiond/event.h index 9ea0e4621..6103240b3 100644 --- a/lttng-sessiond/event.h +++ b/src/bin/lttng-sessiond/event.h @@ -18,8 +18,6 @@ #ifndef _LTT_EVENT_H #define _LTT_EVENT_H -#include - #include "trace-kernel.h" int event_kernel_disable_tracepoint(struct ltt_kernel_session *ksession, diff --git a/lttng-sessiond/futex.c b/src/bin/lttng-sessiond/futex.c similarity index 98% rename from lttng-sessiond/futex.c rename to src/bin/lttng-sessiond/futex.c index e01771e6e..eda1fa313 100644 --- a/lttng-sessiond/futex.c +++ b/src/bin/lttng-sessiond/futex.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include "futex.h" diff --git a/lttng-sessiond/futex.h b/src/bin/lttng-sessiond/futex.h similarity index 100% rename from lttng-sessiond/futex.h rename to src/bin/lttng-sessiond/futex.h diff --git a/lttng-sessiond/kernel.c b/src/bin/lttng-sessiond/kernel.c similarity index 99% rename from lttng-sessiond/kernel.c rename to src/bin/lttng-sessiond/kernel.c index 67c0d6fe9..a8fd844d9 100644 --- a/lttng-sessiond/kernel.c +++ b/src/bin/lttng-sessiond/kernel.c @@ -24,8 +24,9 @@ #include #include -#include -#include +#include +#include +#include #include "kernel.h" diff --git a/lttng-sessiond/kernel.h b/src/bin/lttng-sessiond/kernel.h similarity index 100% rename from lttng-sessiond/kernel.h rename to src/bin/lttng-sessiond/kernel.h diff --git a/lttng-sessiond/lttng-sessiond.h b/src/bin/lttng-sessiond/lttng-sessiond.h similarity index 97% rename from lttng-sessiond/lttng-sessiond.h rename to src/bin/lttng-sessiond/lttng-sessiond.h index 7de024f80..6a7006c0b 100644 --- a/lttng-sessiond/lttng-sessiond.h +++ b/src/bin/lttng-sessiond/lttng-sessiond.h @@ -23,6 +23,9 @@ #include #include +#include + +#include "session.h" #include "ust-app.h" #define DEFAULT_HOME_DIR "/tmp" diff --git a/lttng-sessiond/lttng-ust-abi.h b/src/bin/lttng-sessiond/lttng-ust-abi.h similarity index 100% rename from lttng-sessiond/lttng-ust-abi.h rename to src/bin/lttng-sessiond/lttng-ust-abi.h diff --git a/lttng-sessiond/lttng-ust-ctl.h b/src/bin/lttng-sessiond/lttng-ust-ctl.h similarity index 100% rename from lttng-sessiond/lttng-ust-ctl.h rename to src/bin/lttng-sessiond/lttng-ust-ctl.h diff --git a/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c similarity index 99% rename from lttng-sessiond/main.c rename to src/bin/lttng-sessiond/main.c index 7d8546d8e..0d1a916c2 100644 --- a/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -38,23 +38,20 @@ #include #include -#include -#include -#include -#include - -#include -#include "common/runas.h" +#include +#include +#include +#include +#include +#include "lttng-sessiond.h" #include "channel.h" #include "compat/poll.h" #include "context.h" #include "event.h" #include "futex.h" #include "kernel.h" -#include "lttng-sessiond.h" #include "shm.h" -#include "ust-app.h" #include "ust-ctl.h" #include "utils.h" diff --git a/lttng-sessiond/session.c b/src/bin/lttng-sessiond/session.c similarity index 97% rename from lttng-sessiond/session.c rename to src/bin/lttng-sessiond/session.c index 1a79fd564..68edeb9ee 100644 --- a/lttng-sessiond/session.c +++ b/src/bin/lttng-sessiond/session.c @@ -25,10 +25,11 @@ #include #include -#include -#include +#include +#include +#include +#include -#include "common/runas.h" #include "session.h" /* diff --git a/lttng-sessiond/session.h b/src/bin/lttng-sessiond/session.h similarity index 100% rename from lttng-sessiond/session.h rename to src/bin/lttng-sessiond/session.h diff --git a/lttng-sessiond/shm.c b/src/bin/lttng-sessiond/shm.c similarity index 99% rename from lttng-sessiond/shm.c rename to src/bin/lttng-sessiond/shm.c index 7dac1659f..64c712e85 100644 --- a/lttng-sessiond/shm.c +++ b/src/bin/lttng-sessiond/shm.c @@ -26,7 +26,7 @@ #include #include -#include +#include #include "shm.h" diff --git a/lttng-sessiond/shm.h b/src/bin/lttng-sessiond/shm.h similarity index 100% rename from lttng-sessiond/shm.h rename to src/bin/lttng-sessiond/shm.h diff --git a/lttng-sessiond/trace-kernel.c b/src/bin/lttng-sessiond/trace-kernel.c similarity index 99% rename from lttng-sessiond/trace-kernel.c rename to src/bin/lttng-sessiond/trace-kernel.c index c5b81f1e0..d1225c07c 100644 --- a/lttng-sessiond/trace-kernel.c +++ b/src/bin/lttng-sessiond/trace-kernel.c @@ -22,7 +22,8 @@ #include #include -#include +#include +#include #include "trace-kernel.h" diff --git a/lttng-sessiond/trace-kernel.h b/src/bin/lttng-sessiond/trace-kernel.h similarity index 99% rename from lttng-sessiond/trace-kernel.h rename to src/bin/lttng-sessiond/trace-kernel.h index 1057c1e07..ae993c8d9 100644 --- a/lttng-sessiond/trace-kernel.h +++ b/src/bin/lttng-sessiond/trace-kernel.h @@ -23,7 +23,7 @@ #include #include -#include +#include /* Kernel event list */ struct ltt_kernel_event_list { diff --git a/lttng-sessiond/trace-ust.c b/src/bin/lttng-sessiond/trace-ust.c similarity index 99% rename from lttng-sessiond/trace-ust.c rename to src/bin/lttng-sessiond/trace-ust.c index c85e79ce1..a947dada5 100644 --- a/lttng-sessiond/trace-ust.c +++ b/src/bin/lttng-sessiond/trace-ust.c @@ -21,9 +21,8 @@ #include #include -#include -#include -#include +#include +#include #include "trace-ust.h" diff --git a/lttng-sessiond/trace-ust.h b/src/bin/lttng-sessiond/trace-ust.h similarity index 99% rename from lttng-sessiond/trace-ust.h rename to src/bin/lttng-sessiond/trace-ust.h index c033ed6c5..7459218d3 100644 --- a/lttng-sessiond/trace-ust.h +++ b/src/bin/lttng-sessiond/trace-ust.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include "ust-ctl.h" diff --git a/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c similarity index 99% rename from lttng-sessiond/ust-app.c rename to src/bin/lttng-sessiond/ust-app.c index 597627060..057f675e4 100644 --- a/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -25,14 +25,12 @@ #include #include #include - #include -#include -#include -#include +#include +#include +#include -#include "common/runas.h" #include "ust-app.h" #include "ust-consumer.h" #include "ust-ctl.h" diff --git a/lttng-sessiond/ust-app.h b/src/bin/lttng-sessiond/ust-app.h similarity index 99% rename from lttng-sessiond/ust-app.h rename to src/bin/lttng-sessiond/ust-app.h index 071ad0d90..d7fbcd5d0 100644 --- a/lttng-sessiond/ust-app.h +++ b/src/bin/lttng-sessiond/ust-app.h @@ -20,7 +20,6 @@ #define _LTT_UST_APP_H #include -#include #include "trace-ust.h" diff --git a/lttng-sessiond/ust-consumer.c b/src/bin/lttng-sessiond/ust-consumer.c similarity index 97% rename from lttng-sessiond/ust-consumer.c rename to src/bin/lttng-sessiond/ust-consumer.c index c02cbf965..c0d5069e7 100644 --- a/lttng-sessiond/ust-consumer.c +++ b/src/bin/lttng-sessiond/ust-consumer.c @@ -22,11 +22,10 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include #include "ust-consumer.h" diff --git a/lttng-sessiond/ust-consumer.h b/src/bin/lttng-sessiond/ust-consumer.h similarity index 100% rename from lttng-sessiond/ust-consumer.h rename to src/bin/lttng-sessiond/ust-consumer.h diff --git a/lttng-sessiond/ust-ctl.h b/src/bin/lttng-sessiond/ust-ctl.h similarity index 100% rename from lttng-sessiond/ust-ctl.h rename to src/bin/lttng-sessiond/ust-ctl.h diff --git a/lttng-sessiond/utils.c b/src/bin/lttng-sessiond/utils.c similarity index 97% rename from lttng-sessiond/utils.c rename to src/bin/lttng-sessiond/utils.c index 22a07ffae..313f4cf78 100644 --- a/lttng-sessiond/utils.c +++ b/src/bin/lttng-sessiond/utils.c @@ -24,7 +24,7 @@ #include #include -#include +#include #include "utils.h" diff --git a/lttng-sessiond/utils.h b/src/bin/lttng-sessiond/utils.h similarity index 100% rename from lttng-sessiond/utils.h rename to src/bin/lttng-sessiond/utils.h diff --git a/lttng/Makefile.am b/src/bin/lttng/Makefile.am similarity index 77% rename from lttng/Makefile.am rename to src/bin/lttng/Makefile.am index 1105143f3..34c47dfcf 100644 --- a/lttng/Makefile.am +++ b/src/bin/lttng/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include \ +AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src \ -DINSTALL_BIN_PATH=\""$(bindir)"\" bin_PROGRAMS = lttng @@ -11,5 +11,4 @@ lttng_SOURCES = cmd.h conf.c conf.h commands/start.c \ commands/set_session.c commands/version.c \ commands/calibrate.c utils.c utils.h lttng.c -lttng_LDADD = \ - $(top_builddir)/liblttngctl/liblttngctl.la +lttng_LDADD = $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la diff --git a/lttng/cmd.h b/src/bin/lttng/cmd.h similarity index 96% rename from lttng/cmd.h rename to src/bin/lttng/cmd.h index 257d0a1c4..f66d6d953 100644 --- a/lttng/cmd.h +++ b/src/bin/lttng/cmd.h @@ -20,9 +20,8 @@ #define _LTTNG_CMD_H #include -#include "lttngerr.h" -#include "lttng-share.h" -#include "lttng-kernel.h" +#include +#include enum cmd_error_code { CMD_SUCCESS, diff --git a/lttng/commands/add_context.c b/src/bin/lttng/commands/add_context.c similarity index 100% rename from lttng/commands/add_context.c rename to src/bin/lttng/commands/add_context.c diff --git a/lttng/commands/calibrate.c b/src/bin/lttng/commands/calibrate.c similarity index 100% rename from lttng/commands/calibrate.c rename to src/bin/lttng/commands/calibrate.c diff --git a/lttng/commands/create.c b/src/bin/lttng/commands/create.c similarity index 100% rename from lttng/commands/create.c rename to src/bin/lttng/commands/create.c diff --git a/lttng/commands/destroy.c b/src/bin/lttng/commands/destroy.c similarity index 100% rename from lttng/commands/destroy.c rename to src/bin/lttng/commands/destroy.c diff --git a/lttng/commands/disable_channels.c b/src/bin/lttng/commands/disable_channels.c similarity index 100% rename from lttng/commands/disable_channels.c rename to src/bin/lttng/commands/disable_channels.c diff --git a/lttng/commands/disable_events.c b/src/bin/lttng/commands/disable_events.c similarity index 100% rename from lttng/commands/disable_events.c rename to src/bin/lttng/commands/disable_events.c diff --git a/lttng/commands/enable_channels.c b/src/bin/lttng/commands/enable_channels.c similarity index 100% rename from lttng/commands/enable_channels.c rename to src/bin/lttng/commands/enable_channels.c diff --git a/lttng/commands/enable_events.c b/src/bin/lttng/commands/enable_events.c similarity index 100% rename from lttng/commands/enable_events.c rename to src/bin/lttng/commands/enable_events.c diff --git a/lttng/commands/list.c b/src/bin/lttng/commands/list.c similarity index 100% rename from lttng/commands/list.c rename to src/bin/lttng/commands/list.c diff --git a/lttng/commands/set_session.c b/src/bin/lttng/commands/set_session.c similarity index 100% rename from lttng/commands/set_session.c rename to src/bin/lttng/commands/set_session.c diff --git a/lttng/commands/start.c b/src/bin/lttng/commands/start.c similarity index 100% rename from lttng/commands/start.c rename to src/bin/lttng/commands/start.c diff --git a/lttng/commands/stop.c b/src/bin/lttng/commands/stop.c similarity index 100% rename from lttng/commands/stop.c rename to src/bin/lttng/commands/stop.c diff --git a/lttng/commands/version.c b/src/bin/lttng/commands/version.c similarity index 100% rename from lttng/commands/version.c rename to src/bin/lttng/commands/version.c diff --git a/lttng/conf.c b/src/bin/lttng/conf.c similarity index 99% rename from lttng/conf.c rename to src/bin/lttng/conf.c index 7337d92ca..9d2bfbb66 100644 --- a/lttng/conf.c +++ b/src/bin/lttng/conf.c @@ -25,8 +25,9 @@ #include #include +#include + #include "conf.h" -#include "lttngerr.h" /* * config_get_file_path diff --git a/lttng/conf.h b/src/bin/lttng/conf.h similarity index 100% rename from lttng/conf.h rename to src/bin/lttng/conf.h diff --git a/lttng/lttng.c b/src/bin/lttng/lttng.c similarity index 99% rename from lttng/lttng.c rename to src/bin/lttng/lttng.c index 69b563d4a..65cea55a2 100644 --- a/lttng/lttng.c +++ b/src/bin/lttng/lttng.c @@ -26,10 +26,10 @@ #include #include +#include #include "cmd.h" #include "conf.h" -#include "lttngerr.h" /* Variables */ static char *progname; diff --git a/lttng/utils.c b/src/bin/lttng/utils.c similarity index 96% rename from lttng/utils.c rename to src/bin/lttng/utils.c index db7fd38fe..25d463adf 100644 --- a/lttng/utils.c +++ b/src/bin/lttng/utils.c @@ -18,10 +18,9 @@ #include -#include +#include #include "conf.h" -#include "lttngerr.h" /* * get_session_name diff --git a/lttng/utils.h b/src/bin/lttng/utils.h similarity index 100% rename from lttng/utils.h rename to src/bin/lttng/utils.h diff --git a/src/common/Makefile.am b/src/common/Makefile.am new file mode 100644 index 000000000..84c0b16a1 --- /dev/null +++ b/src/common/Makefile.am @@ -0,0 +1,24 @@ +AM_CPPFLAGS = + +SUBDIRS = hashtable kernel-ctl sessiond-comm kernel-consumer ust-consumer + +AM_CFLAGS = -fno-strict-aliasing + +noinst_LTLIBRARIES = libcommon.la + +libcommon_la_SOURCES = runas.c runas.h + +# Consumer library +noinst_LTLIBRARIES += libconsumer.la + +libconsumer_la_SOURCES = consumer.c + +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 + +if HAVE_LIBLTTNG_UST_CTL +libconsumer_la_LIBADD += \ + $(top_builddir)/src/common/ust-consumer/libust-consumer.la +endif diff --git a/liblttng-consumer/lttng-consumer.c b/src/common/consumer.c similarity index 99% rename from liblttng-consumer/lttng-consumer.c rename to src/common/consumer.c index 0263aa1d8..9e7256568 100644 --- a/liblttng-consumer/lttng-consumer.c +++ b/src/common/consumer.c @@ -29,12 +29,14 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include + +#include "consumer.h" struct lttng_consumer_global_data consumer_data = { .stream_count = 0, diff --git a/include/lttng/lttng-consumer.h b/src/common/consumer.h similarity index 99% rename from include/lttng/lttng-consumer.h rename to src/common/consumer.h index 3d16d4973..dc5fc9968 100644 --- a/include/lttng/lttng-consumer.h +++ b/src/common/consumer.h @@ -25,7 +25,8 @@ #include #include -#include + +#include "src/common/hashtable/hashtable.h" /* * When the receiving thread dies, we need to have a way to make the polling diff --git a/liblttng-ht/Makefile.am b/src/common/hashtable/Makefile.am similarity index 71% rename from liblttng-ht/Makefile.am rename to src/common/hashtable/Makefile.am index bd85018d7..7a2b83517 100644 --- a/liblttng-ht/Makefile.am +++ b/src/common/hashtable/Makefile.am @@ -1,8 +1,8 @@ AM_CPPFLAGS = -I$(top_srcdir)/include -noinst_LTLIBRARIES = liblttng-ht.la +noinst_LTLIBRARIES = libhashtable.la -liblttng_ht_la_SOURCES = lttng-ht.c \ +libhashtable_la_SOURCES = hashtable.c hashtable.h \ utils.c utils.h \ rculfhash-internal.h urcu-flavor.h \ rculfhash.h rculfhash.c \ @@ -10,4 +10,4 @@ liblttng_ht_la_SOURCES = lttng-ht.c \ rculfhash-mm-mmap.c \ rculfhash-mm-order.c -liblttng_ht_la_LIBADD = -lurcu-common -lurcu +libhashtable_la_LIBADD = -lurcu-common -lurcu diff --git a/liblttng-ht/lttng-ht.c b/src/common/hashtable/hashtable.c similarity index 98% rename from liblttng-ht/lttng-ht.c rename to src/common/hashtable/hashtable.c index 74e5ed4fe..4f64778df 100644 --- a/liblttng-ht/lttng-ht.c +++ b/src/common/hashtable/hashtable.c @@ -21,10 +21,10 @@ #include #include -#include -#include -#include +#include +#include +#include "hashtable.h" #include "utils.h" #define HASH_SEED 0x42UL /* The answer to life */ diff --git a/include/lttng-ht.h b/src/common/hashtable/hashtable.h similarity index 96% rename from include/lttng-ht.h rename to src/common/hashtable/hashtable.h index 649ffcf54..1c2889d3e 100644 --- a/include/lttng-ht.h +++ b/src/common/hashtable/hashtable.h @@ -19,8 +19,9 @@ #define _LTT_HT_H #include -#include "../liblttng-ht/rculfhash.h" -#include "../liblttng-ht/rculfhash-internal.h" + +#include "rculfhash.h" +#include "rculfhash-internal.h" typedef unsigned long (*hash_fct)(void *_key, unsigned long seed); typedef cds_lfht_match_fct hash_match_fct; diff --git a/liblttng-ht/rculfhash-internal.h b/src/common/hashtable/rculfhash-internal.h similarity index 100% rename from liblttng-ht/rculfhash-internal.h rename to src/common/hashtable/rculfhash-internal.h diff --git a/liblttng-ht/rculfhash-mm-chunk.c b/src/common/hashtable/rculfhash-mm-chunk.c similarity index 100% rename from liblttng-ht/rculfhash-mm-chunk.c rename to src/common/hashtable/rculfhash-mm-chunk.c diff --git a/liblttng-ht/rculfhash-mm-mmap.c b/src/common/hashtable/rculfhash-mm-mmap.c similarity index 100% rename from liblttng-ht/rculfhash-mm-mmap.c rename to src/common/hashtable/rculfhash-mm-mmap.c diff --git a/liblttng-ht/rculfhash-mm-order.c b/src/common/hashtable/rculfhash-mm-order.c similarity index 100% rename from liblttng-ht/rculfhash-mm-order.c rename to src/common/hashtable/rculfhash-mm-order.c diff --git a/liblttng-ht/rculfhash.c b/src/common/hashtable/rculfhash.c similarity index 100% rename from liblttng-ht/rculfhash.c rename to src/common/hashtable/rculfhash.c diff --git a/liblttng-ht/rculfhash.h b/src/common/hashtable/rculfhash.h similarity index 100% rename from liblttng-ht/rculfhash.h rename to src/common/hashtable/rculfhash.h diff --git a/liblttng-ht/urcu-flavor.h b/src/common/hashtable/urcu-flavor.h similarity index 100% rename from liblttng-ht/urcu-flavor.h rename to src/common/hashtable/urcu-flavor.h diff --git a/liblttng-ht/utils.c b/src/common/hashtable/utils.c similarity index 100% rename from liblttng-ht/utils.c rename to src/common/hashtable/utils.c diff --git a/liblttng-ht/utils.h b/src/common/hashtable/utils.h similarity index 100% rename from liblttng-ht/utils.h rename to src/common/hashtable/utils.h diff --git a/src/common/kernel-consumer/Makefile.am b/src/common/kernel-consumer/Makefile.am new file mode 100644 index 000000000..b914bf16c --- /dev/null +++ b/src/common/kernel-consumer/Makefile.am @@ -0,0 +1,8 @@ +# Kernel consumer library +noinst_LTLIBRARIES = libkernel-consumer.la + +libkernel_consumer_la_SOURCES = kernel-consumer.c + +libkernel_consumer_la_LIBADD = \ + $(top_builddir)/src/common/kernel-ctl/libkernel-ctl.la + diff --git a/liblttng-kconsumer/lttng-kconsumer.c b/src/common/kernel-consumer/kernel-consumer.c similarity index 98% rename from liblttng-kconsumer/lttng-kconsumer.c rename to src/common/kernel-consumer/kernel-consumer.c index 488d6b859..87436371f 100644 --- a/liblttng-kconsumer/lttng-kconsumer.c +++ b/src/common/kernel-consumer/kernel-consumer.c @@ -29,12 +29,12 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include -#include "common/runas.h" +#include "kernel-consumer.h" extern struct lttng_consumer_global_data consumer_data; extern int consumer_poll_timeout; diff --git a/include/lttng/lttng-kconsumer.h b/src/common/kernel-consumer/kernel-consumer.h similarity index 98% rename from include/lttng/lttng-kconsumer.h rename to src/common/kernel-consumer/kernel-consumer.h index 4753b5c59..6e820044b 100644 --- a/include/lttng/lttng-kconsumer.h +++ b/src/common/kernel-consumer/kernel-consumer.h @@ -20,7 +20,7 @@ #ifndef _LTTNG_KCONSUMER_H #define _LTTNG_KCONSUMER_H -#include +#include /* * Mmap the ring buffer, read it and write the data to the tracefile. diff --git a/src/common/kernel-ctl/Makefile.am b/src/common/kernel-ctl/Makefile.am new file mode 100644 index 000000000..1c71c5ce9 --- /dev/null +++ b/src/common/kernel-ctl/Makefile.am @@ -0,0 +1,5 @@ +AM_CPPFLAGS = -I$(top_srcdir)/include + +noinst_LTLIBRARIES = libkernel-ctl.la + +libkernel_ctl_la_SOURCES = kernel-ctl.c kernel-ioctl.h diff --git a/libkernelctl/kernelctl.c b/src/common/kernel-ctl/kernel-ctl.c similarity index 99% rename from libkernelctl/kernelctl.c rename to src/common/kernel-ctl/kernel-ctl.c index 7936b2742..973ea7993 100644 --- a/libkernelctl/kernelctl.c +++ b/src/common/kernel-ctl/kernel-ctl.c @@ -19,8 +19,7 @@ #include -#include - +#include "kernel-ctl.h" #include "kernel-ioctl.h" int kernctl_create_session(int fd) diff --git a/include/lttng-kernel-ctl.h b/src/common/kernel-ctl/kernel-ctl.h similarity index 98% rename from include/lttng-kernel-ctl.h rename to src/common/kernel-ctl/kernel-ctl.h index fa307e446..2bfb2b048 100644 --- a/include/lttng-kernel-ctl.h +++ b/src/common/kernel-ctl/kernel-ctl.h @@ -21,7 +21,7 @@ #define _LTTNG_KERNEL_CTL_H #include -#include +#include int kernctl_create_session(int fd); int kernctl_open_metadata(int fd, struct lttng_channel_attr *chops); diff --git a/libkernelctl/kernel-ioctl.h b/src/common/kernel-ctl/kernel-ioctl.h similarity index 100% rename from libkernelctl/kernel-ioctl.h rename to src/common/kernel-ctl/kernel-ioctl.h diff --git a/include/lttng-kernel.h b/src/common/lttng-kernel.h similarity index 99% rename from include/lttng-kernel.h rename to src/common/lttng-kernel.h index 455b1c460..e8bc62626 100644 --- a/include/lttng-kernel.h +++ b/src/common/lttng-kernel.h @@ -23,8 +23,6 @@ #include -#include - #define LTTNG_SYM_NAME_LEN 256 /* diff --git a/include/lttng-share.h b/src/common/lttng-share.h similarity index 99% rename from include/lttng-share.h rename to src/common/lttng-share.h index 41d659b6f..e859ead91 100644 --- a/include/lttng-share.h +++ b/src/common/lttng-share.h @@ -21,8 +21,6 @@ #include -#include - /* Default size of a hash table */ #define DEFAULT_HT_SIZE 4 diff --git a/include/lttngerr.h b/src/common/lttngerr.h similarity index 100% rename from include/lttngerr.h rename to src/common/lttngerr.h diff --git a/common/runas.c b/src/common/runas.c similarity index 99% rename from common/runas.c rename to src/common/runas.c index 8ec7dc6b3..cc5034126 100644 --- a/common/runas.c +++ b/src/common/runas.c @@ -30,7 +30,7 @@ #include #include -#include +#include #include "runas.h" diff --git a/common/runas.h b/src/common/runas.h similarity index 100% rename from common/runas.h rename to src/common/runas.h diff --git a/src/common/sessiond-comm/Makefile.am b/src/common/sessiond-comm/Makefile.am new file mode 100644 index 000000000..d8c2fa40e --- /dev/null +++ b/src/common/sessiond-comm/Makefile.am @@ -0,0 +1,5 @@ +# Session daemon communication lib +noinst_LTLIBRARIES = libsessiond-comm.la + +libsessiond_comm_la_SOURCES = sessiond-comm.c sessiond-comm.h + diff --git a/liblttng-sessiond-comm/lttng-sessiond-comm.c b/src/common/sessiond-comm/sessiond-comm.c similarity index 99% rename from liblttng-sessiond-comm/lttng-sessiond-comm.c rename to src/common/sessiond-comm/sessiond-comm.c index 483b346d6..59b76aae1 100644 --- a/liblttng-sessiond-comm/lttng-sessiond-comm.c +++ b/src/common/sessiond-comm/sessiond-comm.c @@ -28,7 +28,7 @@ #include #include -#include +#include "sessiond-comm.h" /* * Human readable error message. diff --git a/include/lttng-sessiond-comm.h b/src/common/sessiond-comm/sessiond-comm.h similarity index 100% rename from include/lttng-sessiond-comm.h rename to src/common/sessiond-comm/sessiond-comm.h diff --git a/src/common/ust-consumer/Makefile.am b/src/common/ust-consumer/Makefile.am new file mode 100644 index 000000000..478aae793 --- /dev/null +++ b/src/common/ust-consumer/Makefile.am @@ -0,0 +1,8 @@ +if HAVE_LIBLTTNG_UST_CTL +noinst_LTLIBRARIES = libust-consumer.la + +libust_consumer_la_SOURCES = ust-consumer.c + +libust_consumer_la_LIBADD = -llttng-ust-ctl + +endif diff --git a/liblttng-ustconsumer/lttng-ustconsumer.c b/src/common/ust-consumer/ust-consumer.c similarity index 98% rename from liblttng-ustconsumer/lttng-ustconsumer.c rename to src/common/ust-consumer/ust-consumer.c index 10213c1c9..16c09af8a 100644 --- a/liblttng-ustconsumer/lttng-ustconsumer.c +++ b/src/common/ust-consumer/ust-consumer.c @@ -28,13 +28,13 @@ #include #include #include - -#include -#include #include -#include -#include "common/runas.h" +#include +#include +#include + +#include "ust-consumer.h" extern struct lttng_consumer_global_data consumer_data; extern int consumer_poll_timeout; diff --git a/include/lttng/lttng-ustconsumer.h b/src/common/ust-consumer/ust-consumer.h similarity index 99% rename from include/lttng/lttng-ustconsumer.h rename to src/common/ust-consumer/ust-consumer.h index 217c592d7..76b4eeece 100644 --- a/include/lttng/lttng-ustconsumer.h +++ b/src/common/ust-consumer/ust-consumer.h @@ -21,9 +21,10 @@ #define _LTTNG_USTCONSUMER_H #include -#include #include +#include + #ifdef HAVE_LIBLTTNG_UST_CTL /* diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am new file mode 100644 index 000000000..482f20c15 --- /dev/null +++ b/src/lib/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = lttng-ctl diff --git a/src/lib/lttng-ctl/Makefile.am b/src/lib/lttng-ctl/Makefile.am new file mode 100644 index 000000000..6bc5432aa --- /dev/null +++ b/src/lib/lttng-ctl/Makefile.am @@ -0,0 +1,6 @@ +lib_LTLIBRARIES = liblttng-ctl.la + +liblttng_ctl_la_SOURCES = lttng-ctl.c + +liblttng_ctl_la_LIBADD = \ + $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la diff --git a/liblttngctl/lttngctl.c b/src/lib/lttng-ctl/lttng-ctl.c similarity index 99% rename from liblttngctl/lttngctl.c rename to src/lib/lttng-ctl/lttng-ctl.c index c65760155..2125c600a 100644 --- a/liblttngctl/lttngctl.c +++ b/src/lib/lttng-ctl/lttng-ctl.c @@ -28,10 +28,10 @@ #include #include -#include -#include +#include +#include +#include #include -#include /* Socket to session daemon for communication */ static int sessiond_socket; diff --git a/tests/Makefile.am b/tests/Makefile.am index 8b13eac14..1dd8bbea7 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,7 +1,6 @@ SUBDIRS = . -AM_CFLAGS=-I$(top_srcdir)/include -I$(top_srcdir)/libkernelctl \ - -I$(top_srcdir)/liblttngctl -g -Wall -lurcu -lurcu-cds +AM_CFLAGS=-g -Wall -lurcu -lurcu-cds EXTRA_DIST = runall.sh utils.sh lttng/runall.sh lttng/run-kernel-tests.sh @@ -9,18 +8,17 @@ noinst_PROGRAMS = test_sessions test_kernel_data_trace \ kernel_all_events_basic kernel_event_basic UTILS=utils.h -SESSIONS=$(top_srcdir)/lttng-sessiond/session.c -KERN_DATA_TRACE=$(top_srcdir)/lttng-sessiond/trace-kernel.c -LIBLTTNG=$(top_srcdir)/liblttngctl/lttngctl.c \ - $(top_srcdir)/liblttng-sessiond-comm/lttng-sessiond-comm.c +SESSIONS=$(top_srcdir)/src/bin/lttng-sessiond/session.c +KERN_DATA_TRACE=$(top_srcdir)/src/bin/lttng-sessiond/trace-kernel.c +LIBLTTNG=$(top_srcdir)/src/lib/lttng-ctl/lttng-ctl.c \ + $(top_srcdir)/src/common/sessiond-comm/sessiond-comm.c test_sessions_SOURCES = test_sessions.c $(UTILS) $(SESSIONS) -test_sessions_LDADD = $(top_builddir)/common/libcommon.la \ - $(top_builddir)/liblttng-ht/liblttng-ht.la +test_sessions_LDADD = $(top_builddir)/src/common/libcommon.la \ + $(top_builddir)/src/common/hashtable/libhashtable.la test_kernel_data_trace_SOURCES = test_kernel_data_trace.c $(UTILS) $(KERN_DATA_TRACE) - kernel_all_events_basic_SOURCES = lttng/kernel_all_events_basic.c $(UTILS) $(LIBLTTNG) kernel_event_basic_SOURCES = lttng/kernel_event_basic.c $(UTILS) $(LIBLTTNG) @@ -30,11 +28,11 @@ SUBDIRS += ust-nevents ust-nprocesses EXTRA_DIST += lttng/run-ust-global-tests.sh noinst_PROGRAMS += ust_global_event_basic ust_global_all_events_basic test_ust_data_trace -UST_DATA_TRACE=$(top_srcdir)/lttng-sessiond/trace-ust.c +UST_DATA_TRACE=$(top_srcdir)/src/bin/lttng-sessiond/trace-ust.c test_ust_data_trace_SOURCES = test_ust_data_trace.c $(UTILS) $(UST_DATA_TRACE) -test_ust_data_trace_LDADD = $(top_builddir)/common/libcommon.la \ - $(top_builddir)/liblttng-ht/liblttng-ht.la +test_ust_data_trace_LDADD = $(top_builddir)/src/common/libcommon.la \ + $(top_builddir)/src/common/hashtable/libhashtable.la ust_global_all_events_basic_SOURCES = lttng/ust_global_all_events_basic.c $(UTILS) $(LIBLTTNG) diff --git a/tests/test_kernel_data_trace.c b/tests/test_kernel_data_trace.c index 05fac0949..c079e2c66 100644 --- a/tests/test_kernel_data_trace.c +++ b/tests/test_kernel_data_trace.c @@ -25,7 +25,9 @@ #include #include -#include "lttng-sessiond/trace-kernel.h" +#include +#include + #include "utils.h" /* This path will NEVER be created in this test */ diff --git a/tests/test_sessions.c b/tests/test_sessions.c index 5b17e6391..f444e3043 100644 --- a/tests/test_sessions.c +++ b/tests/test_sessions.c @@ -26,9 +26,9 @@ #include #include -#include +#include +#include -#include #include "utils.h" #define SESSION1 "test1" diff --git a/tests/test_ust_data_trace.c b/tests/test_ust_data_trace.c index 4e4b29b32..e4d42b40a 100644 --- a/tests/test_ust_data_trace.c +++ b/tests/test_ust_data_trace.c @@ -25,10 +25,11 @@ #include #include -#include "lttng/lttng.h" -#include "lttng-sessiond/lttng-ust-abi.h" -#include "lttng-share.h" -#include "lttng-sessiond/trace-ust.h" +#include +#include +#include +#include + #include "utils.h" /* This path will NEVER be created in this test */ @@ -176,7 +177,7 @@ static void create_ust_context(void) PRINT_OK(); printf("Validating UST context: "); - assert(ctx.ctx == uctx->ctx.ctx); + assert((int) ctx.ctx == (int)uctx->ctx.ctx); PRINT_OK(); } diff --git a/tests/ust-nprocesses/run b/tests/ust-nprocesses/run index 4c82eba12..e1f584a2e 100755 --- a/tests/ust-nprocesses/run +++ b/tests/ust-nprocesses/run @@ -45,7 +45,7 @@ done echo -n "Validating registered apps: " -listing=$($TESTDIR/../lttng/$LTTNG_BIN list -u) +listing=$($TESTDIR/../src/bin/lttng/$LTTNG_BIN list -u) reg_app_count=$(echo -n $listing | sed "s/$TEST_BIN_NAME/$TEST_BIN_NAME\n/g" | grep "$TEST_BIN_NAME" | wc -l) if [ "$reg_app_count" -ne "$NR_ITER" ]; then echo -e "$reg_app_count apps listed. Expected $NR_ITER \e[1;31mFAILED\e[0m" diff --git a/tests/utils.sh b/tests/utils.sh index 352a19837..1d8f2ebd0 100644 --- a/tests/utils.sh +++ b/tests/utils.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/src/bin/bash # # Copyright (C) - 2012 David Goulet # @@ -23,7 +23,7 @@ function start_sessiond () { if [ -z $(pidof $SESSIOND_BIN) ]; then echo -n "Starting session daemon... " - $TESTDIR/../lttng-sessiond/$SESSIOND_BIN --daemonize --quiet + $TESTDIR/../src/bin/lttng-sessiond/$SESSIOND_BIN --daemonize --quiet if [ $? -eq 1 ]; then echo -e "\e[1;31mFAILED\e[0m" return 1 @@ -53,7 +53,7 @@ function create_lttng_session () trace_path=$2 echo -n "Creating lttng session $SESSION_NAME in $TRACE_PATH " - $TESTDIR/../lttng/$LTTNG_BIN create $sess_name -o $trace_path >/dev/null 2>&1 + $TESTDIR/../src/bin/lttng/$LTTNG_BIN create $sess_name -o $trace_path >/dev/null 2>&1 if [ $? -eq 1 ]; then echo -e "\e[1;31mFAILED\e[0m" return 1 @@ -69,7 +69,7 @@ function enable_ust_lttng_event () event_name=$2 echo -n "Enabling lttng event $event_name for session $sess_name " - $TESTDIR/../lttng/$LTTNG_BIN enable-event $event_name -s $sess_name -u >/dev/null 2>&1 + $TESTDIR/../src/bin/lttng/$LTTNG_BIN enable-event $event_name -s $sess_name -u >/dev/null 2>&1 if [ $? -eq 1 ]; then echo -e '\e[1;31mFAILED\e[0m' return 1 @@ -83,7 +83,7 @@ function start_tracing () sess_name=$1 echo -n "Start lttng tracing for session $sess_name " - $TESTDIR/../lttng/$LTTNG_BIN start $sess_name >/dev/null 2>&1 + $TESTDIR/../src/bin/lttng/$LTTNG_BIN start $sess_name >/dev/null 2>&1 if [ $? -eq 1 ]; then echo -e '\e[1;31mFAILED\e[0m' return 1 @@ -97,7 +97,7 @@ function stop_tracing () sess_name=$1 echo -n "Stop lttng tracing for session $sess_name " - $TESTDIR/../lttng/$LTTNG_BIN stop $sess_name >/dev/null 2>&1 + $TESTDIR/../src/bin/lttng/$LTTNG_BIN stop $sess_name >/dev/null 2>&1 if [ $? -eq 1 ]; then echo -e '\e[1;31mFAILED\e[0m' return 1 @@ -111,7 +111,7 @@ function destroy_lttng_session () sess_name=$1 echo -n "Destroy lttng session $sess_name " - $TESTDIR/../lttng/$LTTNG_BIN destroy $sess_name >/dev/null 2>&1 + $TESTDIR/../src/bin/lttng/$LTTNG_BIN destroy $sess_name >/dev/null 2>&1 if [ $? -eq 1 ]; then echo -e '\e[1;31mFAILED\e[0m' return 1 -- 2.34.1