From: Francis Deslauriers Date: Tue, 3 Dec 2019 22:17:42 +0000 (-0500) Subject: Cleanup: apply `include-what-you-use` guideline for `uint*_t` X-Git-Tag: v2.13.0-rc1~547 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=fb31eb73d8a4a6d9784ed5c335b7fa3b9684108c;p=lttng-ust.git Cleanup: apply `include-what-you-use` guideline for `uint*_t` I saw that some files use `uint*_t` types but there are not including a header for it. The `uint*_t` types is defined by the following header: So, to follow the best practice of including what is used in a file, I added `#include ` in files using `uint*_t`. Signed-off-by: Francis Deslauriers Signed-off-by: Mathieu Desnoyers Change-Id: I5da13744858a57fc8c9bf6a6cf1b29299c2211cc --- diff --git a/doc/examples/clock-override/lttng-ust-clock-override-example.c b/doc/examples/clock-override/lttng-ust-clock-override-example.c index ab29787c..aed7aac8 100644 --- a/doc/examples/clock-override/lttng-ust-clock-override-example.c +++ b/doc/examples/clock-override/lttng-ust-clock-override-example.c @@ -23,6 +23,7 @@ */ #include +#include #include #include #include diff --git a/include/lttng/ust-ctl.h b/include/lttng/ust-ctl.h index 56128490..4b254efa 100644 --- a/include/lttng/ust-ctl.h +++ b/include/lttng/ust-ctl.h @@ -19,10 +19,12 @@ #ifndef _LTTNG_UST_CTL_H #define _LTTNG_UST_CTL_H +#include #include -#include +#include #include -#include + +#include #ifndef LTTNG_PACKED #error "LTTNG_PACKED should be defined" diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h index 7890c247..0360bb6c 100644 --- a/include/lttng/ust-tracepoint-event.h +++ b/include/lttng/ust-tracepoint-event.h @@ -20,6 +20,7 @@ * SOFTWARE. */ +#include #include #include #include diff --git a/include/ust-comm.h b/include/ust-comm.h index 10dbca21..a5e09572 100644 --- a/include/ust-comm.h +++ b/include/ust-comm.h @@ -26,6 +26,7 @@ * These declarations should NOT be considered stable API. */ +#include #include #include #include diff --git a/liblttng-ust-comm/lttng-ust-comm.c b/liblttng-ust-comm/lttng-ust-comm.c index 92d86d4e..543465ed 100644 --- a/liblttng-ust-comm/lttng-ust-comm.c +++ b/liblttng-ust-comm/lttng-ust-comm.c @@ -19,6 +19,7 @@ #define _GNU_SOURCE #include +#include #include #include #include diff --git a/liblttng-ust-ctl/ustctl.c b/liblttng-ust-ctl/ustctl.c index c2b761a1..39c8baa4 100644 --- a/liblttng-ust-ctl/ustctl.c +++ b/liblttng-ust-ctl/ustctl.c @@ -17,14 +17,15 @@ */ #define _GNU_SOURCE +#include +#include #include +#include + #include #include #include #include -#include -#include - #include #include #include diff --git a/liblttng-ust-dl/lttng-ust-dl.c b/liblttng-ust-dl/lttng-ust-dl.c index 231e9ec3..e38eaf1e 100644 --- a/liblttng-ust-dl/lttng-ust-dl.c +++ b/liblttng-ust-dl/lttng-ust-dl.c @@ -22,6 +22,7 @@ #define _LGPL_SOURCE #include #include +#include #include #include diff --git a/liblttng-ust/filter-bytecode.h b/liblttng-ust/filter-bytecode.h index 7df0288a..59e84555 100644 --- a/liblttng-ust/filter-bytecode.h +++ b/liblttng-ust/filter-bytecode.h @@ -27,6 +27,7 @@ * SOFTWARE. */ +#include #include #ifndef LTTNG_PACKED diff --git a/liblttng-ust/jhash.h b/liblttng-ust/jhash.h index 416836ad..ace743bf 100644 --- a/liblttng-ust/jhash.h +++ b/liblttng-ust/jhash.h @@ -17,6 +17,7 @@ */ #include +#include #include #include diff --git a/liblttng-ust/lttng-clock.c b/liblttng-ust/lttng-clock.c index 877b5d61..5c33de0c 100644 --- a/liblttng-ust/lttng-clock.c +++ b/liblttng-ust/lttng-clock.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include diff --git a/liblttng-ust/lttng-context-perf-counters.c b/liblttng-ust/lttng-context-perf-counters.c index 90f9db19..12d4ab3b 100644 --- a/liblttng-ust/lttng-context-perf-counters.c +++ b/liblttng-ust/lttng-context-perf-counters.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include diff --git a/liblttng-ust/lttng-context-provider.c b/liblttng-ust/lttng-context-provider.c index edb1e9b2..50f73c62 100644 --- a/liblttng-ust/lttng-context-provider.c +++ b/liblttng-ust/lttng-context-provider.c @@ -22,8 +22,10 @@ #define _LGPL_SOURCE #include +#include #include #include + #include #include "lttng-tracer-core.h" #include "jhash.h" diff --git a/liblttng-ust/lttng-filter-specialize.c b/liblttng-ust/lttng-filter-specialize.c index 21e35923..39730f8c 100644 --- a/liblttng-ust/lttng-filter-specialize.c +++ b/liblttng-ust/lttng-filter-specialize.c @@ -26,6 +26,7 @@ #define _LGPL_SOURCE #include +#include #include "lttng-filter.h" #include diff --git a/liblttng-ust/lttng-filter-validator.c b/liblttng-ust/lttng-filter-validator.c index 49e2e43d..953bbdd7 100644 --- a/liblttng-ust/lttng-filter-validator.c +++ b/liblttng-ust/lttng-filter-validator.c @@ -26,11 +26,13 @@ #define _LGPL_SOURCE #include -#include +#include #include -#include "lttng-filter.h" +#include #include + +#include "lttng-filter.h" #include "lttng-hash-helper.h" #include "string-utils.h" diff --git a/liblttng-ust/lttng-filter.c b/liblttng-ust/lttng-filter.c index fb8eefdd..c0e93b65 100644 --- a/liblttng-ust/lttng-filter.c +++ b/liblttng-ust/lttng-filter.c @@ -26,7 +26,10 @@ #define _LGPL_SOURCE #include +#include + #include + #include "lttng-filter.h" static const char *opnames[] = { diff --git a/liblttng-ust/lttng-rb-clients.h b/liblttng-ust/lttng-rb-clients.h index e54decbe..db75dec6 100644 --- a/liblttng-ust/lttng-rb-clients.h +++ b/liblttng-ust/lttng-rb-clients.h @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include + struct lttng_ust_client_lib_ring_buffer_client_cb { struct lttng_ust_lib_ring_buffer_client_cb parent; diff --git a/liblttng-ust/lttng-tracer-core.h b/liblttng-ust/lttng-tracer-core.h index bd837237..1a0f03a1 100644 --- a/liblttng-ust/lttng-tracer-core.h +++ b/liblttng-ust/lttng-tracer-core.h @@ -21,7 +21,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include #include #include #include diff --git a/liblttng-ust/lttng-ust-abi.c b/liblttng-ust/lttng-ust-abi.c index 24769a7d..0459d7a3 100644 --- a/liblttng-ust/lttng-ust-abi.c +++ b/liblttng-ust/lttng-ust-abi.c @@ -38,21 +38,24 @@ */ #define _LGPL_SOURCE -#include -#include +#include + #include #include + +#include +#include +#include +#include #include #include -#include #include -#include "tracepoint-internal.h" #include -#include + +#include "../libringbuffer/frontend_types.h" +#include "../libringbuffer/shm.h" #include "lttng-tracer.h" #include "string-utils.h" -#include "../libringbuffer/shm.h" -#include "../libringbuffer/frontend_types.h" #define OBJ_NAME_LEN 16 diff --git a/liblttng-ust/lttng-ust-comm.c b/liblttng-ust/lttng-ust-comm.c index 838bf08b..900a0e84 100644 --- a/liblttng-ust/lttng-ust-comm.c +++ b/liblttng-ust/lttng-ust-comm.c @@ -22,6 +22,7 @@ #define _LGPL_SOURCE #define _GNU_SOURCE #include +#include #include #include #include diff --git a/liblttng-ust/lttng-ust-elf.c b/liblttng-ust/lttng-ust-elf.c index 3d6a9379..5de3561f 100644 --- a/liblttng-ust/lttng-ust-elf.c +++ b/liblttng-ust/lttng-ust-elf.c @@ -18,16 +18,19 @@ #define _GNU_SOURCE #define _LGPL_SOURCE +#include #include -#include #include #include -#include +#include +#include +#include #include -#include +#include #include -#include + #include + #include "lttng-tracer-core.h" #define BUF_LEN 4096 diff --git a/liblttng-ust/ust-core.c b/liblttng-ust/ust-core.c index 255ad963..abea7bbd 100644 --- a/liblttng-ust/ust-core.c +++ b/liblttng-ust/ust-core.c @@ -19,6 +19,7 @@ */ #define _LGPL_SOURCE +#include #include #include #include diff --git a/libringbuffer/backend_internal.h b/libringbuffer/backend_internal.h index f492cc3e..fe8f6eb6 100644 --- a/libringbuffer/backend_internal.h +++ b/libringbuffer/backend_internal.h @@ -24,6 +24,7 @@ */ #include +#include #include #include diff --git a/libringbuffer/backend_types.h b/libringbuffer/backend_types.h index 83fe0487..3432ef07 100644 --- a/libringbuffer/backend_types.h +++ b/libringbuffer/backend_types.h @@ -24,6 +24,7 @@ */ #include +#include #include "shm_internal.h" #include "vatomic.h" diff --git a/libringbuffer/frontend.h b/libringbuffer/frontend.h index 016fc530..838f88e8 100644 --- a/libringbuffer/frontend.h +++ b/libringbuffer/frontend.h @@ -29,6 +29,7 @@ * See ring_buffer_frontend.c for more information on wait-free algorithms. */ #include +#include #include #include diff --git a/libringbuffer/frontend_internal.h b/libringbuffer/frontend_internal.h index 7233ed6d..f6d91bde 100644 --- a/libringbuffer/frontend_internal.h +++ b/libringbuffer/frontend_internal.h @@ -34,6 +34,7 @@ #include #include #include +#include #include #include diff --git a/libringbuffer/frontend_types.h b/libringbuffer/frontend_types.h index d0890408..43300f6a 100644 --- a/libringbuffer/frontend_types.h +++ b/libringbuffer/frontend_types.h @@ -28,6 +28,7 @@ * See ring_buffer_frontend.c for more information on wait-free algorithms. */ +#include #include #include /* for timer_t */ diff --git a/libringbuffer/ring_buffer_backend.c b/libringbuffer/ring_buffer_backend.c index b69dc5e6..f75adbce 100644 --- a/libringbuffer/ring_buffer_backend.c +++ b/libringbuffer/ring_buffer_backend.c @@ -21,6 +21,7 @@ #define _GNU_SOURCE #define _LGPL_SOURCE #include +#include #include #include #include diff --git a/libringbuffer/ring_buffer_frontend.c b/libringbuffer/ring_buffer_frontend.c index ce759ff1..7f73d03c 100644 --- a/libringbuffer/ring_buffer_frontend.c +++ b/libringbuffer/ring_buffer_frontend.c @@ -61,6 +61,7 @@ #include #include #include +#include #include #include #include diff --git a/libringbuffer/shm.c b/libringbuffer/shm.c index 909991ed..44a830af 100644 --- a/libringbuffer/shm.c +++ b/libringbuffer/shm.c @@ -34,6 +34,7 @@ #include #include #include +#include #ifdef HAVE_LIBNUMA #include #include diff --git a/tests/test-app-ctx/hello.c b/tests/test-app-ctx/hello.c index 85064846..e9e45ec7 100644 --- a/tests/test-app-ctx/hello.c +++ b/tests/test-app-ctx/hello.c @@ -17,15 +17,16 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include -#include -#include -#include -#include #include #include +#include +#include +#include #include +#include +#include +#include +#include /* * Work-around inet.h missing struct mmsghdr forward declaration, with * triggers a warning when system files warnings are enabled. diff --git a/tests/ust-basic-tracing/ust-basic-tracing.c b/tests/ust-basic-tracing/ust-basic-tracing.c index 15368ed7..e9b9ea6d 100644 --- a/tests/ust-basic-tracing/ust-basic-tracing.c +++ b/tests/ust-basic-tracing/ust-basic-tracing.c @@ -20,24 +20,25 @@ #define _LARGEFILE64_SOURCE #define _GNU_SOURCE +#include #include +#include +#include +#include +#include #include #include #include -#include -#include -#include -#include +#include +#include +#include #include #include -#include -#include -#include -#include +#include +#include +#include #include #include -#include -#include #include #include diff --git a/tests/ust-elf/ust-elf.c b/tests/ust-elf/ust-elf.c index 4036563a..af9b1239 100644 --- a/tests/ust-elf/ust-elf.c +++ b/tests/ust-elf/ust-elf.c @@ -17,6 +17,7 @@ */ #include +#include #include #include #include diff --git a/tests/ust-multi-test/ust-multi-test.c b/tests/ust-multi-test/ust-multi-test.c index 01137439..eb047655 100644 --- a/tests/ust-multi-test/ust-multi-test.c +++ b/tests/ust-multi-test/ust-multi-test.c @@ -20,24 +20,25 @@ #define _LARGEFILE64_SOURCE #define _GNU_SOURCE +#include #include +#include +#include +#include +#include #include #include #include -#include -#include -#include -#include -#include +#include #include +#include #include -#include -#include -#include +#include +#include +#include +#include #include #include -#include -#include #include #include diff --git a/tests/ust-variant/ust-variant.c b/tests/ust-variant/ust-variant.c index 3d97c1a3..9079c26f 100644 --- a/tests/ust-variant/ust-variant.c +++ b/tests/ust-variant/ust-variant.c @@ -16,9 +16,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include -#include #include +#include /* Internal UST API: ust-variant.h */ #include