From cdff92e0e0e875348b6ec549ef9d2282161faf80 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Fri, 2 Apr 2021 15:38:41 -0400 Subject: [PATCH] Move libcounter to 'src/common/' This is part of an effort to standardize our autotools setup across projects to simplify maintenance. Change-Id: I0c42a8b6bcd99a75d24114c1a4f610982ba16057 Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- .gitignore | 1 - configure.ac | 1 - src/Makefile.am | 1 - src/common/Makefile.am | 24 +++++++++++++++++++ .../counter}/counter-api.h | 2 +- .../counter}/counter-config.h | 0 .../counter}/counter-internal.h | 0 .../counter}/counter-types.h | 0 src/{libcounter => common/counter}/counter.c | 0 src/{libcounter => common/counter}/counter.h | 0 src/{libcounter => common/counter}/shm.c | 2 +- src/{libcounter => common/counter}/shm.h | 0 .../counter}/shm_internal.h | 0 .../counter}/shm_types.h | 0 src/{libcounter => common/counter}/smp.c | 0 src/{libcounter => common/counter}/smp.h | 0 src/lib/lttng-ust-ctl/ustctl.c | 5 ++-- src/libcounter/Makefile.am | 20 ---------------- src/liblttng-ust/Makefile.am | 3 ++- .../lttng-counter-client-percpu-32-modular.c | 4 ++-- .../lttng-counter-client-percpu-64-modular.c | 4 ++-- src/liblttng-ust/lttng-events.c | 2 +- src/liblttng-ust/lttng-ust-abi.c | 2 +- 23 files changed, 36 insertions(+), 35 deletions(-) rename src/{libcounter => common/counter}/counter-api.h (99%) rename src/{libcounter => common/counter}/counter-config.h (100%) rename src/{libcounter => common/counter}/counter-internal.h (100%) rename src/{libcounter => common/counter}/counter-types.h (100%) rename src/{libcounter => common/counter}/counter.c (100%) rename src/{libcounter => common/counter}/counter.h (100%) rename src/{libcounter => common/counter}/shm.c (99%) rename src/{libcounter => common/counter}/shm.h (100%) rename src/{libcounter => common/counter}/shm_internal.h (100%) rename src/{libcounter => common/counter}/shm_types.h (100%) rename src/{libcounter => common/counter}/smp.c (100%) rename src/{libcounter => common/counter}/smp.h (100%) delete mode 100644 src/libcounter/Makefile.am diff --git a/.gitignore b/.gitignore index 321714bb..9f38fa9c 100644 --- a/.gitignore +++ b/.gitignore @@ -125,7 +125,6 @@ cscope.* /doc/man/Makefile /include/Makefile /src/common/Makefile -/src/libcounter/Makefile /src/liblttng-ust-comm/Makefile /src/lib/lttng-ust-ctl/Makefile /src/lib/lttng-ust-cyg-profile/Makefile diff --git a/configure.ac b/configure.ac index 7ffc9cc2..285d269d 100644 --- a/configure.ac +++ b/configure.ac @@ -519,7 +519,6 @@ AC_CONFIG_FILES([ doc/man/Makefile include/Makefile src/common/Makefile - src/libcounter/Makefile src/liblttng-ust-comm/Makefile src/lib/lttng-ust-ctl/Makefile src/lib/lttng-ust-cyg-profile/Makefile diff --git a/src/Makefile.am b/src/Makefile.am index 1ed0c56f..4fca446e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -4,7 +4,6 @@ SUBDIRS = \ common \ libringbuffer \ liblttng-ust-comm \ - libcounter \ liblttng-ust \ lib diff --git a/src/common/Makefile.am b/src/common/Makefile.am index 419561eb..a198b685 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -38,10 +38,34 @@ noinst_HEADERS += \ ### ### noinst_LTLIBRARIES = \ + libcounter.la \ msgpack/libmsgpack.la \ snprintf/libsnprintf.la \ libcommon.la +# counter +libcounter_la_SOURCES = \ + counter/counter-api.h \ + counter/counter.c \ + counter/counter-config.h \ + counter/counter.h \ + counter/counter-internal.h \ + counter/counter-types.h \ + counter/shm.c \ + counter/shm.h \ + counter/shm_internal.h \ + counter/shm_types.h \ + counter/smp.c \ + counter/smp.h + +libcounter_la_LIBADD = -lrt + +if ENABLE_NUMA +libcounter_la_LIBADD += -lnuma +endif + +libcounter_la_CFLAGS = -DUST_COMPONENT="libcounter" $(AM_CFLAGS) + # msgpack msgpack_libmsgpack_la_SOURCES = \ msgpack/msgpack.c \ diff --git a/src/libcounter/counter-api.h b/src/common/counter/counter-api.h similarity index 99% rename from src/libcounter/counter-api.h rename to src/common/counter/counter-api.h index f140325d..08511d3a 100644 --- a/src/libcounter/counter-api.h +++ b/src/common/counter/counter-api.h @@ -16,7 +16,7 @@ #include #include #include "common/bitmap.h" -#include "../libringbuffer/getcpu.h" +#include "libringbuffer/getcpu.h" /* * Using unsigned arithmetic because overflow is defined. diff --git a/src/libcounter/counter-config.h b/src/common/counter/counter-config.h similarity index 100% rename from src/libcounter/counter-config.h rename to src/common/counter/counter-config.h diff --git a/src/libcounter/counter-internal.h b/src/common/counter/counter-internal.h similarity index 100% rename from src/libcounter/counter-internal.h rename to src/common/counter/counter-internal.h diff --git a/src/libcounter/counter-types.h b/src/common/counter/counter-types.h similarity index 100% rename from src/libcounter/counter-types.h rename to src/common/counter/counter-types.h diff --git a/src/libcounter/counter.c b/src/common/counter/counter.c similarity index 100% rename from src/libcounter/counter.c rename to src/common/counter/counter.c diff --git a/src/libcounter/counter.h b/src/common/counter/counter.h similarity index 100% rename from src/libcounter/counter.h rename to src/common/counter/counter.h diff --git a/src/libcounter/shm.c b/src/common/counter/shm.c similarity index 99% rename from src/libcounter/shm.c rename to src/common/counter/shm.c index c1d6718a..d1116c9c 100644 --- a/src/libcounter/shm.c +++ b/src/common/counter/shm.c @@ -29,7 +29,7 @@ #include "common/macros.h" #include "common/ust-fd.h" -#include "../libringbuffer/mmap.h" +#include "libringbuffer/mmap.h" /* * Ensure we have the required amount of space available by writing 0 diff --git a/src/libcounter/shm.h b/src/common/counter/shm.h similarity index 100% rename from src/libcounter/shm.h rename to src/common/counter/shm.h diff --git a/src/libcounter/shm_internal.h b/src/common/counter/shm_internal.h similarity index 100% rename from src/libcounter/shm_internal.h rename to src/common/counter/shm_internal.h diff --git a/src/libcounter/shm_types.h b/src/common/counter/shm_types.h similarity index 100% rename from src/libcounter/shm_types.h rename to src/common/counter/shm_types.h diff --git a/src/libcounter/smp.c b/src/common/counter/smp.c similarity index 100% rename from src/libcounter/smp.c rename to src/common/counter/smp.c diff --git a/src/libcounter/smp.h b/src/common/counter/smp.h similarity index 100% rename from src/libcounter/smp.h rename to src/common/counter/smp.h diff --git a/src/lib/lttng-ust-ctl/ustctl.c b/src/lib/lttng-ust-ctl/ustctl.c index d585c71d..c89085a1 100644 --- a/src/lib/lttng-ust-ctl/ustctl.c +++ b/src/lib/lttng-ust-ctl/ustctl.c @@ -32,9 +32,8 @@ #include "liblttng-ust/lttng-tracer-core.h" #include "liblttng-ust/lttng-counter-client.h" -#include "libcounter/shm.h" -#include "libcounter/smp.h" -#include "libcounter/counter.h" +#include "common/counter/smp.h" +#include "common/counter/counter.h" /* * Number of milliseconds to retry before failing metadata writes on diff --git a/src/libcounter/Makefile.am b/src/libcounter/Makefile.am deleted file mode 100644 index 534238f4..00000000 --- a/src/libcounter/Makefile.am +++ /dev/null @@ -1,20 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-only - -AM_CFLAGS += -fno-strict-aliasing - -noinst_LTLIBRARIES = libcounter.la - -libcounter_la_SOURCES = \ - counter.c smp.c smp.h shm.c shm.h shm_internal.h shm_types.h \ - counter-api.h counter.h counter-internal.h counter-types.h \ - counter-config.h - -libcounter_la_LIBADD = \ - -lpthread \ - -lrt - -if ENABLE_NUMA -libcounter_la_LIBADD += -lnuma -endif - -libcounter_la_CFLAGS = -DUST_COMPONENT="libcounter" $(AM_CFLAGS) diff --git a/src/liblttng-ust/Makefile.am b/src/liblttng-ust/Makefile.am index eb77c950..89fba09a 100644 --- a/src/liblttng-ust/Makefile.am +++ b/src/liblttng-ust/Makefile.am @@ -6,6 +6,7 @@ noinst_LTLIBRARIES = liblttng-ust-runtime.la liblttng-ust-support.la lib_LTLIBRARIES = liblttng-ust-common.la liblttng-ust-tracepoint.la liblttng-ust.la +# ust-common liblttng_ust_common_la_SOURCES = \ lttng-ust-urcu.c \ lttng-ust-urcu-pointer.c @@ -130,7 +131,7 @@ liblttng_ust_la_LDFLAGS = -no-undefined -version-info $(LTTNG_UST_LIBRARY_VERSIO liblttng_ust_support_la_LIBADD = \ $(top_builddir)/src/libringbuffer/libringbuffer.la \ - $(top_builddir)/src/libcounter/libcounter.la + $(top_builddir)/src/common/libcounter.la liblttng_ust_la_LIBADD = \ -lrt \ diff --git a/src/liblttng-ust/lttng-counter-client-percpu-32-modular.c b/src/liblttng-ust/lttng-counter-client-percpu-32-modular.c index f6e5bdfd..df087c4d 100644 --- a/src/liblttng-ust/lttng-counter-client-percpu-32-modular.c +++ b/src/liblttng-ust/lttng-counter-client-percpu-32-modular.c @@ -9,8 +9,8 @@ */ #include "ust-events-internal.h" -#include "../libcounter/counter.h" -#include "../libcounter/counter-api.h" +#include "common/counter/counter.h" +#include "common/counter/counter-api.h" #include "lttng-tracer-core.h" #include "lttng-counter-client.h" diff --git a/src/liblttng-ust/lttng-counter-client-percpu-64-modular.c b/src/liblttng-ust/lttng-counter-client-percpu-64-modular.c index 0a49cfd3..021146e6 100644 --- a/src/liblttng-ust/lttng-counter-client-percpu-64-modular.c +++ b/src/liblttng-ust/lttng-counter-client-percpu-64-modular.c @@ -9,8 +9,8 @@ */ #include "ust-events-internal.h" -#include "../libcounter/counter.h" -#include "../libcounter/counter-api.h" +#include "common/counter/counter.h" +#include "common/counter/counter-api.h" #include "lttng-tracer-core.h" #include "lttng-counter-client.h" diff --git a/src/liblttng-ust/lttng-events.c b/src/liblttng-ust/lttng-events.c index 767a1872..7a4ade01 100644 --- a/src/liblttng-ust/lttng-events.c +++ b/src/liblttng-ust/lttng-events.c @@ -55,7 +55,7 @@ #include "../libringbuffer/shm.h" #include "../libringbuffer/frontend_types.h" #include "../libringbuffer/frontend.h" -#include "../libcounter/counter.h" +#include "common/counter/counter.h" #include "jhash.h" #include #include "context-provider-internal.h" diff --git a/src/liblttng-ust/lttng-ust-abi.c b/src/liblttng-ust/lttng-ust-abi.c index e443e4bc..31b6fe22 100644 --- a/src/liblttng-ust/lttng-ust-abi.c +++ b/src/liblttng-ust/lttng-ust-abi.c @@ -42,7 +42,7 @@ #include "../libringbuffer/frontend_types.h" #include "../libringbuffer/frontend.h" #include "../libringbuffer/shm.h" -#include "../libcounter/counter.h" +#include "common/counter/counter.h" #include "tracepoint-internal.h" #include "lttng-tracer.h" #include "string-utils.h" -- 2.34.1