From: Michael Jeanson Date: Fri, 2 Apr 2021 22:45:31 +0000 (-0400) Subject: Move the mmap wrapper to 'common/compat/' X-Git-Tag: v2.13.0-rc1~129 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=1be435396a9c3673fbda15bba2a1cf066a893408;p=lttng-ust.git Move the mmap wrapper to 'common/compat/' This is part of an effort to standardize our autotools setup across projects to simplify maintenance. Change-Id: I6fd5517793459c89fe22249ae08e844874a3a7fe Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- diff --git a/src/common/Makefile.am b/src/common/Makefile.am index fdbbc05c..1c6fcbf0 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -19,6 +19,7 @@ noinst_HEADERS = \ noinst_HEADERS += \ compat/dlfcn.h \ + compat/mmap.h \ compat/tid.h # These headers should be moved to the public headers when tested and @@ -85,7 +86,6 @@ libringbuffer_la_SOURCES = \ ringbuffer/frontend_internal.h \ ringbuffer/frontend_types.h \ ringbuffer/getcpu.h \ - ringbuffer/mmap.h \ ringbuffer/nohz.h \ ringbuffer/rb-init.h \ ringbuffer/ring_buffer_backend.c \ diff --git a/src/common/compat/mmap.h b/src/common/compat/mmap.h new file mode 100644 index 00000000..331f6c97 --- /dev/null +++ b/src/common/compat/mmap.h @@ -0,0 +1,18 @@ +/* + * SPDX-License-Identifier: LGPL-2.1-only + * + * Copyright (C) 2019 Jonathan Rajotte + */ + +#ifndef _UST_COMMON_COMPAT_MMAP_H +#define _UST_COMMON_COMPAT_MMAP_H + +#include + +#if defined(__linux__) && defined(MAP_POPULATE) +# define LTTNG_MAP_POPULATE MAP_POPULATE +#else +# define LTTNG_MAP_POPULATE 0 +#endif /* __linux__ && MAP_POPULATE */ + +#endif /* _UST_COMMON_COMPAT_MMAP_H */ diff --git a/src/common/counter/shm.c b/src/common/counter/shm.c index 596d5e59..e421d045 100644 --- a/src/common/counter/shm.c +++ b/src/common/counter/shm.c @@ -29,7 +29,7 @@ #include "common/macros.h" #include "common/ust-fd.h" -#include "common/ringbuffer/mmap.h" +#include "common/compat/mmap.h" /* * Ensure we have the required amount of space available by writing 0 diff --git a/src/common/ringbuffer/mmap.h b/src/common/ringbuffer/mmap.h deleted file mode 100644 index 39c06246..00000000 --- a/src/common/ringbuffer/mmap.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * SPDX-License-Identifier: LGPL-2.1-only - * - * Copyright (C) 2019 Jonathan Rajotte - */ - -#ifndef _LTTNG_MMAP_H -#define _LTTNG_MMAP_H - -#include - -#if defined(__linux__) && defined(MAP_POPULATE) -# define LTTNG_MAP_POPULATE MAP_POPULATE -#else -# define LTTNG_MAP_POPULATE 0 -#endif /* __linux__ && MAP_POPULATE */ - -#endif /* _LTTNG_MMAP_H */ diff --git a/src/common/ringbuffer/shm.c b/src/common/ringbuffer/shm.c index a5de019c..8be7e359 100644 --- a/src/common/ringbuffer/shm.c +++ b/src/common/ringbuffer/shm.c @@ -29,7 +29,7 @@ #include "common/macros.h" #include "common/ust-fd.h" -#include "mmap.h" +#include "common/compat/mmap.h" /* * Ensure we have the required amount of space available by writing 0