From daf282ab93462198c6acd16b4aa624635df1bea5 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Sat, 7 Jan 2012 16:14:38 -0500 Subject: [PATCH] Move hash table to common/ directory Signed-off-by: Mathieu Desnoyers --- Makefile.am | 3 ++- {lttng-sessiond => common}/hashtable.c | 4 ++-- {lttng-sessiond => common}/hashtable.h | 2 +- {hashtable => common/hashtable}/hash.c | 0 {hashtable => common/hashtable}/hash.h | 0 {hashtable => common/hashtable}/rculfhash.c | 0 {hashtable => common/hashtable}/rculfhash.h | 0 configure.ac | 1 + lttng-sessiond/Makefile.am | 9 +++------ lttng-sessiond/channel.c | 2 +- lttng-sessiond/context.c | 2 +- lttng-sessiond/event.c | 2 +- lttng-sessiond/main.c | 2 +- lttng-sessiond/session.c | 4 +--- lttng-sessiond/trace-ust.c | 2 +- lttng-sessiond/trace-ust.h | 2 +- lttng-sessiond/ust-app.c | 2 +- lttng-sessiond/ust-consumer.c | 2 +- tests/Makefile.am | 5 ++--- 19 files changed, 20 insertions(+), 24 deletions(-) rename {lttng-sessiond => common}/hashtable.c (97%) rename {lttng-sessiond => common}/hashtable.h (97%) rename {hashtable => common/hashtable}/hash.c (100%) rename {hashtable => common/hashtable}/hash.h (100%) rename {hashtable => common/hashtable}/rculfhash.c (100%) rename {hashtable => common/hashtable}/rculfhash.h (100%) diff --git a/Makefile.am b/Makefile.am index 4d203b55c..39b9f2f94 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,7 @@ ACLOCAL_AMFLAGS = -I config -SUBDIRS = liblttng-sessiond-comm \ +SUBDIRS = common \ + liblttng-sessiond-comm \ libkernelctl \ librunas \ liblttng-kconsumer \ diff --git a/lttng-sessiond/hashtable.c b/common/hashtable.c similarity index 97% rename from lttng-sessiond/hashtable.c rename to common/hashtable.c index 956cfd426..2289f7adb 100644 --- a/lttng-sessiond/hashtable.c +++ b/common/hashtable.c @@ -20,8 +20,8 @@ #include #include "hashtable.h" -#include "../hashtable/rculfhash.h" -#include "../hashtable/hash.h" +#include "hashtable/rculfhash.h" +#include "hashtable/hash.h" struct cds_lfht *hashtable_new(unsigned long size) { diff --git a/lttng-sessiond/hashtable.h b/common/hashtable.h similarity index 97% rename from lttng-sessiond/hashtable.h rename to common/hashtable.h index 7212fb0e2..b7f7314f2 100644 --- a/lttng-sessiond/hashtable.h +++ b/common/hashtable.h @@ -19,7 +19,7 @@ #define _LTT_HASHTABLE_H #include -#include "../hashtable/rculfhash.h" +#include "hashtable/rculfhash.h" struct cds_lfht *hashtable_new(unsigned long size); struct cds_lfht *hashtable_new_str(unsigned long size); diff --git a/hashtable/hash.c b/common/hashtable/hash.c similarity index 100% rename from hashtable/hash.c rename to common/hashtable/hash.c diff --git a/hashtable/hash.h b/common/hashtable/hash.h similarity index 100% rename from hashtable/hash.h rename to common/hashtable/hash.h diff --git a/hashtable/rculfhash.c b/common/hashtable/rculfhash.c similarity index 100% rename from hashtable/rculfhash.c rename to common/hashtable/rculfhash.c diff --git a/hashtable/rculfhash.h b/common/hashtable/rculfhash.h similarity index 100% rename from hashtable/rculfhash.h rename to common/hashtable/rculfhash.h diff --git a/configure.ac b/configure.ac index 6f6bad167..9b8d9d34f 100644 --- a/configure.ac +++ b/configure.ac @@ -132,6 +132,7 @@ AC_SUBST(DEFAULT_INCLUDES) AC_CONFIG_FILES([ Makefile include/Makefile + common/Makefile libkernelctl/Makefile liblttng-consumer/Makefile liblttng-kconsumer/Makefile diff --git a/lttng-sessiond/Makefile.am b/lttng-sessiond/Makefile.am index d3900d22d..00a87f4c3 100644 --- a/lttng-sessiond/Makefile.am +++ b/lttng-sessiond/Makefile.am @@ -13,7 +13,6 @@ COMPAT=compat/compat-poll.c endif lttng_sessiond_SOURCES = utils.c utils.h \ - hashtable.c hashtable.h \ compat/poll.h $(COMPAT) \ trace-kernel.c trace-kernel.h \ kernel.c kernel.h \ @@ -24,10 +23,7 @@ lttng_sessiond_SOURCES = utils.c utils.h \ futex.c futex.h \ shm.c shm.h \ session.c session.h \ - lttng-ust-ctl.h lttng-ust-abi.h \ - ../hashtable/rculfhash.c \ - ../hashtable/rculfhash.h \ - ../hashtable/hash.c ../hashtable/hash.h + lttng-ust-ctl.h lttng-ust-abi.h if HAVE_LIBLTTNG_UST_CTL lttng_sessiond_SOURCES += trace-ust.c ust-app.c ust-consumer.c ust-consumer.h @@ -41,7 +37,8 @@ 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)/librunas/librunas.la + $(top_builddir)/librunas/librunas.la \ + $(top_builddir)/common/libcommon.la if HAVE_LIBLTTNG_UST_CTL lttng_sessiond_LDADD += -llttng-ust-ctl diff --git a/lttng-sessiond/channel.c b/lttng-sessiond/channel.c index 06b799db1..bf6a6e5aa 100644 --- a/lttng-sessiond/channel.c +++ b/lttng-sessiond/channel.c @@ -24,7 +24,7 @@ #include #include "channel.h" -#include "hashtable.h" +#include "../common/hashtable.h" #include "kernel.h" #include "ust-ctl.h" #include "utils.h" diff --git a/lttng-sessiond/context.c b/lttng-sessiond/context.c index d4203bed8..51beb3fba 100644 --- a/lttng-sessiond/context.c +++ b/lttng-sessiond/context.c @@ -26,7 +26,7 @@ #include #include "context.h" -#include "hashtable.h" +#include "../common/hashtable.h" #include "kernel.h" #include "ust-app.h" #include "trace-ust.h" diff --git a/lttng-sessiond/event.c b/lttng-sessiond/event.c index 90b10ec3a..f4c48179d 100644 --- a/lttng-sessiond/event.c +++ b/lttng-sessiond/event.c @@ -26,7 +26,7 @@ #include "channel.h" #include "event.h" -#include "hashtable.h" +#include "../common/hashtable.h" #include "kernel.h" #include "ust-ctl.h" #include "ust-app.h" diff --git a/lttng-sessiond/main.c b/lttng-sessiond/main.c index 402e228ba..ff8ec1fcd 100644 --- a/lttng-sessiond/main.c +++ b/lttng-sessiond/main.c @@ -50,7 +50,7 @@ #include "context.h" #include "event.h" #include "futex.h" -#include "hashtable.h" +#include "../common/hashtable.h" #include "kernel.h" #include "lttng-sessiond.h" #include "shm.h" diff --git a/lttng-sessiond/session.c b/lttng-sessiond/session.c index 246b60903..5539aec30 100644 --- a/lttng-sessiond/session.c +++ b/lttng-sessiond/session.c @@ -29,11 +29,9 @@ #include #include -#include "hashtable.h" +#include "../common/hashtable.h" #include "session.h" -#include "../hashtable/hash.h" - /* * NOTES: * diff --git a/lttng-sessiond/trace-ust.c b/lttng-sessiond/trace-ust.c index 96f7374f7..00d61432e 100644 --- a/lttng-sessiond/trace-ust.c +++ b/lttng-sessiond/trace-ust.c @@ -24,7 +24,7 @@ #include #include -#include "hashtable.h" +#include "../common/hashtable.h" #include "trace-ust.h" /* diff --git a/lttng-sessiond/trace-ust.h b/lttng-sessiond/trace-ust.h index 5a6cade9a..bb092cae5 100644 --- a/lttng-sessiond/trace-ust.h +++ b/lttng-sessiond/trace-ust.h @@ -27,7 +27,7 @@ #include "ust-ctl.h" -#include "../hashtable/rculfhash.h" +#include "../common/hashtable.h" /* UST Stream list */ struct ltt_ust_stream_list { diff --git a/lttng-sessiond/ust-app.c b/lttng-sessiond/ust-app.c index 384d85e23..12e957245 100644 --- a/lttng-sessiond/ust-app.c +++ b/lttng-sessiond/ust-app.c @@ -32,7 +32,7 @@ #include #include -#include "hashtable.h" +#include "../common/hashtable.h" #include "ust-app.h" #include "ust-consumer.h" #include "ust-ctl.h" diff --git a/lttng-sessiond/ust-consumer.c b/lttng-sessiond/ust-consumer.c index b87d61120..d6b80ff64 100644 --- a/lttng-sessiond/ust-consumer.c +++ b/lttng-sessiond/ust-consumer.c @@ -27,7 +27,7 @@ #include #include -#include "hashtable.h" +#include "../common/hashtable.h" #include "ust-consumer.h" /* diff --git a/tests/Makefile.am b/tests/Makefile.am index 382a77225..21bcace75 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -7,14 +7,13 @@ 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 $(top_srcdir)/lttng-sessiond/hashtable.c \ - $(top_srcdir)/hashtable/rculfhash.c $(top_srcdir)/hashtable/hash.c +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 test_sessions_SOURCES = test_sessions.c $(UTILS) $(SESSIONS) -test_sessions_LDADD = $(top_builddir)/librunas/librunas.la +test_sessions_LDADD = $(top_builddir)/common/libcommon.la $(top_builddir)/librunas/librunas.la test_kernel_data_trace_SOURCES = test_kernel_data_trace.c $(UTILS) $(KERN_DATA_TRACE) -- 2.34.1