From: Michael Jeanson Date: Wed, 17 Mar 2021 19:19:37 +0000 (-0400) Subject: Namespace lttng/bug.h as lttng/ust-bug.h X-Git-Tag: v2.13.0-rc1~251 X-Git-Url: http://git.lttng.org/?a=commitdiff_plain;h=73f94b3ce6a9531a7c4d8b178b417fa58da35d66;p=lttng-ust.git Namespace lttng/bug.h as lttng/ust-bug.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: I08e853d9edcce218a9bd57717316a557f49200d7 Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- diff --git a/include/Makefile.am b/include/Makefile.am index 420ce3db..a113bf13 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -23,7 +23,7 @@ nobase_include_HEADERS = \ lttng/ust-endian.h \ lttng/ringbuffer-context.h \ lttng/align.h \ - lttng/bug.h \ + lttng/ust-bug.h \ lttng/ust-error.h \ lttng/tracef.h \ lttng/lttng-ust-tracef.h \ diff --git a/include/lttng/align.h b/include/lttng/align.h index 6384a00a..fbe87f19 100644 --- a/include/lttng/align.h +++ b/include/lttng/align.h @@ -7,7 +7,7 @@ #ifndef _LTTNG_ALIGN_H #define _LTTNG_ALIGN_H -#include +#include /** * lttng_ust_offset_align - Calculate the offset needed to align an object on diff --git a/include/lttng/bug.h b/include/lttng/bug.h deleted file mode 100644 index c1a7c793..00000000 --- a/include/lttng/bug.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * SPDX-License-Identifier: MIT - * - * Copyright (C) 2010-2011 Mathieu Desnoyers - */ - -#ifndef _LTTNG_BUG_H -#define _LTTNG_BUG_H - -#include -#include -#include - -#define LTTNG_BUG_ON(condition) \ - do { \ - if (caa_unlikely(condition)) { \ - fprintf(stderr, \ - "LTTng BUG in file %s, line %d.\n", \ - __FILE__, __LINE__); \ - exit(EXIT_FAILURE); \ - } \ - } while (0) - -#define LTTNG_BUILD_BUG_ON(condition) \ - ((void) sizeof(char[-!!(condition)])) - -/** - * LTTNG_BUILD_RUNTIME_BUG_ON - check condition at build (if constant) or runtime - * @condition: the condition which should be false. - * - * If the condition is a constant and true, the compiler will generate a build - * error. If the condition is not constant, a BUG will be triggered at runtime - * if the condition is ever true. If the condition is constant and false, no - * code is emitted. - */ -#define LTTNG_BUILD_RUNTIME_BUG_ON(condition) \ - do { \ - if (__builtin_constant_p(condition)) \ - LTTNG_BUILD_BUG_ON(condition); \ - else \ - LTTNG_BUG_ON(condition); \ - } while (0) - -#endif diff --git a/include/lttng/ust-bug.h b/include/lttng/ust-bug.h new file mode 100644 index 00000000..0b388c14 --- /dev/null +++ b/include/lttng/ust-bug.h @@ -0,0 +1,44 @@ +/* + * SPDX-License-Identifier: MIT + * + * Copyright (C) 2010-2011 Mathieu Desnoyers + */ + +#ifndef _LTTNG_UST_BUG_H +#define _LTTNG_UST_BUG_H + +#include +#include +#include + +#define LTTNG_BUG_ON(condition) \ + do { \ + if (caa_unlikely(condition)) { \ + fprintf(stderr, \ + "LTTng BUG in file %s, line %d.\n", \ + __FILE__, __LINE__); \ + exit(EXIT_FAILURE); \ + } \ + } while (0) + +#define LTTNG_BUILD_BUG_ON(condition) \ + ((void) sizeof(char[-!!(condition)])) + +/** + * LTTNG_BUILD_RUNTIME_BUG_ON - check condition at build (if constant) or runtime + * @condition: the condition which should be false. + * + * If the condition is a constant and true, the compiler will generate a build + * error. If the condition is not constant, a BUG will be triggered at runtime + * if the condition is ever true. If the condition is constant and false, no + * code is emitted. + */ +#define LTTNG_BUILD_RUNTIME_BUG_ON(condition) \ + do { \ + if (__builtin_constant_p(condition)) \ + LTTNG_BUILD_BUG_ON(condition); \ + else \ + LTTNG_BUG_ON(condition); \ + } while (0) + +#endif diff --git a/liblttng-ust/lttng-tracer-core.h b/liblttng-ust/lttng-tracer-core.h index 2ab8bc7c..a292dae5 100644 --- a/liblttng-ust/lttng-tracer-core.h +++ b/liblttng-ust/lttng-tracer-core.h @@ -13,7 +13,6 @@ #include #include #include -#include #include #include