From 9d315d6d74aac2986b10d708c864d152a0febec7 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Fri, 2 Apr 2021 14:45:42 -0400 Subject: [PATCH] Move internal headers to 'src/' dir Move internal headers from the global 'include' directory to their respective private directories under 'src/'. Remove the 'ust-' prefix when appropriate as they are now included with the 'common/' path which makes it easier to distinguish public and internal headers. This is part of an effort to standardize our autotools setup across projects to simplify maintenance. Change-Id: If5510bbe9294ba1f0dcd4b101b363e7ef64e255d Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- .gitignore | 1 + configure.ac | 1 + include/Makefile.am | 31 ------------------ src/Makefile.am | 1 + src/common/.placeholder | 1 - src/common/Makefile.am | 32 +++++++++++++++++++ include/ust-compat.h => src/common/align.h | 6 ++-- .../ust-bitfield.h => src/common/bitfield.h | 4 +-- include/ust-bitmap.h => src/common/bitmap.h | 6 ++-- .../ust-dlfcn.h => src/common/compat/dlfcn.h | 8 ++--- include/ust-tid.h => src/common/compat/tid.h | 6 ++-- .../common/dynamic-type.h | 6 ++-- include/ust-elf.h => src/common/elf.h | 6 ++-- .../common/logging.h | 6 ++-- include/ust-helper.h => src/common/macros.h | 9 ++++-- include/ust-share.h => src/common/patient.h | 6 ++-- .../common/safe-snprintf.h | 6 ++-- .../common}/ust-context-provider.h | 2 +- {include => src/common}/ust-fd.h | 0 include/ust-comm.h => src/common/ustcomm.h | 6 ++-- src/libcounter/counter-api.h | 2 +- src/libcounter/counter.c | 9 +++--- src/libcounter/shm.c | 4 +-- src/libcounter/shm.h | 2 +- src/liblttng-ust-comm/lttng-ust-comm.c | 10 +++--- src/liblttng-ust-comm/lttng-ust-fd-tracker.c | 6 ++-- src/liblttng-ust-ctl/ustctl.c | 8 ++--- src/liblttng-ust-dl/lttng-ust-dl.c | 11 ++++--- src/liblttng-ust-fd/lttng-ust-fd.c | 4 +-- src/liblttng-ust-fork/ustfork.c | 4 ++- .../jni/common/lttng_ust_context.c | 4 +-- .../lttng-ust-malloc.c | 9 ++++-- .../lttng-ust-pthread.c | 7 ++-- src/liblttng-ust/context-internal.h | 2 +- .../event-notifier-notification.c | 4 +-- src/liblttng-ust/getenv.c | 4 +-- src/liblttng-ust/lttng-bytecode-specialize.c | 2 +- src/liblttng-ust/lttng-bytecode-validator.c | 2 +- src/liblttng-ust/lttng-bytecode.c | 2 +- src/liblttng-ust/lttng-bytecode.h | 6 ++-- src/liblttng-ust/lttng-clock.c | 4 ++- src/liblttng-ust/lttng-context-cgroup-ns.c | 2 +- src/liblttng-ust/lttng-context-ipc-ns.c | 2 +- src/liblttng-ust/lttng-context-net-ns.c | 2 +- .../lttng-context-perf-counters.c | 4 +-- src/liblttng-ust/lttng-context-provider.c | 4 +-- src/liblttng-ust/lttng-context-time-ns.c | 2 +- src/liblttng-ust/lttng-context-uts-ns.c | 2 +- src/liblttng-ust/lttng-context-vtid.c | 2 +- src/liblttng-ust/lttng-context.c | 6 ++-- src/liblttng-ust/lttng-events.c | 12 +++---- src/liblttng-ust/lttng-getcpu.c | 2 +- src/liblttng-ust/lttng-probes.c | 2 +- .../lttng-ring-buffer-client-template.h | 4 +-- ...tng-ring-buffer-metadata-client-template.h | 4 +-- src/liblttng-ust/lttng-tracer-core.h | 2 +- src/liblttng-ust/lttng-ust-abi.c | 7 ++-- src/liblttng-ust/lttng-ust-comm.c | 10 +++--- src/liblttng-ust/lttng-ust-dynamic-type.c | 4 +-- src/liblttng-ust/lttng-ust-elf.c | 6 ++-- src/liblttng-ust/lttng-ust-statedump.c | 4 +-- src/liblttng-ust/tracef.c | 2 +- src/liblttng-ust/tracelog.c | 2 +- src/liblttng-ust/tracepoint.c | 4 +-- src/liblttng-ust/ust-core.c | 2 +- src/liblttng-ust/ust-events-internal.h | 4 +-- src/libringbuffer/frontend_types.h | 2 +- src/libringbuffer/ring_buffer_backend.c | 2 +- src/libringbuffer/ring_buffer_frontend.c | 2 +- src/libringbuffer/shm.c | 4 +-- src/libringbuffer/shm.h | 2 +- src/snprintf/core.c | 2 +- src/snprintf/patient_write.c | 2 +- src/snprintf/snprintf.c | 2 +- tests/compile/test-app-ctx/hello.c | 2 +- tests/unit/libringbuffer/shm.c | 2 +- tests/unit/snprintf/snprintf.c | 2 +- tests/unit/ust-elf/ust-elf.c | 2 +- 78 files changed, 197 insertions(+), 176 deletions(-) delete mode 100644 src/common/.placeholder create mode 100644 src/common/Makefile.am rename include/ust-compat.h => src/common/align.h (88%) rename include/ust-bitfield.h => src/common/bitfield.h (99%) rename include/ust-bitmap.h => src/common/bitmap.h (91%) rename include/ust-dlfcn.h => src/common/compat/dlfcn.h (90%) rename include/ust-tid.h => src/common/compat/tid.h (81%) rename include/ust-dynamic-type.h => src/common/dynamic-type.h (89%) rename include/ust-elf.h => src/common/elf.h (95%) rename include/usterr-signal-safe.h => src/common/logging.h (97%) rename include/ust-helper.h => src/common/macros.h (89%) rename include/ust-share.h => src/common/patient.h (83%) rename include/ust-snprintf.h => src/common/safe-snprintf.h (78%) rename {include => src/common}/ust-context-provider.h (98%) rename {include => src/common}/ust-fd.h (100%) rename include/ust-comm.h => src/common/ustcomm.h (99%) diff --git a/.gitignore b/.gitignore index 42171575..37d46f9f 100644 --- a/.gitignore +++ b/.gitignore @@ -123,6 +123,7 @@ cscope.* /doc/examples/Makefile /doc/man/Makefile /include/Makefile +/src/common/Makefile /src/libcounter/Makefile /src/liblttng-ust-comm/Makefile /src/liblttng-ust-ctl/Makefile diff --git a/configure.ac b/configure.ac index 80226c78..00b70f2a 100644 --- a/configure.ac +++ b/configure.ac @@ -518,6 +518,7 @@ AC_CONFIG_FILES([ doc/Makefile doc/man/Makefile include/Makefile + src/common/Makefile src/libcounter/Makefile src/liblttng-ust-comm/Makefile src/liblttng-ust-ctl/Makefile diff --git a/include/Makefile.am b/include/Makefile.am index 854b4785..5ef7c9e5 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -42,34 +42,3 @@ nobase_include_HEADERS = \ nobase_nodist_include_HEADERS = \ lttng/ust-config.h \ lttng/ust-version.h - - -### ### -### Global private headers ### -### ### - -noinst_HEADERS = \ - usterr-signal-safe.h \ - ust-snprintf.h \ - ust-bitmap.h \ - ust-comm.h \ - ust-compat.h \ - ust-elf.h \ - ust-tid.h \ - ust-bitfield.h \ - ust-dlfcn.h \ - ust-dynamic-type.h \ - ust-helper.h \ - ust-share.h - - -# These headers should be moved to the public headers when tested and -# documented. The symbols are still part of the ABI. - -# Used by the Java jni interface. -noinst_HEADERS += \ - ust-context-provider.h - -# Used by liblttng-ust-fd -noinst_HEADERS += \ - ust-fd.h diff --git a/src/Makefile.am b/src/Makefile.am index 87fcdb8f..d9253053 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,7 @@ # SPDX-License-Identifier: LGPL-2.1-only SUBDIRS = \ + common \ snprintf \ libringbuffer \ liblttng-ust-comm \ diff --git a/src/common/.placeholder b/src/common/.placeholder deleted file mode 100644 index 959eb256..00000000 --- a/src/common/.placeholder +++ /dev/null @@ -1 +0,0 @@ -# Git doesn't support empty folders diff --git a/src/common/Makefile.am b/src/common/Makefile.am new file mode 100644 index 00000000..276c06a5 --- /dev/null +++ b/src/common/Makefile.am @@ -0,0 +1,32 @@ +# SPDX-License-Identifier: LGPL-2.1-only + +### ### +### Global private headers ### +### ### + +noinst_HEADERS = \ + align.h \ + bitfield.h \ + bitmap.h \ + dynamic-type.h \ + elf.h \ + logging.h \ + macros.h \ + patient.h \ + safe-snprintf.h \ + ustcomm.h + +noinst_HEADERS += \ + compat/dlfcn.h \ + compat/tid.h + +# These headers should be moved to the public headers when tested and +# documented. The symbols are still part of the ABI. + +# Used by the Java jni interface. +noinst_HEADERS += \ + ust-context-provider.h + +# Used by liblttng-ust-fd +noinst_HEADERS += \ + ust-fd.h diff --git a/include/ust-compat.h b/src/common/align.h similarity index 88% rename from include/ust-compat.h rename to src/common/align.h index c148e1be..ef04fe4a 100644 --- a/include/ust-compat.h +++ b/src/common/align.h @@ -4,8 +4,8 @@ * Copyright (C) 2010-2011 Mathieu Desnoyers */ -#ifndef _LTTNG_UST_COMPAT_H -#define _LTTNG_UST_COMPAT_H +#ifndef _UST_COMMON_ALIGN_H +#define _UST_COMMON_ALIGN_H #include #include @@ -28,4 +28,4 @@ #define LTTNG_UST_ALIGN(v, align) __LTTNG_UST_ALIGN_MASK(v, (__typeof__(v)) (align) - 1) #define LTTNG_UST_PAGE_ALIGN(addr) LTTNG_UST_ALIGN(addr, LTTNG_UST_PAGE_SIZE) -#endif +#endif /* _UST_COMMON_ALIGN_H */ diff --git a/include/ust-bitfield.h b/src/common/bitfield.h similarity index 99% rename from include/ust-bitfield.h rename to src/common/bitfield.h index 105dae51..7cb5b32d 100644 --- a/include/ust-bitfield.h +++ b/src/common/bitfield.h @@ -4,8 +4,8 @@ * Copyright (C) 2010-2019 Mathieu Desnoyers */ -#ifndef _BABELTRACE_BITFIELD_H -#define _BABELTRACE_BITFIELD_H +#ifndef _UST_COMMON_BITFIELD_H +#define _UST_COMMON_BITFIELD_H #include /* C99 5.2.4.2 Numerical limits */ #include /* C99 5.2.4.2 Numerical limits */ diff --git a/include/ust-bitmap.h b/src/common/bitmap.h similarity index 91% rename from include/ust-bitmap.h rename to src/common/bitmap.h index 29cc22e0..838a6a14 100644 --- a/include/ust-bitmap.h +++ b/src/common/bitmap.h @@ -6,8 +6,8 @@ * LTTng Bitmap API */ -#ifndef _LTTNG_BITMAP_H -#define _LTTNG_BITMAP_H +#ifndef _UST_COMMON_BITMAP_H +#define _UST_COMMON_BITMAP_H #include #include @@ -49,4 +49,4 @@ static inline bool lttng_bitmap_test_bit(unsigned int index, unsigned long *p) return (CMM_LOAD_SHARED(p[word]) >> bit) & 0x1; } -#endif /* _LTTNG_BITMAP_H */ +#endif /* _UST_COMMON_BITMAP_H */ diff --git a/include/ust-dlfcn.h b/src/common/compat/dlfcn.h similarity index 90% rename from include/ust-dlfcn.h rename to src/common/compat/dlfcn.h index 0681f8f6..c5861cae 100644 --- a/include/ust-dlfcn.h +++ b/src/common/compat/dlfcn.h @@ -6,11 +6,11 @@ * dlfcn.h compatibility layer. */ -#ifndef _LTTNG_UST_DLFCN_H -#define _LTTNG_UST_DLFCN_H +#ifndef _UST_COMMON_COMPAT_DLFCN_H +#define _UST_COMMON_COMPAT_DLFCN_H #ifdef _DLFCN_H -#error "Please include ust-dlfcn.h before dlfcn.h." +#error "Please include compat/dlfcn.h before dlfcn.h." #endif /* _DLFCN_H */ #ifdef __GLIBC__ @@ -54,4 +54,4 @@ extern void *dlvsym(void *__restrict __handle, #include #endif /* __GLIBC__ */ -#endif /* _LTTNG_UST_DLFCN_H */ +#endif /* _UST_COMMON_COMPAT_DLFCN_H */ diff --git a/include/ust-tid.h b/src/common/compat/tid.h similarity index 81% rename from include/ust-tid.h rename to src/common/compat/tid.h index eae1db9d..aecae9b1 100644 --- a/include/ust-tid.h +++ b/src/common/compat/tid.h @@ -6,8 +6,8 @@ * gettid compatibility layer. */ -#ifndef _LTTNG_UST_TID_H -#define _LTTNG_UST_TID_H +#ifndef _UST_COMMON_COMPAT_GETTID_H +#define _UST_COMMON_COMPAT_GETTID_H #ifdef __linux__ #include @@ -34,4 +34,4 @@ static inline pid_t lttng_gettid(void) #endif -#endif /* _LTTNG_UST_TID_H */ +#endif /* _UST_COMMON_COMPAT_GETTID_H */ diff --git a/include/ust-dynamic-type.h b/src/common/dynamic-type.h similarity index 89% rename from include/ust-dynamic-type.h rename to src/common/dynamic-type.h index e63fc4c4..84f55f9a 100644 --- a/include/ust-dynamic-type.h +++ b/src/common/dynamic-type.h @@ -4,8 +4,8 @@ * Copyright (C) 2016 Mathieu Desnoyers */ -#ifndef _LTTNG_UST_DYNAMIC_TYPE_H -#define _LTTNG_UST_DYNAMIC_TYPE_H +#ifndef _UST_COMMON_DYNAMIC_TYPE_H +#define _UST_COMMON_DYNAMIC_TYPE_H #include @@ -35,4 +35,4 @@ const struct lttng_ust_event_field *lttng_ust_dynamic_type_field(int64_t value) const struct lttng_ust_event_field *lttng_ust_dynamic_type_tag_field(void) __attribute__((visibility("hidden"))); -#endif /* _LTTNG_UST_DYNAMIC_TYPE_H */ +#endif /* _UST_COMMON_DYNAMIC_TYPE_H */ diff --git a/include/ust-elf.h b/src/common/elf.h similarity index 95% rename from include/ust-elf.h rename to src/common/elf.h index 29a9426f..ea0351de 100644 --- a/include/ust-elf.h +++ b/src/common/elf.h @@ -4,8 +4,8 @@ * Copyright (C) 2015 Antoine Busque */ -#ifndef _LTTNG_UST_ELF_H -#define _LTTNG_UST_ELF_H +#ifndef _UST_COMMON_ELF_H +#define _UST_COMMON_ELF_H #include #include @@ -76,4 +76,4 @@ int lttng_ust_elf_get_build_id(struct lttng_ust_elf *elf, uint8_t **build_id, int lttng_ust_elf_get_debug_link(struct lttng_ust_elf *elf, char **filename, uint32_t *crc, int *found); -#endif /* _LTTNG_UST_ELF_H */ +#endif /* _UST_COMMON_ELF_H */ diff --git a/include/usterr-signal-safe.h b/src/common/logging.h similarity index 97% rename from include/usterr-signal-safe.h rename to src/common/logging.h index 6123c0b3..4001c885 100644 --- a/include/usterr-signal-safe.h +++ b/src/common/logging.h @@ -14,9 +14,9 @@ #include #include #include -#include -#include "ust-tid.h" -#include "ust-snprintf.h" +#include "common/patient.h" +#include "common/compat/tid.h" +#include "common/safe-snprintf.h" enum ust_err_loglevel { UST_ERR_LOGLEVEL_UNKNOWN = 0, diff --git a/include/ust-helper.h b/src/common/macros.h similarity index 89% rename from include/ust-helper.h rename to src/common/macros.h index f1695516..308a1dfc 100644 --- a/include/ust-helper.h +++ b/src/common/macros.h @@ -4,13 +4,16 @@ * Copyright (C) 2011 Mathieu Desnoyers */ -#ifndef _LTTNG_UST_HELPER_H -#define _LTTNG_UST_HELPER_H +#ifndef _UST_COMMON_MACROS_H +#define _UST_COMMON_MACROS_H #include #include +/* + * Memory allocation zeroed + */ static inline void *zmalloc(size_t len) __attribute__((always_inline)); @@ -48,4 +51,4 @@ void *zmalloc(size_t len) #define LTTNG_UST_CALLER_IP() __builtin_return_address(0) #endif -#endif /* _LTTNG_UST_HELPER_H */ +#endif /* _UST_COMMON_MACROS_H */ diff --git a/include/ust-share.h b/src/common/patient.h similarity index 83% rename from include/ust-share.h rename to src/common/patient.h index e0ee0958..98b07b12 100644 --- a/include/ust-share.h +++ b/src/common/patient.h @@ -4,8 +4,8 @@ * Copyright (C) 2011 Mathieu Desnoyers */ -#ifndef _LTTNG_SHARE_H -#define _LTTNG_SHARE_H +#ifndef _UST_COMMON_PATIENT_H +#define _UST_COMMON_PATIENT_H #include #include @@ -19,4 +19,4 @@ ssize_t ust_patient_writev(int fd, struct iovec *iov, int iovcnt) ssize_t ust_patient_send(int fd, const void *buf, size_t count, int flags) __attribute__((visibility("hidden"))); -#endif /* _LTTNG_SHARE_H */ +#endif /* _UST_COMMON_PATIENT_H */ diff --git a/include/ust-snprintf.h b/src/common/safe-snprintf.h similarity index 78% rename from include/ust-snprintf.h rename to src/common/safe-snprintf.h index 3f663894..3cc4f67e 100644 --- a/include/ust-snprintf.h +++ b/src/common/safe-snprintf.h @@ -4,8 +4,8 @@ * Copyright (C) 2009 Pierre-Marc Fournier */ -#ifndef UST_SNPRINTF -#define UST_SNPRINTF +#ifndef _UST_COMMON_SAFE_SNPRINTF_H +#define _UST_COMMON_SAFE_SNPRINTF_H #include #include @@ -17,4 +17,4 @@ int ust_safe_snprintf(char *str, size_t n, const char *fmt, ...) __attribute__((visibility("hidden"))) __attribute__((format(printf, 3, 4))); -#endif /* UST_SNPRINTF */ +#endif /* _UST_COMMON_SAFE_SNPRINTF_H */ diff --git a/include/ust-context-provider.h b/src/common/ust-context-provider.h similarity index 98% rename from include/ust-context-provider.h rename to src/common/ust-context-provider.h index 85beac90..57dda8f3 100644 --- a/include/ust-context-provider.h +++ b/src/common/ust-context-provider.h @@ -14,7 +14,7 @@ #include #include -#include "ust-dynamic-type.h" +#include "common/dynamic-type.h" struct lttng_ust_registered_context_provider; diff --git a/include/ust-fd.h b/src/common/ust-fd.h similarity index 100% rename from include/ust-fd.h rename to src/common/ust-fd.h diff --git a/include/ust-comm.h b/src/common/ustcomm.h similarity index 99% rename from include/ust-comm.h rename to src/common/ustcomm.h index 775b6bef..81ce885d 100644 --- a/include/ust-comm.h +++ b/src/common/ustcomm.h @@ -11,8 +11,8 @@ * These declarations should NOT be considered stable API. */ -#ifndef _LTTNG_UST_COMM_H -#define _LTTNG_UST_COMM_H +#ifndef _UST_COMMON_USTCOMM_H +#define _UST_COMMON_USTCOMM_H #include #include @@ -324,4 +324,4 @@ int ustcomm_setsockopt_rcv_timeout(int sock, unsigned int msec) int ustcomm_setsockopt_snd_timeout(int sock, unsigned int msec) __attribute__((visibility("hidden"))); -#endif /* _LTTNG_UST_COMM_H */ +#endif /* _UST_COMMON_USTCOMM_H */ diff --git a/src/libcounter/counter-api.h b/src/libcounter/counter-api.h index 540bd11f..f140325d 100644 --- a/src/libcounter/counter-api.h +++ b/src/libcounter/counter-api.h @@ -15,7 +15,7 @@ #include "counter-internal.h" #include #include -#include "ust-bitmap.h" +#include "common/bitmap.h" #include "../libringbuffer/getcpu.h" /* diff --git a/src/libcounter/counter.c b/src/libcounter/counter.c index a825ac95..0393bed3 100644 --- a/src/libcounter/counter.c +++ b/src/libcounter/counter.c @@ -11,12 +11,13 @@ #include #include #include -#include + +#include "common/macros.h" +#include "common/align.h" +#include "common/bitmap.h" + #include "smp.h" #include "shm.h" -#include "ust-compat.h" - -#include "ust-bitmap.h" static size_t lttng_counter_get_dimension_nr_elements(struct lib_counter_dimension *dimension) { diff --git a/src/libcounter/shm.c b/src/libcounter/shm.c index b8a07e13..c1d6718a 100644 --- a/src/libcounter/shm.c +++ b/src/libcounter/shm.c @@ -27,8 +27,8 @@ #include -#include -#include +#include "common/macros.h" +#include "common/ust-fd.h" #include "../libringbuffer/mmap.h" /* diff --git a/src/libcounter/shm.h b/src/libcounter/shm.h index 8ec251d7..689edb0a 100644 --- a/src/libcounter/shm.h +++ b/src/libcounter/shm.h @@ -10,7 +10,7 @@ #include #include #include -#include +#include "common/logging.h" #include #include "shm_types.h" diff --git a/src/liblttng-ust-comm/lttng-ust-comm.c b/src/liblttng-ust-comm/lttng-ust-comm.c index d5d193d7..2d445cba 100644 --- a/src/liblttng-ust-comm/lttng-ust-comm.c +++ b/src/liblttng-ust-comm/lttng-ust-comm.c @@ -20,12 +20,12 @@ #include #include -#include -#include -#include +#include "common/ustcomm.h" +#include "common/ust-fd.h" +#include "common/macros.h" #include -#include -#include +#include "common/dynamic-type.h" +#include "common/logging.h" #include "../liblttng-ust/ust-events-internal.h" #include "../liblttng-ust/compat.h" diff --git a/src/liblttng-ust-comm/lttng-ust-fd-tracker.c b/src/liblttng-ust-comm/lttng-ust-fd-tracker.c index 18456e08..3879a90d 100644 --- a/src/liblttng-ust-comm/lttng-ust-fd-tracker.c +++ b/src/liblttng-ust-comm/lttng-ust-fd-tracker.c @@ -25,10 +25,10 @@ #include #include -#include -#include +#include "common/ust-fd.h" +#include "common/macros.h" #include -#include +#include "common/logging.h" #include "../liblttng-ust/compat.h" #include "../liblttng-ust/lttng-tracer-core.h" diff --git a/src/liblttng-ust-ctl/ustctl.c b/src/liblttng-ust-ctl/ustctl.c index a12e9dd3..a4e9d0e9 100644 --- a/src/liblttng-ust-ctl/ustctl.c +++ b/src/liblttng-ust-ctl/ustctl.c @@ -17,10 +17,10 @@ #include #include -#include -#include -#include -#include "ust-compat.h" +#include "common/logging.h" +#include "common/ustcomm.h" +#include "common/macros.h" +#include "common/align.h" #include "../libringbuffer/backend.h" #include "../libringbuffer/frontend.h" diff --git a/src/liblttng-ust-dl/lttng-ust-dl.c b/src/liblttng-ust-dl/lttng-ust-dl.c index 1394ce19..6444e3fb 100644 --- a/src/liblttng-ust-dl/lttng-ust-dl.c +++ b/src/liblttng-ust-dl/lttng-ust-dl.c @@ -7,17 +7,20 @@ */ #define _LGPL_SOURCE + +/* Has to be included first to override dlfcn.h */ +#include + #include #include #include #include #include -#include -#include +#include "common/elf.h" #include -#include -#include "usterr-signal-safe.h" +#include "common/macros.h" +#include "common/logging.h" #include "../liblttng-ust/ust-events-internal.h" diff --git a/src/liblttng-ust-fd/lttng-ust-fd.c b/src/liblttng-ust-fd/lttng-ust-fd.c index 14a23d9f..5efc0acd 100644 --- a/src/liblttng-ust-fd/lttng-ust-fd.c +++ b/src/liblttng-ust-fd/lttng-ust-fd.c @@ -9,10 +9,10 @@ #include #include #include -#include +#include "common/ust-fd.h" #include -#include +#include "common/macros.h" static int (*__lttng_ust_fd_plibc_close)(int fd); static int (*__lttng_ust_fd_plibc_fclose)(FILE *stream); diff --git a/src/liblttng-ust-fork/ustfork.c b/src/liblttng-ust-fork/ustfork.c index b10f24d2..3eb62d2a 100644 --- a/src/liblttng-ust-fork/ustfork.c +++ b/src/liblttng-ust-fork/ustfork.c @@ -5,7 +5,9 @@ * Copyright (C) 2011-2012 Mathieu Desnoyers */ -#include +/* Has to be included first to override dlfcn.h */ +#include + #include #include #include diff --git a/src/liblttng-ust-java-agent/jni/common/lttng_ust_context.c b/src/liblttng-ust-java-agent/jni/common/lttng_ust_context.c index 7ba4403a..8570b211 100644 --- a/src/liblttng-ust-java-agent/jni/common/lttng_ust_context.c +++ b/src/liblttng-ust-java-agent/jni/common/lttng_ust_context.c @@ -12,9 +12,9 @@ #include #include #include -#include +#include -#include "ust-helper.h" +#include "common/macros.h" #include "lttng_ust_context.h" enum lttng_ust_jni_type { diff --git a/src/liblttng-ust-libc-wrapper/lttng-ust-malloc.c b/src/liblttng-ust-libc-wrapper/lttng-ust-malloc.c index e1ff8e80..a93c7c1a 100644 --- a/src/liblttng-ust-libc-wrapper/lttng-ust-malloc.c +++ b/src/liblttng-ust-libc-wrapper/lttng-ust-malloc.c @@ -10,7 +10,10 @@ * circular dependency loop between this malloc wrapper, liburcu and * libc. */ -#include + +/* Has to be included first to override dlfcn.h */ +#include + #include #include #include @@ -24,8 +27,8 @@ #include -#include -#include "ust-compat.h" +#include "common/macros.h" +#include "common/align.h" #define TRACEPOINT_DEFINE #define TRACEPOINT_CREATE_PROBES diff --git a/src/liblttng-ust-libc-wrapper/lttng-ust-pthread.c b/src/liblttng-ust-libc-wrapper/lttng-ust-pthread.c index 06bf791b..c6633fe8 100644 --- a/src/liblttng-ust-libc-wrapper/lttng-ust-pthread.c +++ b/src/liblttng-ust-libc-wrapper/lttng-ust-pthread.c @@ -9,8 +9,11 @@ * circular dependency loop between this malloc wrapper, liburcu and * libc. */ -#include -#include + +/* Has to be included first to override dlfcn.h */ +#include + +#include "common/macros.h" #include #define TRACEPOINT_DEFINE diff --git a/src/liblttng-ust/context-internal.h b/src/liblttng-ust/context-internal.h index 209ffd43..87e3bbf5 100644 --- a/src/liblttng-ust/context-internal.h +++ b/src/liblttng-ust/context-internal.h @@ -9,7 +9,7 @@ #include #include "ust-events-internal.h" -#include "ust-context-provider.h" +#include "common/ust-context-provider.h" int lttng_context_init_all(struct lttng_ust_ctx **ctx) __attribute__((visibility("hidden"))); diff --git a/src/liblttng-ust/event-notifier-notification.c b/src/liblttng-ust/event-notifier-notification.c index b3e2c94f..aab66ab2 100644 --- a/src/liblttng-ust/event-notifier-notification.c +++ b/src/liblttng-ust/event-notifier-notification.c @@ -11,14 +11,14 @@ #include #include -#include +#include "common/logging.h" #include #include "lttng-tracer-core.h" #include "ust-events-internal.h" #include "../libmsgpack/msgpack.h" #include "lttng-bytecode.h" -#include "ust-share.h" +#include "common/patient.h" /* * We want this write to be atomic AND non-blocking, meaning that we diff --git a/src/liblttng-ust/getenv.c b/src/liblttng-ust/getenv.c index ea8edbcd..0a7bffd8 100644 --- a/src/liblttng-ust/getenv.c +++ b/src/liblttng-ust/getenv.c @@ -9,8 +9,8 @@ #include #include #include -#include -#include +#include "common/logging.h" +#include "common/macros.h" #include "getenv.h" enum lttng_env_secure { diff --git a/src/liblttng-ust/lttng-bytecode-specialize.c b/src/liblttng-ust/lttng-bytecode-specialize.c index 31bc3d05..3d7b5c2a 100644 --- a/src/liblttng-ust/lttng-bytecode-specialize.c +++ b/src/liblttng-ust/lttng-bytecode-specialize.c @@ -16,7 +16,7 @@ #include "context-internal.h" #include "lttng-bytecode.h" #include "ust-events-internal.h" -#include "ust-helper.h" +#include "common/macros.h" static int lttng_fls(int val) { diff --git a/src/liblttng-ust/lttng-bytecode-validator.c b/src/liblttng-ust/lttng-bytecode-validator.c index 267c5c19..91c4cace 100644 --- a/src/liblttng-ust/lttng-bytecode-validator.c +++ b/src/liblttng-ust/lttng-bytecode-validator.c @@ -17,7 +17,7 @@ #include "lttng-hash-helper.h" #include "string-utils.h" #include "ust-events-internal.h" -#include "ust-helper.h" +#include "common/macros.h" /* * Number of merge points for hash table size. Hash table initialized to diff --git a/src/liblttng-ust/lttng-bytecode.c b/src/liblttng-ust/lttng-bytecode.c index ea5827a4..68108192 100644 --- a/src/liblttng-ust/lttng-bytecode.c +++ b/src/liblttng-ust/lttng-bytecode.c @@ -15,7 +15,7 @@ #include "context-internal.h" #include "lttng-bytecode.h" #include "ust-events-internal.h" -#include "ust-helper.h" +#include "common/macros.h" static const char *opnames[] = { [ BYTECODE_OP_UNKNOWN ] = "UNKNOWN", diff --git a/src/liblttng-ust/lttng-bytecode.h b/src/liblttng-ust/lttng-bytecode.h index ffbaf187..a72369e1 100644 --- a/src/liblttng-ust/lttng-bytecode.h +++ b/src/liblttng-ust/lttng-bytecode.h @@ -12,16 +12,16 @@ #include #include #include -#include +#include "common/macros.h" #include -#include +#include "common/ust-context-provider.h" #include #include #include #include #include #include -#include +#include "common/logging.h" #include "bytecode.h" #include "ust-events-internal.h" diff --git a/src/liblttng-ust/lttng-clock.c b/src/liblttng-ust/lttng-clock.c index 27ecccd9..edda7ae9 100644 --- a/src/liblttng-ust/lttng-clock.c +++ b/src/liblttng-ust/lttng-clock.c @@ -10,11 +10,13 @@ #include #include #include -#include + #include #include #include +#include "common/logging.h" + #include "clock.h" #include "getenv.h" diff --git a/src/liblttng-ust/lttng-context-cgroup-ns.c b/src/liblttng-ust/lttng-context-cgroup-ns.c index fece0808..305ed8cd 100644 --- a/src/liblttng-ust/lttng-context-cgroup-ns.c +++ b/src/liblttng-ust/lttng-context-cgroup-ns.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include "common/compat/tid.h" #include #include diff --git a/src/liblttng-ust/lttng-context-ipc-ns.c b/src/liblttng-ust/lttng-context-ipc-ns.c index 2ec62416..c5867fb4 100644 --- a/src/liblttng-ust/lttng-context-ipc-ns.c +++ b/src/liblttng-ust/lttng-context-ipc-ns.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include "common/compat/tid.h" #include #include diff --git a/src/liblttng-ust/lttng-context-net-ns.c b/src/liblttng-ust/lttng-context-net-ns.c index 76707cba..e7c8f9f9 100644 --- a/src/liblttng-ust/lttng-context-net-ns.c +++ b/src/liblttng-ust/lttng-context-net-ns.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include "common/compat/tid.h" #include #include "context-internal.h" diff --git a/src/liblttng-ust/lttng-context-perf-counters.c b/src/liblttng-ust/lttng-context-perf-counters.c index 6f620911..39b51f3b 100644 --- a/src/liblttng-ust/lttng-context-perf-counters.c +++ b/src/liblttng-ust/lttng-context-perf-counters.c @@ -25,9 +25,9 @@ #include #include #include -#include +#include "common/macros.h" #include -#include +#include "common/logging.h" #include #include #include "perf_event.h" diff --git a/src/liblttng-ust/lttng-context-provider.c b/src/liblttng-ust/lttng-context-provider.c index c70da208..caeb387b 100644 --- a/src/liblttng-ust/lttng-context-provider.c +++ b/src/liblttng-ust/lttng-context-provider.c @@ -12,13 +12,13 @@ #include #include -#include +#include #include "context-internal.h" #include "lttng-tracer-core.h" #include "jhash.h" #include "context-provider-internal.h" -#include +#include "common/macros.h" struct lttng_ust_registered_context_provider { const struct lttng_ust_context_provider *provider; diff --git a/src/liblttng-ust/lttng-context-time-ns.c b/src/liblttng-ust/lttng-context-time-ns.c index cb907c4a..75e3e365 100644 --- a/src/liblttng-ust/lttng-context-time-ns.c +++ b/src/liblttng-ust/lttng-context-time-ns.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include "common/compat/tid.h" #include #include "lttng-tracer-core.h" #include "ns.h" diff --git a/src/liblttng-ust/lttng-context-uts-ns.c b/src/liblttng-ust/lttng-context-uts-ns.c index 5ba06f6e..b28fe874 100644 --- a/src/liblttng-ust/lttng-context-uts-ns.c +++ b/src/liblttng-ust/lttng-context-uts-ns.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include "common/compat/tid.h" #include #include "context-internal.h" diff --git a/src/liblttng-ust/lttng-context-vtid.c b/src/liblttng-ust/lttng-context-vtid.c index 3530d266..ce8dcd2c 100644 --- a/src/liblttng-ust/lttng-context-vtid.c +++ b/src/liblttng-ust/lttng-context-vtid.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include "common/compat/tid.h" #include #include "context-internal.h" diff --git a/src/liblttng-ust/lttng-context.c b/src/liblttng-ust/lttng-context.c index 7043c157..aeafa9fc 100644 --- a/src/liblttng-ust/lttng-context.c +++ b/src/liblttng-ust/lttng-context.c @@ -9,11 +9,11 @@ #define _LGPL_SOURCE #include #include -#include +#include #include #include -#include -#include +#include "common/logging.h" +#include "common/macros.h" #include #include #include diff --git a/src/liblttng-ust/lttng-events.c b/src/liblttng-ust/lttng-events.c index b61a2293..ed11b3b5 100644 --- a/src/liblttng-ust/lttng-events.c +++ b/src/liblttng-ust/lttng-events.c @@ -32,13 +32,13 @@ #include #include -#include -#include +#include "common/logging.h" +#include "common/macros.h" #include -#include -#include -#include -#include +#include "common/ustcomm.h" +#include "common/ust-fd.h" +#include "common/dynamic-type.h" +#include "common/ust-context-provider.h" #include "error.h" #include "compat.h" #include "lttng-ust-uuid.h" diff --git a/src/liblttng-ust/lttng-getcpu.c b/src/liblttng-ust/lttng-getcpu.c index 762f8152..d4d91da6 100644 --- a/src/liblttng-ust/lttng-getcpu.c +++ b/src/liblttng-ust/lttng-getcpu.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include "common/logging.h" #include #include #include diff --git a/src/liblttng-ust/lttng-probes.c b/src/liblttng-ust/lttng-probes.c index 03fbe36b..553770ea 100644 --- a/src/liblttng-ust/lttng-probes.c +++ b/src/liblttng-ust/lttng-probes.c @@ -15,7 +15,7 @@ #include #include "tracepoint-internal.h" #include -#include +#include "common/macros.h" #include #include "lttng-tracer-core.h" diff --git a/src/liblttng-ust/lttng-ring-buffer-client-template.h b/src/liblttng-ust/lttng-ring-buffer-client-template.h index a63786bc..d7f77698 100644 --- a/src/liblttng-ust/lttng-ring-buffer-client-template.h +++ b/src/liblttng-ust/lttng-ring-buffer-client-template.h @@ -12,8 +12,8 @@ #include #include -#include "ust-bitfield.h" -#include "ust-compat.h" +#include "common/bitfield.h" +#include "common/align.h" #include "clock.h" #include "context-internal.h" #include "lttng-tracer.h" diff --git a/src/liblttng-ust/lttng-ring-buffer-metadata-client-template.h b/src/liblttng-ust/lttng-ring-buffer-metadata-client-template.h index fe080dca..2406567e 100644 --- a/src/liblttng-ust/lttng-ring-buffer-metadata-client-template.h +++ b/src/liblttng-ust/lttng-ring-buffer-metadata-client-template.h @@ -11,8 +11,8 @@ #include #include -#include "ust-bitfield.h" -#include "ust-compat.h" +#include "common/bitfield.h" +#include "common/align.h" #include "lttng-tracer.h" #include "../libringbuffer/frontend_types.h" #include diff --git a/src/liblttng-ust/lttng-tracer-core.h b/src/liblttng-ust/lttng-tracer-core.h index 7714dbf4..e127a660 100644 --- a/src/liblttng-ust/lttng-tracer-core.h +++ b/src/liblttng-ust/lttng-tracer-core.h @@ -14,7 +14,7 @@ #include #include #include -#include +#include "common/logging.h" /* * The longuest possible namespace proc path is with the cgroup ns diff --git a/src/liblttng-ust/lttng-ust-abi.c b/src/liblttng-ust/lttng-ust-abi.c index 61105ace..e443e4bc 100644 --- a/src/liblttng-ust/lttng-ust-abi.c +++ b/src/liblttng-ust/lttng-ust-abi.c @@ -35,8 +35,9 @@ #include #include #include -#include -#include + +#include "common/ust-fd.h" +#include "common/logging.h" #include "../libringbuffer/frontend_types.h" #include "../libringbuffer/frontend.h" @@ -47,7 +48,7 @@ #include "string-utils.h" #include "ust-events-internal.h" #include "context-internal.h" -#include "ust-helper.h" +#include "common/macros.h" #define OBJ_NAME_LEN 16 diff --git a/src/liblttng-ust/lttng-ust-comm.c b/src/liblttng-ust/lttng-ust-comm.c index c0a7311f..137107cd 100644 --- a/src/liblttng-ust/lttng-ust-comm.c +++ b/src/liblttng-ust/lttng-ust-comm.c @@ -39,10 +39,10 @@ #include #include #include -#include -#include -#include -#include +#include "common/ustcomm.h" +#include "common/ust-fd.h" +#include "common/logging.h" +#include "common/macros.h" #include "tracepoint-internal.h" #include "lttng-tracer-core.h" #include "compat.h" @@ -53,7 +53,7 @@ #include "getenv.h" #include "ust-events-internal.h" #include "context-internal.h" -#include "ust-compat.h" +#include "common/align.h" #include "lttng-counter-client.h" #include "lttng-rb-clients.h" diff --git a/src/liblttng-ust/lttng-ust-dynamic-type.c b/src/liblttng-ust/lttng-ust-dynamic-type.c index 30128699..d98e45ba 100644 --- a/src/liblttng-ust/lttng-ust-dynamic-type.c +++ b/src/liblttng-ust/lttng-ust-dynamic-type.c @@ -12,8 +12,8 @@ #include #include -#include -#include +#include "common/macros.h" +#include "common/dynamic-type.h" #define ctf_enum_value(_string, _value) \ __LTTNG_COMPOUND_LITERAL(struct lttng_ust_enum_entry, { \ diff --git a/src/liblttng-ust/lttng-ust-elf.c b/src/liblttng-ust/lttng-ust-elf.c index 3e0b8890..59805365 100644 --- a/src/liblttng-ust/lttng-ust-elf.c +++ b/src/liblttng-ust/lttng-ust-elf.c @@ -15,12 +15,12 @@ #include -#include -#include +#include "common/elf.h" +#include "common/ust-fd.h" #include "lttng-tracer-core.h" #include "lttng-ust-elf.h" -#include "ust-helper.h" +#include "common/macros.h" #define BUF_LEN 4096 diff --git a/src/liblttng-ust/lttng-ust-statedump.c b/src/liblttng-ust/lttng-ust-statedump.c index eaee338a..cd8bc7c8 100644 --- a/src/liblttng-ust/lttng-ust-statedump.c +++ b/src/liblttng-ust/lttng-ust-statedump.c @@ -16,8 +16,8 @@ #include #include -#include -#include +#include "common/elf.h" +#include "common/macros.h" #include "lttng-tracer-core.h" #include "lttng-ust-statedump.h" #include "jhash.h" diff --git a/src/liblttng-ust/tracef.c b/src/liblttng-ust/tracef.c index 4c7e805d..3c4ce490 100644 --- a/src/liblttng-ust/tracef.c +++ b/src/liblttng-ust/tracef.c @@ -6,7 +6,7 @@ #define _LGPL_SOURCE #include -#include +#include "common/macros.h" #define TRACEPOINT_CREATE_PROBES #define TRACEPOINT_DEFINE diff --git a/src/liblttng-ust/tracelog.c b/src/liblttng-ust/tracelog.c index d69301d8..735d04a9 100644 --- a/src/liblttng-ust/tracelog.c +++ b/src/liblttng-ust/tracelog.c @@ -6,7 +6,7 @@ #define _LGPL_SOURCE #include -#include +#include "common/macros.h" #define TRACEPOINT_CREATE_PROBES #define TRACEPOINT_DEFINE diff --git a/src/liblttng-ust/tracepoint.c b/src/liblttng-ust/tracepoint.c index 00fcc740..e5a970ad 100644 --- a/src/liblttng-ust/tracepoint.c +++ b/src/liblttng-ust/tracepoint.c @@ -23,8 +23,8 @@ #include #include /* for LTTNG_UST_ABI_SYM_NAME_LEN */ -#include -#include +#include "common/logging.h" +#include "common/macros.h" #include "tracepoint-internal.h" #include "lttng-tracer-core.h" diff --git a/src/liblttng-ust/ust-core.c b/src/liblttng-ust/ust-core.c index 2633832b..d4829904 100644 --- a/src/liblttng-ust/ust-core.c +++ b/src/liblttng-ust/ust-core.c @@ -11,7 +11,7 @@ #include "context-internal.h" #include "ust-events-internal.h" -#include +#include "common/logging.h" #include "lttng-tracer-core.h" #include "lttng-rb-clients.h" #include "lttng-counter-client.h" diff --git a/src/liblttng-ust/ust-events-internal.h b/src/liblttng-ust/ust-events-internal.h index d84d32ee..21d40e17 100644 --- a/src/liblttng-ust/ust-events-internal.h +++ b/src/liblttng-ust/ust-events-internal.h @@ -15,8 +15,8 @@ #include -#include -#include "ust-context-provider.h" +#include "common/macros.h" +#include "common/ust-context-provider.h" struct lttng_ust_abi_obj; struct lttng_event_notifier_group; diff --git a/src/libringbuffer/frontend_types.h b/src/libringbuffer/frontend_types.h index 4e7d2e8f..467ece73 100644 --- a/src/libringbuffer/frontend_types.h +++ b/src/libringbuffer/frontend_types.h @@ -20,7 +20,7 @@ #include #include "ringbuffer-config.h" -#include +#include "common/logging.h" #include "backend_types.h" #include "shm_internal.h" #include "shm_types.h" diff --git a/src/libringbuffer/ring_buffer_backend.c b/src/libringbuffer/ring_buffer_backend.c index 6ba0d8b1..b0a7c513 100644 --- a/src/libringbuffer/ring_buffer_backend.c +++ b/src/libringbuffer/ring_buffer_backend.c @@ -20,7 +20,7 @@ #include "frontend.h" #include "smp.h" #include "shm.h" -#include "ust-compat.h" +#include "common/align.h" /** * lib_ring_buffer_backend_allocate - allocate a channel buffer diff --git a/src/libringbuffer/ring_buffer_frontend.c b/src/libringbuffer/ring_buffer_frontend.c index 1b9ec40d..296368f3 100644 --- a/src/libringbuffer/ring_buffer_frontend.c +++ b/src/libringbuffer/ring_buffer_frontend.c @@ -50,7 +50,7 @@ #include #include #include -#include +#include "common/macros.h" #include #include diff --git a/src/libringbuffer/shm.c b/src/libringbuffer/shm.c index e4f818fc..a5de019c 100644 --- a/src/libringbuffer/shm.c +++ b/src/libringbuffer/shm.c @@ -27,8 +27,8 @@ #include -#include -#include +#include "common/macros.h" +#include "common/ust-fd.h" #include "mmap.h" /* diff --git a/src/libringbuffer/shm.h b/src/libringbuffer/shm.h index c3ce4ef8..6e4f7f7b 100644 --- a/src/libringbuffer/shm.h +++ b/src/libringbuffer/shm.h @@ -10,7 +10,7 @@ #include #include #include -#include +#include "common/logging.h" #include #include "shm_types.h" diff --git a/src/snprintf/core.c b/src/snprintf/core.c index 8c4eddec..9841c68d 100644 --- a/src/snprintf/core.c +++ b/src/snprintf/core.c @@ -4,7 +4,7 @@ * Copyright (C) 2011 Mathieu Desnoyers */ -#include +#include "common/logging.h" volatile enum ust_err_loglevel ust_err_loglevel; diff --git a/src/snprintf/patient_write.c b/src/snprintf/patient_write.c index 5a7fed43..517a16ad 100644 --- a/src/snprintf/patient_write.c +++ b/src/snprintf/patient_write.c @@ -19,7 +19,7 @@ #include -#include +#include "common/patient.h" /* * This write is patient because it restarts if it was incomplete. diff --git a/src/snprintf/snprintf.c b/src/snprintf/snprintf.c index 7e37a5e5..c297cb70 100644 --- a/src/snprintf/snprintf.c +++ b/src/snprintf/snprintf.c @@ -15,7 +15,7 @@ #include #include #include "local.h" -#include "ust-snprintf.h" +#include "common/safe-snprintf.h" #define DUMMY_LEN 1 diff --git a/tests/compile/test-app-ctx/hello.c b/tests/compile/test-app-ctx/hello.c index 9cc8f1a8..26cca016 100644 --- a/tests/compile/test-app-ctx/hello.c +++ b/tests/compile/test-app-ctx/hello.c @@ -31,7 +31,7 @@ struct mmsghdr; #include #include /* Internal header. */ -#include +#include static __thread unsigned int test_count; diff --git a/tests/unit/libringbuffer/shm.c b/tests/unit/libringbuffer/shm.c index d543991a..c0092170 100644 --- a/tests/unit/libringbuffer/shm.c +++ b/tests/unit/libringbuffer/shm.c @@ -13,7 +13,7 @@ #include #include "../../../src/libringbuffer/shm.h" -#include "ust-compat.h" +#include "common/align.h" #include "tap.h" diff --git a/tests/unit/snprintf/snprintf.c b/tests/unit/snprintf/snprintf.c index 00fd02a0..79f31357 100644 --- a/tests/unit/snprintf/snprintf.c +++ b/tests/unit/snprintf/snprintf.c @@ -6,7 +6,7 @@ #include #include -#include "ust-snprintf.h" +#include "common/safe-snprintf.h" #include "tap.h" diff --git a/tests/unit/ust-elf/ust-elf.c b/tests/unit/ust-elf/ust-elf.c index 0073a999..7e924a90 100644 --- a/tests/unit/ust-elf/ust-elf.c +++ b/tests/unit/ust-elf/ust-elf.c @@ -11,7 +11,7 @@ #include #include -#include +#include "common/elf.h" #include "tap.h" #define NUM_ARCH 4 -- 2.34.1