From: Michael Jeanson Date: Wed, 17 Mar 2021 19:27:10 +0000 (-0400) Subject: Namespace lttng/align.h as lttng/ust-align.h X-Git-Tag: v2.13.0-rc1~250 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=3d3a2bb817fcab854dc3a90dd80e073869bbccb4;p=lttng-ust.git Namespace lttng/align.h as lttng/ust-align.h Since the 'lttng/' header directory is shared between ust and tools, namespace this common name header with 'ust-' to match the same pattern as the other files. Change-Id: Iad25ad76b75e87e040b4d7dd9f461ce6522ac361 Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- diff --git a/include/Makefile.am b/include/Makefile.am index a113bf13..80b32785 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -22,7 +22,7 @@ nobase_include_HEADERS = \ lttng/ust.h \ lttng/ust-endian.h \ lttng/ringbuffer-context.h \ - lttng/align.h \ + lttng/ust-align.h \ lttng/ust-bug.h \ lttng/ust-error.h \ lttng/tracef.h \ diff --git a/include/lttng/align.h b/include/lttng/align.h deleted file mode 100644 index fbe87f19..00000000 --- a/include/lttng/align.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * SPDX-License-Identifier: MIT - * - * Copyright (C) 2010-2011 Mathieu Desnoyers - */ - -#ifndef _LTTNG_ALIGN_H -#define _LTTNG_ALIGN_H - -#include - -/** - * lttng_ust_offset_align - Calculate the offset needed to align an object on - * its natural alignment towards higher addresses. - * @align_drift: object offset from an "alignment"-aligned address. - * @alignment: natural object alignment. Must be non-zero, power of 2. - * - * Returns the offset that must be added to align towards higher - * addresses. - */ -#define lttng_ust_offset_align(align_drift, alignment) \ - ({ \ - LTTNG_BUILD_RUNTIME_BUG_ON((alignment) == 0 \ - || ((alignment) & ((alignment) - 1))); \ - (((alignment) - (align_drift)) & ((alignment) - 1)); \ - }) - -/** - * lttng_ust_offset_align_floor - Calculate the offset needed to align an - * object on its natural alignment towards lower addresses. - * @align_drift: object offset from an "alignment"-aligned address. - * @alignment: natural object alignment. Must be non-zero, power of 2. - * - * Returns the offset that must be substracted to align towards lower addresses. - */ -#define lttng_ust_offset_align_floor(align_drift, alignment) \ - ({ \ - LTTNG_BUILD_RUNTIME_BUG_ON((alignment) == 0 \ - || ((alignment) & ((alignment) - 1))); \ - (((align_drift) - (alignment)) & ((alignment) - 1)); \ - }) - -#endif /* _LTTNG_ALIGN_H */ diff --git a/include/lttng/ringbuffer-context.h b/include/lttng/ringbuffer-context.h index 614150da..e42c3f52 100644 --- a/include/lttng/ringbuffer-context.h +++ b/include/lttng/ringbuffer-context.h @@ -10,12 +10,13 @@ #define _LTTNG_RING_BUFFER_CONTEXT_H #include -#include #include #include #include #include -#include + +#include +#include #include struct lttng_ust_lib_ring_buffer; diff --git a/include/lttng/ust-align.h b/include/lttng/ust-align.h new file mode 100644 index 00000000..00da854e --- /dev/null +++ b/include/lttng/ust-align.h @@ -0,0 +1,43 @@ +/* + * SPDX-License-Identifier: MIT + * + * Copyright (C) 2010-2011 Mathieu Desnoyers + */ + +#ifndef _LTTNG_UST_ALIGN_H +#define _LTTNG_UST_ALIGN_H + +#include + +/** + * lttng_ust_offset_align - Calculate the offset needed to align an object on + * its natural alignment towards higher addresses. + * @align_drift: object offset from an "alignment"-aligned address. + * @alignment: natural object alignment. Must be non-zero, power of 2. + * + * Returns the offset that must be added to align towards higher + * addresses. + */ +#define lttng_ust_offset_align(align_drift, alignment) \ + ({ \ + LTTNG_BUILD_RUNTIME_BUG_ON((alignment) == 0 \ + || ((alignment) & ((alignment) - 1))); \ + (((alignment) - (align_drift)) & ((alignment) - 1)); \ + }) + +/** + * lttng_ust_offset_align_floor - Calculate the offset needed to align an + * object on its natural alignment towards lower addresses. + * @align_drift: object offset from an "alignment"-aligned address. + * @alignment: natural object alignment. Must be non-zero, power of 2. + * + * Returns the offset that must be substracted to align towards lower addresses. + */ +#define lttng_ust_offset_align_floor(align_drift, alignment) \ + ({ \ + LTTNG_BUILD_RUNTIME_BUG_ON((alignment) == 0 \ + || ((alignment) & ((alignment) - 1))); \ + (((align_drift) - (alignment)) & ((alignment) - 1)); \ + }) + +#endif /* _LTTNG_UST_ALIGN_H */ diff --git a/libcounter/shm.c b/libcounter/shm.c index 1689ad45..d9bccafc 100644 --- a/libcounter/shm.c +++ b/libcounter/shm.c @@ -17,14 +17,17 @@ #include #include #include -#include #include #include #include + #ifdef HAVE_LIBNUMA #include #include #endif + +#include + #include #include #include "../libringbuffer/mmap.h" diff --git a/liblttng-ust/lttng-bytecode-specialize.c b/liblttng-ust/lttng-bytecode-specialize.c index cb7480b3..28b0ea72 100644 --- a/liblttng-ust/lttng-bytecode-specialize.c +++ b/liblttng-ust/lttng-bytecode-specialize.c @@ -10,7 +10,7 @@ #include #include -#include +#include #include "context-internal.h" #include "lttng-bytecode.h" diff --git a/liblttng-ust/lttng-ust-elf.c b/liblttng-ust/lttng-ust-elf.c index ebc231e0..8a02ceb3 100644 --- a/liblttng-ust/lttng-ust-elf.c +++ b/liblttng-ust/lttng-ust-elf.c @@ -6,9 +6,6 @@ #define _LGPL_SOURCE #include -#include -#include -#include #include #include #include @@ -16,6 +13,9 @@ #include #include +#include + +#include #include #include "lttng-tracer-core.h" diff --git a/libringbuffer/ring_buffer_backend.c b/libringbuffer/ring_buffer_backend.c index f1f34898..26420188 100644 --- a/libringbuffer/ring_buffer_backend.c +++ b/libringbuffer/ring_buffer_backend.c @@ -11,8 +11,9 @@ #include #include -#include +#include #include + #include "ringbuffer-config.h" #include "vatomic.h" #include "backend.h" diff --git a/libringbuffer/ring_buffer_frontend.c b/libringbuffer/ring_buffer_frontend.c index 45ff7dee..23122865 100644 --- a/libringbuffer/ring_buffer_frontend.c +++ b/libringbuffer/ring_buffer_frontend.c @@ -52,9 +52,10 @@ #include #include -#include -#include "smp.h" +#include #include + +#include "smp.h" #include "ringbuffer-config.h" #include "vatomic.h" #include "backend.h" diff --git a/libringbuffer/ringbuffer-config.h b/libringbuffer/ringbuffer-config.h index 1052ed6f..0d33ace2 100644 --- a/libringbuffer/ringbuffer-config.h +++ b/libringbuffer/ringbuffer-config.h @@ -11,13 +11,14 @@ #define _LTTNG_RING_BUFFER_CONFIG_H #include -#include #include #include #include #include -#include + +#include #include +#include struct lttng_ust_lib_ring_buffer; struct lttng_ust_lib_ring_buffer_channel; diff --git a/libringbuffer/shm.c b/libringbuffer/shm.c index 58050468..6f5c9f5f 100644 --- a/libringbuffer/shm.c +++ b/libringbuffer/shm.c @@ -16,14 +16,17 @@ #include #include #include -#include #include #include #include + #ifdef HAVE_LIBNUMA #include #include #endif + +#include + #include #include #include "mmap.h"