From 58f8447848dfbfa79367607af7845547d47a08d4 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Tue, 6 Apr 2021 18:32:51 -0400 Subject: [PATCH] Move futex wrapper to 'common/compat/' Change-Id: I9f1a31162f789bde101e08c5effa65449d631946 Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- src/common/Makefile.am | 7 +++++++ .../lttng-ust/compat_futex.c => common/compat/futex.c} | 3 ++- src/{lib/lttng-ust => common/compat}/futex.h | 6 +++--- src/lib/lttng-ust/Makefile.am | 4 +--- src/lib/lttng-ust/lttng-ust-comm.c | 2 +- 5 files changed, 14 insertions(+), 8 deletions(-) rename src/{lib/lttng-ust/compat_futex.c => common/compat/futex.c} (98%) rename src/{lib/lttng-ust => common/compat}/futex.h (97%) diff --git a/src/common/Makefile.am b/src/common/Makefile.am index e450f8c8..b847001e 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -45,6 +45,7 @@ noinst_HEADERS += \ noinst_LTLIBRARIES = \ libcounter.la \ + libcompat.la \ libmsgpack.la \ libringbuffer.la \ libsnprintf.la \ @@ -74,6 +75,11 @@ endif libcounter_la_CFLAGS = -DUST_COMPONENT="libcounter" $(AM_CFLAGS) +# compat +libcompat_la_SOURCES = \ + compat/futex.c \ + compat/futex.h + # msgpack libmsgpack_la_SOURCES = \ msgpack/msgpack.c \ @@ -137,6 +143,7 @@ libcommon_la_SOURCES = \ patient.c libcommon_la_LIBADD = \ + libcompat.la \ libmsgpack.la \ libsnprintf.la diff --git a/src/lib/lttng-ust/compat_futex.c b/src/common/compat/futex.c similarity index 98% rename from src/lib/lttng-ust/compat_futex.c rename to src/common/compat/futex.c index adf1f440..c87d7134 100644 --- a/src/lib/lttng-ust/compat_futex.c +++ b/src/common/compat/futex.c @@ -16,7 +16,8 @@ #include #include -#include "futex.h" + +#include "common/compat/futex.h" /* * Using attribute "weak" for __lttng_ust_compat_futex_lock and diff --git a/src/lib/lttng-ust/futex.h b/src/common/compat/futex.h similarity index 97% rename from src/lib/lttng-ust/futex.h rename to src/common/compat/futex.h index 18c46a13..446c7f1c 100644 --- a/src/lib/lttng-ust/futex.h +++ b/src/common/compat/futex.h @@ -6,8 +6,8 @@ * Userspace RCU - sys_futex/compat_futex header. */ -#ifndef _LTTNG_UST_FUTEX_H -#define _LTTNG_UST_FUTEX_H +#ifndef _UST_COMMON_COMPAT_FUTEX_H +#define _UST_COMMON_COMPAT_FUTEX_H #include #include @@ -175,4 +175,4 @@ static inline int lttng_ust_futex_async(int32_t *uaddr, int op, int32_t val, } #endif -#endif /* _LTTNG_UST_FUTEX_H */ +#endif /* _UST_COMMON_COMPAT_FUTEX_H */ diff --git a/src/lib/lttng-ust/Makefile.am b/src/lib/lttng-ust/Makefile.am index 77c91067..5612cb64 100644 --- a/src/lib/lttng-ust/Makefile.am +++ b/src/lib/lttng-ust/Makefile.am @@ -97,9 +97,7 @@ liblttng_ust_runtime_la_SOURCES = \ rculfhash-internal.h \ rculfhash-mm-chunk.c \ rculfhash-mm-mmap.c \ - rculfhash-mm-order.c \ - compat_futex.c \ - futex.h + rculfhash-mm-order.c if HAVE_PERF_EVENT liblttng_ust_runtime_la_SOURCES += \ diff --git a/src/lib/lttng-ust/lttng-ust-comm.c b/src/lib/lttng-ust/lttng-ust-comm.c index 6f5be120..083de26d 100644 --- a/src/lib/lttng-ust/lttng-ust-comm.c +++ b/src/lib/lttng-ust/lttng-ust-comm.c @@ -25,7 +25,6 @@ #include #include #include -#include "futex.h" #include #include @@ -39,6 +38,7 @@ #include #include #include +#include "common/compat/futex.h" #include "common/ustcomm.h" #include "common/ust-fd.h" #include "common/logging.h" -- 2.34.1