Move private headers out of 'lttng/' public header dir
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 23 Feb 2021 21:57:55 +0000 (16:57 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 2 Mar 2021 16:22:01 +0000 (11:22 -0500)
The 'include/lttng' directory contains a mix of public and private
headers. Move the private header files out of this directory to reduce
confusion.

Change-Id: I48c3c4c0e724b4a7665777b95bd9a18efdb6a03a
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
32 files changed:
include/Makefile.am
include/lttng/bitfield.h [deleted file]
include/lttng/ust-context-provider.h [deleted file]
include/lttng/ust-dlfcn.h [deleted file]
include/lttng/ust-dynamic-type.h [deleted file]
include/lttng/ust-tid.h [deleted file]
include/ust-bitfield.h [new file with mode: 0644]
include/ust-context-provider.h [new file with mode: 0644]
include/ust-dlfcn.h [new file with mode: 0644]
include/ust-dynamic-type.h [new file with mode: 0644]
include/ust-tid.h [new file with mode: 0644]
include/usterr-signal-safe.h
liblttng-ust-comm/lttng-ust-comm.c
liblttng-ust-dl/lttng-ust-dl.c
liblttng-ust-fork/ustfork.c
liblttng-ust-java-agent/jni/common/lttng_ust_context.c
liblttng-ust-libc-wrapper/lttng-ust-malloc.c
liblttng-ust-libc-wrapper/lttng-ust-pthread.c
liblttng-ust/lttng-bytecode.h
liblttng-ust/lttng-context-cgroup-ns.c
liblttng-ust/lttng-context-ipc-ns.c
liblttng-ust/lttng-context-net-ns.c
liblttng-ust/lttng-context-provider.c
liblttng-ust/lttng-context-time-ns.c
liblttng-ust/lttng-context-uts-ns.c
liblttng-ust/lttng-context-vtid.c
liblttng-ust/lttng-context.c
liblttng-ust/lttng-events.c
liblttng-ust/lttng-ring-buffer-client.h
liblttng-ust/lttng-ring-buffer-metadata-client.h
liblttng-ust/lttng-ust-dynamic-type.c
tests/compile/test-app-ctx/hello.c

index 6af48ae0128bfeb3533f099208b1cacaf8690e69..4a9e6d39aafec8162caba3c7888ee065b67cd31f 100644 (file)
@@ -1,5 +1,9 @@
 # SPDX-License-Identifier: LGPL-2.1-only
 
+###                    ###
+### Public API headers ###
+###                    ###
+
 nobase_include_HEADERS = \
        lttng/tracepoint.h \
        lttng/tracepoint-rcu.h \
@@ -35,6 +39,16 @@ nobase_include_HEADERS = \
        lttng/urcu/static/pointer.h \
        lttng/urcu/static/urcu-ust.h
 
+# Auto-generated by configure.
+nobase_nodist_include_HEADERS = \
+       lttng/ust-config.h \
+       lttng/ust-version.h
+
+
+###                        ###
+### Global private headers ###
+###                        ###
+
 # note: usterr-signal-safe.h, core.h and share.h need namespace cleanup.
 
 noinst_HEADERS = \
@@ -42,16 +56,11 @@ noinst_HEADERS = \
        ust_snprintf.h \
        ust-comm.h \
        ust-fd.h \
-       lttng/ust-tid.h \
-       lttng/bitfield.h \
-       lttng/ust-dlfcn.h \
-       lttng/ust-dynamic-type.h \
-       lttng/ust-context-provider.h \
+       ust-tid.h \
+       ust-bitfield.h \
+       ust-dlfcn.h \
+       ust-dynamic-type.h \
+       ust-context-provider.h \
        helper.h \
        share.h
 
-# Auto-generated by configure.
-
-nobase_nodist_include_HEADERS = \
-       lttng/ust-config.h \
-       lttng/ust-version.h
diff --git a/include/lttng/bitfield.h b/include/lttng/bitfield.h
deleted file mode 100644 (file)
index e628af3..0000000
+++ /dev/null
@@ -1,542 +0,0 @@
-/*
- * SPDX-License-Identifier: MIT
- *
- * Copyright (C) 2010-2019 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- */
-
-#ifndef _BABELTRACE_BITFIELD_H
-#define _BABELTRACE_BITFIELD_H
-
-#include <stdint.h>    /* C99 5.2.4.2 Numerical limits */
-#include <limits.h>    /* C99 5.2.4.2 Numerical limits */
-#include <stdbool.h>   /* C99 7.16 bool type */
-#include <lttng/ust-endian.h>  /* Non-standard BIG_ENDIAN, LITTLE_ENDIAN, BYTE_ORDER */
-
-/*
- * This header strictly follows the C99 standard, except for use of the
- * compiler-specific __typeof__.
- */
-
-/*
- * This bitfield header requires the compiler representation of signed
- * integers to be two's complement.
- */
-#if (-1 != ~0)
-#error "bitfield.h requires the compiler representation of signed integers to be two's complement."
-#endif
-
-/*
- * _bt_is_signed_type() willingly generates comparison of unsigned
- * expression < 0, which is always false. Silence compiler warnings.
- * GCC versions lower than 4.6.0 do not accept diagnostic pragma inside
- * functions.
- */
-#if defined (__GNUC__) && (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600
-# define _BT_DIAG_PUSH                 _Pragma("GCC diagnostic push")
-# define _BT_DIAG_POP                  _Pragma("GCC diagnostic pop")
-
-# define _BT_DIAG_STRINGIFY_1(x)       #x
-# define _BT_DIAG_STRINGIFY(x)         _BT_DIAG_STRINGIFY_1(x)
-
-# define _BT_DIAG_IGNORE(option)       \
-       _Pragma(_BT_DIAG_STRINGIFY(GCC diagnostic ignored option))
-# define _BT_DIAG_IGNORE_TYPE_LIMITS   _BT_DIAG_IGNORE("-Wtype-limits")
-#else
-# define _BT_DIAG_PUSH
-# define _BT_DIAG_POP
-# define _BT_DIAG_IGNORE
-# define _BT_DIAG_IGNORE_TYPE_LIMITS
-#endif
-
-#define _bt_is_signed_type(type)       ((type) -1 < (type) 0)
-
-/*
- * Produce a build-time error if the condition `cond` is non-zero.
- * Evaluates as a size_t expression.
- */
-#ifdef __cplusplus
-#define _BT_BUILD_ASSERT(cond) ([]{static_assert((cond), "");}, 0)
-#else
-#define _BT_BUILD_ASSERT(cond)                                 \
-       sizeof(struct { int f:(2 * !!(cond) - 1); })
-#endif
-
-/*
- * Cast value `v` to an unsigned integer of the same size as `v`.
- */
-#define _bt_cast_value_to_unsigned(v)                                  \
-       (sizeof(v) == sizeof(uint8_t) ? (uint8_t) (v) :                 \
-       sizeof(v) == sizeof(uint16_t) ? (uint16_t) (v) :                \
-       sizeof(v) == sizeof(uint32_t) ? (uint32_t) (v) :                \
-       sizeof(v) == sizeof(uint64_t) ? (uint64_t) (v) :                \
-       _BT_BUILD_ASSERT(sizeof(v) <= sizeof(uint64_t)))
-
-/*
- * Cast value `v` to an unsigned integer type of the size of type `type`
- * *without* sign-extension.
- *
- * The unsigned cast ensures that we're not shifting a negative value,
- * which is undefined in C. However, this limits the maximum type size
- * of `type` to 64-bit. Generate a compile-time error if the size of
- * `type` is larger than 64-bit.
- */
-#define _bt_cast_value_to_unsigned_type(type, v)                       \
-       (sizeof(type) == sizeof(uint8_t) ?                              \
-               (uint8_t) _bt_cast_value_to_unsigned(v) :               \
-       sizeof(type) == sizeof(uint16_t) ?                              \
-               (uint16_t) _bt_cast_value_to_unsigned(v) :              \
-       sizeof(type) == sizeof(uint32_t) ?                              \
-               (uint32_t) _bt_cast_value_to_unsigned(v) :              \
-       sizeof(type) == sizeof(uint64_t) ?                              \
-               (uint64_t) _bt_cast_value_to_unsigned(v) :              \
-       _BT_BUILD_ASSERT(sizeof(v) <= sizeof(uint64_t)))
-
-/*
- * _bt_fill_mask evaluates to a "type" integer with all bits set.
- */
-#define _bt_fill_mask(type)    ((type) ~(type) 0)
-
-/*
- * Left shift a value `v` of `shift` bits.
- *
- * The type of `v` can be signed or unsigned integer.
- * The value of `shift` must be less than the size of `v` (in bits),
- * otherwise the behavior is undefined.
- * Evaluates to the result of the shift operation.
- *
- * According to the C99 standard, left shift of a left hand-side signed
- * type is undefined if it has a negative value or if the result cannot
- * be represented in the result type. This bitfield header discards the
- * bits that are left-shifted beyond the result type representation,
- * which is the behavior of an unsigned type left shift operation.
- * Therefore, always perform left shift on an unsigned type.
- *
- * This macro should not be used if `shift` can be greater or equal than
- * the bitwidth of `v`. See `_bt_safe_lshift`.
- */
-#define _bt_lshift(v, shift)                                           \
-       ((__typeof__(v)) (_bt_cast_value_to_unsigned(v) << (shift)))
-
-/*
- * Generate a mask of type `type` with the `length` least significant bits
- * cleared, and the most significant bits set.
- */
-#define _bt_make_mask_complement(type, length)                         \
-       _bt_lshift(_bt_fill_mask(type), length)
-
-/*
- * Generate a mask of type `type` with the `length` least significant bits
- * set, and the most significant bits cleared.
- */
-#define _bt_make_mask(type, length)                                    \
-       ((type) ~_bt_make_mask_complement(type, length))
-
-/*
- * Right shift a value `v` of `shift` bits.
- *
- * The type of `v` can be signed or unsigned integer.
- * The value of `shift` must be less than the size of `v` (in bits),
- * otherwise the behavior is undefined.
- * Evaluates to the result of the shift operation.
- *
- * According to the C99 standard, right shift of a left hand-side signed
- * type which has a negative value is implementation defined. This
- * bitfield header relies on the right shift implementation carrying the
- * sign bit. If the compiler implementation has a different behavior,
- * emulate carrying the sign bit.
- *
- * This macro should not be used if `shift` can be greater or equal than
- * the bitwidth of `v`. See `_bt_safe_rshift`.
- */
-#if ((-1 >> 1) == -1)
-#define _bt_rshift(v, shift)   ((v) >> (shift))
-#else
-#define _bt_rshift(v, shift)                                           \
-       ((__typeof__(v)) ((_bt_cast_value_to_unsigned(v) >> (shift)) |  \
-               ((v) < 0 ? _bt_make_mask_complement(__typeof__(v),      \
-                       sizeof(v) * CHAR_BIT - (shift)) : 0)))
-#endif
-
-/*
- * Right shift a signed or unsigned integer with `shift` value being an
- * arbitrary number of bits. `v` is modified by this macro. The shift
- * is transformed into a sequence of `_nr_partial_shifts` consecutive
- * shift operations, each of a number of bits smaller than the bitwidth
- * of `v`, ending with a shift of the number of left over bits.
- */
-#define _bt_safe_rshift(v, shift)                                      \
-do {                                                                   \
-       unsigned long _nr_partial_shifts = (shift) / (sizeof(v) * CHAR_BIT - 1); \
-       unsigned long _leftover_bits = (shift) % (sizeof(v) * CHAR_BIT - 1); \
-                                                                       \
-       for (; _nr_partial_shifts; _nr_partial_shifts--)                \
-               (v) = _bt_rshift(v, sizeof(v) * CHAR_BIT - 1);          \
-       (v) = _bt_rshift(v, _leftover_bits);                            \
-} while (0)
-
-/*
- * Left shift a signed or unsigned integer with `shift` value being an
- * arbitrary number of bits. `v` is modified by this macro. The shift
- * is transformed into a sequence of `_nr_partial_shifts` consecutive
- * shift operations, each of a number of bits smaller than the bitwidth
- * of `v`, ending with a shift of the number of left over bits.
- */
-#define _bt_safe_lshift(v, shift)                                      \
-do {                                                                   \
-       unsigned long _nr_partial_shifts = (shift) / (sizeof(v) * CHAR_BIT - 1); \
-       unsigned long _leftover_bits = (shift) % (sizeof(v) * CHAR_BIT - 1); \
-                                                                       \
-       for (; _nr_partial_shifts; _nr_partial_shifts--)                \
-               (v) = _bt_lshift(v, sizeof(v) * CHAR_BIT - 1);          \
-       (v) = _bt_lshift(v, _leftover_bits);                            \
-} while (0)
-
-/*
- * bt_bitfield_write - write integer to a bitfield in native endianness
- *
- * Save integer to the bitfield, which starts at the "start" bit, has "len"
- * bits.
- * The inside of a bitfield is from high bits to low bits.
- * Uses native endianness.
- * For unsigned "v", pad MSB with 0 if bitfield is larger than v.
- * For signed "v", sign-extend v if bitfield is larger than v.
- *
- * On little endian, bytes are placed from the less significant to the most
- * significant. Also, consecutive bitfields are placed from lower bits to higher
- * bits.
- *
- * On big endian, bytes are places from most significant to less significant.
- * Also, consecutive bitfields are placed from higher to lower bits.
- */
-
-#define _bt_bitfield_write_le(ptr, type, start, length, v)             \
-do {                                                                   \
-       __typeof__(v) _v = (v);                                 \
-       type *_ptr = (void *) (ptr);                                    \
-       unsigned long _start = (start), _length = (length);             \
-       type _mask, _cmask;                                             \
-       unsigned long _ts = sizeof(type) * CHAR_BIT; /* type size */    \
-       unsigned long _start_unit, _end_unit, _this_unit;               \
-       unsigned long _end, _cshift; /* _cshift is "complement shift" */ \
-                                                                       \
-       if (!_length)                                                   \
-               break;                                                  \
-                                                                       \
-       _end = _start + _length;                                        \
-       _start_unit = _start / _ts;                                     \
-       _end_unit = (_end + (_ts - 1)) / _ts;                           \
-                                                                       \
-       /* Trim v high bits */                                          \
-       if (_length < sizeof(_v) * CHAR_BIT)                            \
-               _v &= _bt_make_mask(__typeof__(_v), _length);           \
-                                                                       \
-       /* We can now append v with a simple "or", shift it piece-wise */ \
-       _this_unit = _start_unit;                                       \
-       if (_start_unit == _end_unit - 1) {                             \
-               _mask = _bt_make_mask(type, _start % _ts);              \
-               if (_end % _ts)                                         \
-                       _mask |= _bt_make_mask_complement(type, _end % _ts); \
-               _cmask = _bt_lshift((type) (_v), _start % _ts);         \
-               _cmask &= ~_mask;                                       \
-               _ptr[_this_unit] &= _mask;                              \
-               _ptr[_this_unit] |= _cmask;                             \
-               break;                                                  \
-       }                                                               \
-       if (_start % _ts) {                                             \
-               _cshift = _start % _ts;                                 \
-               _mask = _bt_make_mask(type, _cshift);                   \
-               _cmask = _bt_lshift((type) (_v), _cshift);              \
-               _cmask &= ~_mask;                                       \
-               _ptr[_this_unit] &= _mask;                              \
-               _ptr[_this_unit] |= _cmask;                             \
-               _bt_safe_rshift(_v, _ts - _cshift);                     \
-               _start += _ts - _cshift;                                \
-               _this_unit++;                                           \
-       }                                                               \
-       for (; _this_unit < _end_unit - 1; _this_unit++) {              \
-               _ptr[_this_unit] = (type) _v;                           \
-               _bt_safe_rshift(_v, _ts);                               \
-               _start += _ts;                                          \
-       }                                                               \
-       if (_end % _ts) {                                               \
-               _mask = _bt_make_mask_complement(type, _end % _ts);     \
-               _cmask = (type) _v;                                     \
-               _cmask &= ~_mask;                                       \
-               _ptr[_this_unit] &= _mask;                              \
-               _ptr[_this_unit] |= _cmask;                             \
-       } else                                                          \
-               _ptr[_this_unit] = (type) _v;                           \
-} while (0)
-
-#define _bt_bitfield_write_be(ptr, type, start, length, v)             \
-do {                                                                   \
-       __typeof__(v) _v = (v);                                         \
-       type *_ptr = (void *) (ptr);                                    \
-       unsigned long _start = (start), _length = (length);             \
-       type _mask, _cmask;                                             \
-       unsigned long _ts = sizeof(type) * CHAR_BIT; /* type size */    \
-       unsigned long _start_unit, _end_unit, _this_unit;               \
-       unsigned long _end, _cshift; /* _cshift is "complement shift" */ \
-                                                                       \
-       if (!_length)                                                   \
-               break;                                                  \
-                                                                       \
-       _end = _start + _length;                                        \
-       _start_unit = _start / _ts;                                     \
-       _end_unit = (_end + (_ts - 1)) / _ts;                           \
-                                                                       \
-       /* Trim v high bits */                                          \
-       if (_length < sizeof(_v) * CHAR_BIT)                            \
-               _v &= _bt_make_mask(__typeof__(_v), _length);           \
-                                                                       \
-       /* We can now append v with a simple "or", shift it piece-wise */ \
-       _this_unit = _end_unit - 1;                                     \
-       if (_start_unit == _end_unit - 1) {                             \
-               _mask = _bt_make_mask(type, (_ts - (_end % _ts)) % _ts); \
-               if (_start % _ts)                                       \
-                       _mask |= _bt_make_mask_complement(type, _ts - (_start % _ts)); \
-               _cmask = _bt_lshift((type) (_v), (_ts - (_end % _ts)) % _ts); \
-               _cmask &= ~_mask;                                       \
-               _ptr[_this_unit] &= _mask;                              \
-               _ptr[_this_unit] |= _cmask;                             \
-               break;                                                  \
-       }                                                               \
-       if (_end % _ts) {                                               \
-               _cshift = _end % _ts;                                   \
-               _mask = _bt_make_mask(type, _ts - _cshift);             \
-               _cmask = _bt_lshift((type) (_v), _ts - _cshift);        \
-               _cmask &= ~_mask;                                       \
-               _ptr[_this_unit] &= _mask;                              \
-               _ptr[_this_unit] |= _cmask;                             \
-               _bt_safe_rshift(_v, _cshift);                           \
-               _end -= _cshift;                                        \
-               _this_unit--;                                           \
-       }                                                               \
-       for (; (long) _this_unit >= (long) _start_unit + 1; _this_unit--) { \
-               _ptr[_this_unit] = (type) _v;                           \
-               _bt_safe_rshift(_v, _ts);                               \
-               _end -= _ts;                                            \
-       }                                                               \
-       if (_start % _ts) {                                             \
-               _mask = _bt_make_mask_complement(type, _ts - (_start % _ts)); \
-               _cmask = (type) _v;                                     \
-               _cmask &= ~_mask;                                       \
-               _ptr[_this_unit] &= _mask;                              \
-               _ptr[_this_unit] |= _cmask;                             \
-       } else                                                          \
-               _ptr[_this_unit] = (type) _v;                           \
-} while (0)
-
-/*
- * bt_bitfield_write - write integer to a bitfield in native endianness
- * bt_bitfield_write_le - write integer to a bitfield in little endian
- * bt_bitfield_write_be - write integer to a bitfield in big endian
- */
-
-#if (BYTE_ORDER == LITTLE_ENDIAN)
-
-#define bt_bitfield_write(ptr, type, start, length, v)                 \
-       _bt_bitfield_write_le(ptr, type, start, length, v)
-
-#define bt_bitfield_write_le(ptr, type, start, length, v)              \
-       _bt_bitfield_write_le(ptr, type, start, length, v)
-
-#define bt_bitfield_write_be(ptr, type, start, length, v)              \
-       _bt_bitfield_write_be(ptr, unsigned char, start, length, v)
-
-#elif (BYTE_ORDER == BIG_ENDIAN)
-
-#define bt_bitfield_write(ptr, type, start, length, v)                 \
-       _bt_bitfield_write_be(ptr, type, start, length, v)
-
-#define bt_bitfield_write_le(ptr, type, start, length, v)              \
-       _bt_bitfield_write_le(ptr, unsigned char, start, length, v)
-
-#define bt_bitfield_write_be(ptr, type, start, length, v)              \
-       _bt_bitfield_write_be(ptr, type, start, length, v)
-
-#else /* (BYTE_ORDER == PDP_ENDIAN) */
-
-#error "Byte order not supported"
-
-#endif
-
-#define _bt_bitfield_read_le(ptr, type, start, length, vptr)           \
-do {                                                                   \
-       __typeof__(*(vptr)) *_vptr = (vptr);                            \
-       __typeof__(*_vptr) _v;                                          \
-       type *_ptr = (type *) (ptr);                                    \
-       unsigned long _start = (start), _length = (length);             \
-       type _mask, _cmask;                                             \
-       unsigned long _ts = sizeof(type) * CHAR_BIT; /* type size */    \
-       unsigned long _start_unit, _end_unit, _this_unit;               \
-       unsigned long _end, _cshift; /* _cshift is "complement shift" */ \
-       bool _is_signed_type;                                           \
-                                                                       \
-       if (!_length) {                                                 \
-               *_vptr = 0;                                             \
-               break;                                                  \
-       }                                                               \
-                                                                       \
-       _end = _start + _length;                                        \
-       _start_unit = _start / _ts;                                     \
-       _end_unit = (_end + (_ts - 1)) / _ts;                           \
-                                                                       \
-       _this_unit = _end_unit - 1;                                     \
-       _BT_DIAG_PUSH                                                   \
-       _BT_DIAG_IGNORE_TYPE_LIMITS                                     \
-       _is_signed_type = _bt_is_signed_type(__typeof__(_v));           \
-       _BT_DIAG_POP                                                    \
-       if (_is_signed_type                                             \
-           && (_ptr[_this_unit] & _bt_lshift((type) 1, (_end % _ts ? _end % _ts : _ts) - 1))) \
-               _v = ~(__typeof__(_v)) 0;                               \
-       else                                                            \
-               _v = 0;                                                 \
-       if (_start_unit == _end_unit - 1) {                             \
-               _cmask = _ptr[_this_unit];                              \
-               _cmask = _bt_rshift(_cmask, _start % _ts);              \
-               if ((_end - _start) % _ts) {                            \
-                       _mask = _bt_make_mask(type, _end - _start);     \
-                       _cmask &= _mask;                                \
-               }                                                       \
-               _bt_safe_lshift(_v, _end - _start);                     \
-               _v |= _bt_cast_value_to_unsigned_type(__typeof__(_v), _cmask); \
-               *_vptr = _v;                                            \
-               break;                                                  \
-       }                                                               \
-       if (_end % _ts) {                                               \
-               _cshift = _end % _ts;                                   \
-               _mask = _bt_make_mask(type, _cshift);                   \
-               _cmask = _ptr[_this_unit];                              \
-               _cmask &= _mask;                                        \
-               _bt_safe_lshift(_v, _cshift);                           \
-               _v |= _bt_cast_value_to_unsigned_type(__typeof__(_v), _cmask); \
-               _end -= _cshift;                                        \
-               _this_unit--;                                           \
-       }                                                               \
-       for (; (long) _this_unit >= (long) _start_unit + 1; _this_unit--) { \
-               _bt_safe_lshift(_v, _ts);                               \
-               _v |= _bt_cast_value_to_unsigned_type(__typeof__(_v), _ptr[_this_unit]); \
-               _end -= _ts;                                            \
-       }                                                               \
-       if (_start % _ts) {                                             \
-               _mask = _bt_make_mask(type, _ts - (_start % _ts));      \
-               _cmask = _ptr[_this_unit];                              \
-               _cmask = _bt_rshift(_cmask, _start % _ts);              \
-               _cmask &= _mask;                                        \
-               _bt_safe_lshift(_v, _ts - (_start % _ts));              \
-               _v |= _bt_cast_value_to_unsigned_type(__typeof__(_v), _cmask); \
-       } else {                                                        \
-               _bt_safe_lshift(_v, _ts);                               \
-               _v |= _bt_cast_value_to_unsigned_type(__typeof__(_v), _ptr[_this_unit]); \
-       }                                                               \
-       *_vptr = _v;                                                    \
-} while (0)
-
-#define _bt_bitfield_read_be(ptr, type, start, length, vptr)           \
-do {                                                                   \
-       __typeof__(*(vptr)) *_vptr = (vptr);                            \
-       __typeof__(*_vptr) _v;                                          \
-       type *_ptr = (void *) (ptr);                                    \
-       unsigned long _start = (start), _length = (length);             \
-       type _mask, _cmask;                                             \
-       unsigned long _ts = sizeof(type) * CHAR_BIT; /* type size */    \
-       unsigned long _start_unit, _end_unit, _this_unit;               \
-       unsigned long _end, _cshift; /* _cshift is "complement shift" */ \
-       bool _is_signed_type;                                           \
-                                                                       \
-       if (!_length) {                                                 \
-               *_vptr = 0;                                             \
-               break;                                                  \
-       }                                                               \
-                                                                       \
-       _end = _start + _length;                                        \
-       _start_unit = _start / _ts;                                     \
-       _end_unit = (_end + (_ts - 1)) / _ts;                           \
-                                                                       \
-       _this_unit = _start_unit;                                       \
-       _BT_DIAG_PUSH                                                   \
-       _BT_DIAG_IGNORE_TYPE_LIMITS                                     \
-       _is_signed_type = _bt_is_signed_type(__typeof__(_v));           \
-       _BT_DIAG_POP                                                    \
-       if (_is_signed_type                                             \
-           && (_ptr[_this_unit] & _bt_lshift((type) 1, _ts - (_start % _ts) - 1))) \
-               _v = ~(__typeof__(_v)) 0;                               \
-       else                                                            \
-               _v = 0;                                                 \
-       if (_start_unit == _end_unit - 1) {                             \
-               _cmask = _ptr[_this_unit];                              \
-               _cmask = _bt_rshift(_cmask, (_ts - (_end % _ts)) % _ts); \
-               if ((_end - _start) % _ts) {                            \
-                       _mask = _bt_make_mask(type, _end - _start);     \
-                       _cmask &= _mask;                                \
-               }                                                       \
-               _bt_safe_lshift(_v, _end - _start);                     \
-               _v |= _bt_cast_value_to_unsigned_type(__typeof__(_v), _cmask); \
-               *_vptr = _v;                                            \
-               break;                                                  \
-       }                                                               \
-       if (_start % _ts) {                                             \
-               _cshift = _start % _ts;                                 \
-               _mask = _bt_make_mask(type, _ts - _cshift);             \
-               _cmask = _ptr[_this_unit];                              \
-               _cmask &= _mask;                                        \
-               _bt_safe_lshift(_v, _ts - _cshift);                     \
-               _v |= _bt_cast_value_to_unsigned_type(__typeof__(_v), _cmask); \
-               _start += _ts - _cshift;                                \
-               _this_unit++;                                           \
-       }                                                               \
-       for (; _this_unit < _end_unit - 1; _this_unit++) {              \
-               _bt_safe_lshift(_v, _ts);                               \
-               _v |= _bt_cast_value_to_unsigned_type(__typeof__(_v), _ptr[_this_unit]); \
-               _start += _ts;                                          \
-       }                                                               \
-       if (_end % _ts) {                                               \
-               _mask = _bt_make_mask(type, _end % _ts);                \
-               _cmask = _ptr[_this_unit];                              \
-               _cmask = _bt_rshift(_cmask, _ts - (_end % _ts));        \
-               _cmask &= _mask;                                        \
-               _bt_safe_lshift(_v, _end % _ts);                        \
-               _v |= _bt_cast_value_to_unsigned_type(__typeof__(_v), _cmask); \
-       } else {                                                        \
-               _bt_safe_lshift(_v, _ts);                               \
-               _v |= _bt_cast_value_to_unsigned_type(__typeof__(_v), _ptr[_this_unit]); \
-       }                                                               \
-       *_vptr = _v;                                                    \
-} while (0)
-
-/*
- * bt_bitfield_read - read integer from a bitfield in native endianness
- * bt_bitfield_read_le - read integer from a bitfield in little endian
- * bt_bitfield_read_be - read integer from a bitfield in big endian
- */
-
-#if (BYTE_ORDER == LITTLE_ENDIAN)
-
-#define bt_bitfield_read(ptr, type, start, length, vptr)               \
-       _bt_bitfield_read_le(ptr, type, start, length, vptr)
-
-#define bt_bitfield_read_le(ptr, type, start, length, vptr)            \
-       _bt_bitfield_read_le(ptr, type, start, length, vptr)
-
-#define bt_bitfield_read_be(ptr, type, start, length, vptr)            \
-       _bt_bitfield_read_be(ptr, unsigned char, start, length, vptr)
-
-#elif (BYTE_ORDER == BIG_ENDIAN)
-
-#define bt_bitfield_read(ptr, type, start, length, vptr)               \
-       _bt_bitfield_read_be(ptr, type, start, length, vptr)
-
-#define bt_bitfield_read_le(ptr, type, start, length, vptr)            \
-       _bt_bitfield_read_le(ptr, unsigned char, start, length, vptr)
-
-#define bt_bitfield_read_be(ptr, type, start, length, vptr)            \
-       _bt_bitfield_read_be(ptr, type, start, length, vptr)
-
-#else /* (BYTE_ORDER == PDP_ENDIAN) */
-
-#error "Byte order not supported"
-
-#endif
-
-#endif /* _BABELTRACE_BITFIELD_H */
diff --git a/include/lttng/ust-context-provider.h b/include/lttng/ust-context-provider.h
deleted file mode 100644 (file)
index 332f914..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * SPDX-License-Identifier: MIT
- *
- * Copyright (C) 2016 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- */
-
-#ifndef _LTTNG_UST_CONTEXT_PROVIDER_H
-#define _LTTNG_UST_CONTEXT_PROVIDER_H
-
-#include <stddef.h>
-#include <lttng/ust-events.h>
-#include <urcu/hlist.h>
-
-struct lttng_ust_context_provider {
-       char *name;
-       size_t (*get_size)(struct lttng_ctx_field *field, size_t offset);
-       void (*record)(struct lttng_ctx_field *field,
-                      struct lttng_ust_lib_ring_buffer_ctx *ctx,
-                      struct lttng_channel *chan);
-       void (*get_value)(struct lttng_ctx_field *field,
-                        struct lttng_ctx_value *value);
-       struct cds_hlist_node node;
-};
-
-int lttng_ust_context_provider_register(struct lttng_ust_context_provider *provider);
-void lttng_ust_context_provider_unregister(struct lttng_ust_context_provider *provider);
-
-int lttng_context_is_app(const char *name);
-
-void lttng_ust_context_set_session_provider(const char *name,
-               size_t (*get_size)(struct lttng_ctx_field *field, size_t offset),
-               void (*record)(struct lttng_ctx_field *field,
-                       struct lttng_ust_lib_ring_buffer_ctx *ctx,
-                       struct lttng_channel *chan),
-               void (*get_value)(struct lttng_ctx_field *field,
-                       struct lttng_ctx_value *value));
-
-int lttng_ust_add_app_context_to_ctx_rcu(const char *name, struct lttng_ctx **ctx);
-int lttng_ust_context_set_provider_rcu(struct lttng_ctx **_ctx,
-               const char *name,
-               size_t (*get_size)(struct lttng_ctx_field *field, size_t offset),
-               void (*record)(struct lttng_ctx_field *field,
-                       struct lttng_ust_lib_ring_buffer_ctx *ctx,
-                       struct lttng_channel *chan),
-               void (*get_value)(struct lttng_ctx_field *field,
-                       struct lttng_ctx_value *value));
-int lttng_context_add_rcu(struct lttng_ctx **ctx_p,
-               const struct lttng_ctx_field *f);
-
-#endif /* _LTTNG_UST_CONTEXT_PROVIDER_H */
diff --git a/include/lttng/ust-dlfcn.h b/include/lttng/ust-dlfcn.h
deleted file mode 100644 (file)
index 2a76fe5..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * SPDX-License-Identifier: MIT
- *
- * Copyright (C) 2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- *
- * dlfcn.h compatibility layer.
- */
-
-#ifndef _LTTNG_UST_DLFCN_H
-#define _LTTNG_UST_DLFCN_H
-
-#ifdef _DLFCN_H
-#error "Please include lttng/ust-dlfcn.h before dlfcn.h."
-#endif /* _DLFCN_H */
-
-#ifdef __GLIBC__
-/*
- * glibc declares dlsym() and dlerror() with __attribute__((leaf)) (see
- * THROW annotation). Unfortunately, this is not in sync with reality,
- * as those functions call the memory allocator. Work-around this glibc
- * bug by declaring our own symbols.
- *
- * There has been a similar issue for dlopen() and dlclose(), as
- * constructors and destructors are called from these functions, so they
- * are clearly non-leaf. Work-around the issue for those too for older
- * glibc where these have not been fixed.
- */
-#define dlopen glibc_dlopen_proto_lies_about_leafness
-#define dlclose glibc_dlclose_proto_lies_about_leafness
-#define dlsym glibc_dlsym_proto_lies_about_leafness
-#define dlerror glibc_dlerror_proto_lies_about_leafness
-#define dlmopen glibc_dlmopen_proto_lies_about_leafness
-#define dlvsym glibc_dlvsym_proto_lies_about_leafness
-#include <dlfcn.h>
-#undef dlvsym
-#undef dlmopen
-#undef dlerror
-#undef dlsym
-#undef dlclose
-#undef dlopen
-
-extern void *dlopen(__const char *__file, int __mode);
-extern int dlclose(void *__handle) __nonnull ((1));
-extern void *dlsym(void *__restrict __handle,
-               __const char *__restrict __name) __nonnull ((2));
-extern char *dlerror(void);
-#ifdef __USE_GNU
-extern void *dlmopen(Lmid_t __nsid, const char *__file, int __mode);
-extern void *dlvsym(void *__restrict __handle,
-               __const char *__restrict __name,
-               __const char *__restrict __version);
-#endif
-#else
-#include <dlfcn.h>
-#endif /* __GLIBC__ */
-
-#endif /* _LTTNG_UST_DLFCN_H */
diff --git a/include/lttng/ust-dynamic-type.h b/include/lttng/ust-dynamic-type.h
deleted file mode 100644 (file)
index ac56b56..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * SPDX-License-Identifier: MIT
- *
- * Copyright (C) 2016 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- */
-
-#ifndef _LTTNG_UST_DYNAMIC_TYPE_H
-#define _LTTNG_UST_DYNAMIC_TYPE_H
-
-#include <lttng/ust-events.h>
-
-int lttng_ust_dynamic_type_choices(size_t *nr_choices,
-               const struct lttng_event_field **choices);
-const struct lttng_event_field *lttng_ust_dynamic_type_field(int64_t value);
-const struct lttng_event_field *lttng_ust_dynamic_type_tag_field(void);
-
-#endif /* _LTTNG_UST_DYNAMIC_TYPE_H */
diff --git a/include/lttng/ust-tid.h b/include/lttng/ust-tid.h
deleted file mode 100644 (file)
index eae1db9..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * SPDX-License-Identifier: MIT
- *
- * Copyright (C) 2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- *
- * gettid compatibility layer.
- */
-
-#ifndef _LTTNG_UST_TID_H
-#define _LTTNG_UST_TID_H
-
-#ifdef __linux__
-#include <sys/syscall.h>
-#endif
-
-#if defined(__NR_gettid)
-
-#include <unistd.h>
-static inline pid_t lttng_gettid(void)
-{
-       return syscall(__NR_gettid);
-}
-
-#else
-
-#include <sys/types.h>
-#include <unistd.h>
-
-/* Fall-back on getpid for tid if not available. */
-static inline pid_t lttng_gettid(void)
-{
-       return getpid();
-}
-
-#endif
-
-#endif /* _LTTNG_UST_TID_H */
diff --git a/include/ust-bitfield.h b/include/ust-bitfield.h
new file mode 100644 (file)
index 0000000..e628af3
--- /dev/null
@@ -0,0 +1,542 @@
+/*
+ * SPDX-License-Identifier: MIT
+ *
+ * Copyright (C) 2010-2019 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ */
+
+#ifndef _BABELTRACE_BITFIELD_H
+#define _BABELTRACE_BITFIELD_H
+
+#include <stdint.h>    /* C99 5.2.4.2 Numerical limits */
+#include <limits.h>    /* C99 5.2.4.2 Numerical limits */
+#include <stdbool.h>   /* C99 7.16 bool type */
+#include <lttng/ust-endian.h>  /* Non-standard BIG_ENDIAN, LITTLE_ENDIAN, BYTE_ORDER */
+
+/*
+ * This header strictly follows the C99 standard, except for use of the
+ * compiler-specific __typeof__.
+ */
+
+/*
+ * This bitfield header requires the compiler representation of signed
+ * integers to be two's complement.
+ */
+#if (-1 != ~0)
+#error "bitfield.h requires the compiler representation of signed integers to be two's complement."
+#endif
+
+/*
+ * _bt_is_signed_type() willingly generates comparison of unsigned
+ * expression < 0, which is always false. Silence compiler warnings.
+ * GCC versions lower than 4.6.0 do not accept diagnostic pragma inside
+ * functions.
+ */
+#if defined (__GNUC__) && (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600
+# define _BT_DIAG_PUSH                 _Pragma("GCC diagnostic push")
+# define _BT_DIAG_POP                  _Pragma("GCC diagnostic pop")
+
+# define _BT_DIAG_STRINGIFY_1(x)       #x
+# define _BT_DIAG_STRINGIFY(x)         _BT_DIAG_STRINGIFY_1(x)
+
+# define _BT_DIAG_IGNORE(option)       \
+       _Pragma(_BT_DIAG_STRINGIFY(GCC diagnostic ignored option))
+# define _BT_DIAG_IGNORE_TYPE_LIMITS   _BT_DIAG_IGNORE("-Wtype-limits")
+#else
+# define _BT_DIAG_PUSH
+# define _BT_DIAG_POP
+# define _BT_DIAG_IGNORE
+# define _BT_DIAG_IGNORE_TYPE_LIMITS
+#endif
+
+#define _bt_is_signed_type(type)       ((type) -1 < (type) 0)
+
+/*
+ * Produce a build-time error if the condition `cond` is non-zero.
+ * Evaluates as a size_t expression.
+ */
+#ifdef __cplusplus
+#define _BT_BUILD_ASSERT(cond) ([]{static_assert((cond), "");}, 0)
+#else
+#define _BT_BUILD_ASSERT(cond)                                 \
+       sizeof(struct { int f:(2 * !!(cond) - 1); })
+#endif
+
+/*
+ * Cast value `v` to an unsigned integer of the same size as `v`.
+ */
+#define _bt_cast_value_to_unsigned(v)                                  \
+       (sizeof(v) == sizeof(uint8_t) ? (uint8_t) (v) :                 \
+       sizeof(v) == sizeof(uint16_t) ? (uint16_t) (v) :                \
+       sizeof(v) == sizeof(uint32_t) ? (uint32_t) (v) :                \
+       sizeof(v) == sizeof(uint64_t) ? (uint64_t) (v) :                \
+       _BT_BUILD_ASSERT(sizeof(v) <= sizeof(uint64_t)))
+
+/*
+ * Cast value `v` to an unsigned integer type of the size of type `type`
+ * *without* sign-extension.
+ *
+ * The unsigned cast ensures that we're not shifting a negative value,
+ * which is undefined in C. However, this limits the maximum type size
+ * of `type` to 64-bit. Generate a compile-time error if the size of
+ * `type` is larger than 64-bit.
+ */
+#define _bt_cast_value_to_unsigned_type(type, v)                       \
+       (sizeof(type) == sizeof(uint8_t) ?                              \
+               (uint8_t) _bt_cast_value_to_unsigned(v) :               \
+       sizeof(type) == sizeof(uint16_t) ?                              \
+               (uint16_t) _bt_cast_value_to_unsigned(v) :              \
+       sizeof(type) == sizeof(uint32_t) ?                              \
+               (uint32_t) _bt_cast_value_to_unsigned(v) :              \
+       sizeof(type) == sizeof(uint64_t) ?                              \
+               (uint64_t) _bt_cast_value_to_unsigned(v) :              \
+       _BT_BUILD_ASSERT(sizeof(v) <= sizeof(uint64_t)))
+
+/*
+ * _bt_fill_mask evaluates to a "type" integer with all bits set.
+ */
+#define _bt_fill_mask(type)    ((type) ~(type) 0)
+
+/*
+ * Left shift a value `v` of `shift` bits.
+ *
+ * The type of `v` can be signed or unsigned integer.
+ * The value of `shift` must be less than the size of `v` (in bits),
+ * otherwise the behavior is undefined.
+ * Evaluates to the result of the shift operation.
+ *
+ * According to the C99 standard, left shift of a left hand-side signed
+ * type is undefined if it has a negative value or if the result cannot
+ * be represented in the result type. This bitfield header discards the
+ * bits that are left-shifted beyond the result type representation,
+ * which is the behavior of an unsigned type left shift operation.
+ * Therefore, always perform left shift on an unsigned type.
+ *
+ * This macro should not be used if `shift` can be greater or equal than
+ * the bitwidth of `v`. See `_bt_safe_lshift`.
+ */
+#define _bt_lshift(v, shift)                                           \
+       ((__typeof__(v)) (_bt_cast_value_to_unsigned(v) << (shift)))
+
+/*
+ * Generate a mask of type `type` with the `length` least significant bits
+ * cleared, and the most significant bits set.
+ */
+#define _bt_make_mask_complement(type, length)                         \
+       _bt_lshift(_bt_fill_mask(type), length)
+
+/*
+ * Generate a mask of type `type` with the `length` least significant bits
+ * set, and the most significant bits cleared.
+ */
+#define _bt_make_mask(type, length)                                    \
+       ((type) ~_bt_make_mask_complement(type, length))
+
+/*
+ * Right shift a value `v` of `shift` bits.
+ *
+ * The type of `v` can be signed or unsigned integer.
+ * The value of `shift` must be less than the size of `v` (in bits),
+ * otherwise the behavior is undefined.
+ * Evaluates to the result of the shift operation.
+ *
+ * According to the C99 standard, right shift of a left hand-side signed
+ * type which has a negative value is implementation defined. This
+ * bitfield header relies on the right shift implementation carrying the
+ * sign bit. If the compiler implementation has a different behavior,
+ * emulate carrying the sign bit.
+ *
+ * This macro should not be used if `shift` can be greater or equal than
+ * the bitwidth of `v`. See `_bt_safe_rshift`.
+ */
+#if ((-1 >> 1) == -1)
+#define _bt_rshift(v, shift)   ((v) >> (shift))
+#else
+#define _bt_rshift(v, shift)                                           \
+       ((__typeof__(v)) ((_bt_cast_value_to_unsigned(v) >> (shift)) |  \
+               ((v) < 0 ? _bt_make_mask_complement(__typeof__(v),      \
+                       sizeof(v) * CHAR_BIT - (shift)) : 0)))
+#endif
+
+/*
+ * Right shift a signed or unsigned integer with `shift` value being an
+ * arbitrary number of bits. `v` is modified by this macro. The shift
+ * is transformed into a sequence of `_nr_partial_shifts` consecutive
+ * shift operations, each of a number of bits smaller than the bitwidth
+ * of `v`, ending with a shift of the number of left over bits.
+ */
+#define _bt_safe_rshift(v, shift)                                      \
+do {                                                                   \
+       unsigned long _nr_partial_shifts = (shift) / (sizeof(v) * CHAR_BIT - 1); \
+       unsigned long _leftover_bits = (shift) % (sizeof(v) * CHAR_BIT - 1); \
+                                                                       \
+       for (; _nr_partial_shifts; _nr_partial_shifts--)                \
+               (v) = _bt_rshift(v, sizeof(v) * CHAR_BIT - 1);          \
+       (v) = _bt_rshift(v, _leftover_bits);                            \
+} while (0)
+
+/*
+ * Left shift a signed or unsigned integer with `shift` value being an
+ * arbitrary number of bits. `v` is modified by this macro. The shift
+ * is transformed into a sequence of `_nr_partial_shifts` consecutive
+ * shift operations, each of a number of bits smaller than the bitwidth
+ * of `v`, ending with a shift of the number of left over bits.
+ */
+#define _bt_safe_lshift(v, shift)                                      \
+do {                                                                   \
+       unsigned long _nr_partial_shifts = (shift) / (sizeof(v) * CHAR_BIT - 1); \
+       unsigned long _leftover_bits = (shift) % (sizeof(v) * CHAR_BIT - 1); \
+                                                                       \
+       for (; _nr_partial_shifts; _nr_partial_shifts--)                \
+               (v) = _bt_lshift(v, sizeof(v) * CHAR_BIT - 1);          \
+       (v) = _bt_lshift(v, _leftover_bits);                            \
+} while (0)
+
+/*
+ * bt_bitfield_write - write integer to a bitfield in native endianness
+ *
+ * Save integer to the bitfield, which starts at the "start" bit, has "len"
+ * bits.
+ * The inside of a bitfield is from high bits to low bits.
+ * Uses native endianness.
+ * For unsigned "v", pad MSB with 0 if bitfield is larger than v.
+ * For signed "v", sign-extend v if bitfield is larger than v.
+ *
+ * On little endian, bytes are placed from the less significant to the most
+ * significant. Also, consecutive bitfields are placed from lower bits to higher
+ * bits.
+ *
+ * On big endian, bytes are places from most significant to less significant.
+ * Also, consecutive bitfields are placed from higher to lower bits.
+ */
+
+#define _bt_bitfield_write_le(ptr, type, start, length, v)             \
+do {                                                                   \
+       __typeof__(v) _v = (v);                                 \
+       type *_ptr = (void *) (ptr);                                    \
+       unsigned long _start = (start), _length = (length);             \
+       type _mask, _cmask;                                             \
+       unsigned long _ts = sizeof(type) * CHAR_BIT; /* type size */    \
+       unsigned long _start_unit, _end_unit, _this_unit;               \
+       unsigned long _end, _cshift; /* _cshift is "complement shift" */ \
+                                                                       \
+       if (!_length)                                                   \
+               break;                                                  \
+                                                                       \
+       _end = _start + _length;                                        \
+       _start_unit = _start / _ts;                                     \
+       _end_unit = (_end + (_ts - 1)) / _ts;                           \
+                                                                       \
+       /* Trim v high bits */                                          \
+       if (_length < sizeof(_v) * CHAR_BIT)                            \
+               _v &= _bt_make_mask(__typeof__(_v), _length);           \
+                                                                       \
+       /* We can now append v with a simple "or", shift it piece-wise */ \
+       _this_unit = _start_unit;                                       \
+       if (_start_unit == _end_unit - 1) {                             \
+               _mask = _bt_make_mask(type, _start % _ts);              \
+               if (_end % _ts)                                         \
+                       _mask |= _bt_make_mask_complement(type, _end % _ts); \
+               _cmask = _bt_lshift((type) (_v), _start % _ts);         \
+               _cmask &= ~_mask;                                       \
+               _ptr[_this_unit] &= _mask;                              \
+               _ptr[_this_unit] |= _cmask;                             \
+               break;                                                  \
+       }                                                               \
+       if (_start % _ts) {                                             \
+               _cshift = _start % _ts;                                 \
+               _mask = _bt_make_mask(type, _cshift);                   \
+               _cmask = _bt_lshift((type) (_v), _cshift);              \
+               _cmask &= ~_mask;                                       \
+               _ptr[_this_unit] &= _mask;                              \
+               _ptr[_this_unit] |= _cmask;                             \
+               _bt_safe_rshift(_v, _ts - _cshift);                     \
+               _start += _ts - _cshift;                                \
+               _this_unit++;                                           \
+       }                                                               \
+       for (; _this_unit < _end_unit - 1; _this_unit++) {              \
+               _ptr[_this_unit] = (type) _v;                           \
+               _bt_safe_rshift(_v, _ts);                               \
+               _start += _ts;                                          \
+       }                                                               \
+       if (_end % _ts) {                                               \
+               _mask = _bt_make_mask_complement(type, _end % _ts);     \
+               _cmask = (type) _v;                                     \
+               _cmask &= ~_mask;                                       \
+               _ptr[_this_unit] &= _mask;                              \
+               _ptr[_this_unit] |= _cmask;                             \
+       } else                                                          \
+               _ptr[_this_unit] = (type) _v;                           \
+} while (0)
+
+#define _bt_bitfield_write_be(ptr, type, start, length, v)             \
+do {                                                                   \
+       __typeof__(v) _v = (v);                                         \
+       type *_ptr = (void *) (ptr);                                    \
+       unsigned long _start = (start), _length = (length);             \
+       type _mask, _cmask;                                             \
+       unsigned long _ts = sizeof(type) * CHAR_BIT; /* type size */    \
+       unsigned long _start_unit, _end_unit, _this_unit;               \
+       unsigned long _end, _cshift; /* _cshift is "complement shift" */ \
+                                                                       \
+       if (!_length)                                                   \
+               break;                                                  \
+                                                                       \
+       _end = _start + _length;                                        \
+       _start_unit = _start / _ts;                                     \
+       _end_unit = (_end + (_ts - 1)) / _ts;                           \
+                                                                       \
+       /* Trim v high bits */                                          \
+       if (_length < sizeof(_v) * CHAR_BIT)                            \
+               _v &= _bt_make_mask(__typeof__(_v), _length);           \
+                                                                       \
+       /* We can now append v with a simple "or", shift it piece-wise */ \
+       _this_unit = _end_unit - 1;                                     \
+       if (_start_unit == _end_unit - 1) {                             \
+               _mask = _bt_make_mask(type, (_ts - (_end % _ts)) % _ts); \
+               if (_start % _ts)                                       \
+                       _mask |= _bt_make_mask_complement(type, _ts - (_start % _ts)); \
+               _cmask = _bt_lshift((type) (_v), (_ts - (_end % _ts)) % _ts); \
+               _cmask &= ~_mask;                                       \
+               _ptr[_this_unit] &= _mask;                              \
+               _ptr[_this_unit] |= _cmask;                             \
+               break;                                                  \
+       }                                                               \
+       if (_end % _ts) {                                               \
+               _cshift = _end % _ts;                                   \
+               _mask = _bt_make_mask(type, _ts - _cshift);             \
+               _cmask = _bt_lshift((type) (_v), _ts - _cshift);        \
+               _cmask &= ~_mask;                                       \
+               _ptr[_this_unit] &= _mask;                              \
+               _ptr[_this_unit] |= _cmask;                             \
+               _bt_safe_rshift(_v, _cshift);                           \
+               _end -= _cshift;                                        \
+               _this_unit--;                                           \
+       }                                                               \
+       for (; (long) _this_unit >= (long) _start_unit + 1; _this_unit--) { \
+               _ptr[_this_unit] = (type) _v;                           \
+               _bt_safe_rshift(_v, _ts);                               \
+               _end -= _ts;                                            \
+       }                                                               \
+       if (_start % _ts) {                                             \
+               _mask = _bt_make_mask_complement(type, _ts - (_start % _ts)); \
+               _cmask = (type) _v;                                     \
+               _cmask &= ~_mask;                                       \
+               _ptr[_this_unit] &= _mask;                              \
+               _ptr[_this_unit] |= _cmask;                             \
+       } else                                                          \
+               _ptr[_this_unit] = (type) _v;                           \
+} while (0)
+
+/*
+ * bt_bitfield_write - write integer to a bitfield in native endianness
+ * bt_bitfield_write_le - write integer to a bitfield in little endian
+ * bt_bitfield_write_be - write integer to a bitfield in big endian
+ */
+
+#if (BYTE_ORDER == LITTLE_ENDIAN)
+
+#define bt_bitfield_write(ptr, type, start, length, v)                 \
+       _bt_bitfield_write_le(ptr, type, start, length, v)
+
+#define bt_bitfield_write_le(ptr, type, start, length, v)              \
+       _bt_bitfield_write_le(ptr, type, start, length, v)
+
+#define bt_bitfield_write_be(ptr, type, start, length, v)              \
+       _bt_bitfield_write_be(ptr, unsigned char, start, length, v)
+
+#elif (BYTE_ORDER == BIG_ENDIAN)
+
+#define bt_bitfield_write(ptr, type, start, length, v)                 \
+       _bt_bitfield_write_be(ptr, type, start, length, v)
+
+#define bt_bitfield_write_le(ptr, type, start, length, v)              \
+       _bt_bitfield_write_le(ptr, unsigned char, start, length, v)
+
+#define bt_bitfield_write_be(ptr, type, start, length, v)              \
+       _bt_bitfield_write_be(ptr, type, start, length, v)
+
+#else /* (BYTE_ORDER == PDP_ENDIAN) */
+
+#error "Byte order not supported"
+
+#endif
+
+#define _bt_bitfield_read_le(ptr, type, start, length, vptr)           \
+do {                                                                   \
+       __typeof__(*(vptr)) *_vptr = (vptr);                            \
+       __typeof__(*_vptr) _v;                                          \
+       type *_ptr = (type *) (ptr);                                    \
+       unsigned long _start = (start), _length = (length);             \
+       type _mask, _cmask;                                             \
+       unsigned long _ts = sizeof(type) * CHAR_BIT; /* type size */    \
+       unsigned long _start_unit, _end_unit, _this_unit;               \
+       unsigned long _end, _cshift; /* _cshift is "complement shift" */ \
+       bool _is_signed_type;                                           \
+                                                                       \
+       if (!_length) {                                                 \
+               *_vptr = 0;                                             \
+               break;                                                  \
+       }                                                               \
+                                                                       \
+       _end = _start + _length;                                        \
+       _start_unit = _start / _ts;                                     \
+       _end_unit = (_end + (_ts - 1)) / _ts;                           \
+                                                                       \
+       _this_unit = _end_unit - 1;                                     \
+       _BT_DIAG_PUSH                                                   \
+       _BT_DIAG_IGNORE_TYPE_LIMITS                                     \
+       _is_signed_type = _bt_is_signed_type(__typeof__(_v));           \
+       _BT_DIAG_POP                                                    \
+       if (_is_signed_type                                             \
+           && (_ptr[_this_unit] & _bt_lshift((type) 1, (_end % _ts ? _end % _ts : _ts) - 1))) \
+               _v = ~(__typeof__(_v)) 0;                               \
+       else                                                            \
+               _v = 0;                                                 \
+       if (_start_unit == _end_unit - 1) {                             \
+               _cmask = _ptr[_this_unit];                              \
+               _cmask = _bt_rshift(_cmask, _start % _ts);              \
+               if ((_end - _start) % _ts) {                            \
+                       _mask = _bt_make_mask(type, _end - _start);     \
+                       _cmask &= _mask;                                \
+               }                                                       \
+               _bt_safe_lshift(_v, _end - _start);                     \
+               _v |= _bt_cast_value_to_unsigned_type(__typeof__(_v), _cmask); \
+               *_vptr = _v;                                            \
+               break;                                                  \
+       }                                                               \
+       if (_end % _ts) {                                               \
+               _cshift = _end % _ts;                                   \
+               _mask = _bt_make_mask(type, _cshift);                   \
+               _cmask = _ptr[_this_unit];                              \
+               _cmask &= _mask;                                        \
+               _bt_safe_lshift(_v, _cshift);                           \
+               _v |= _bt_cast_value_to_unsigned_type(__typeof__(_v), _cmask); \
+               _end -= _cshift;                                        \
+               _this_unit--;                                           \
+       }                                                               \
+       for (; (long) _this_unit >= (long) _start_unit + 1; _this_unit--) { \
+               _bt_safe_lshift(_v, _ts);                               \
+               _v |= _bt_cast_value_to_unsigned_type(__typeof__(_v), _ptr[_this_unit]); \
+               _end -= _ts;                                            \
+       }                                                               \
+       if (_start % _ts) {                                             \
+               _mask = _bt_make_mask(type, _ts - (_start % _ts));      \
+               _cmask = _ptr[_this_unit];                              \
+               _cmask = _bt_rshift(_cmask, _start % _ts);              \
+               _cmask &= _mask;                                        \
+               _bt_safe_lshift(_v, _ts - (_start % _ts));              \
+               _v |= _bt_cast_value_to_unsigned_type(__typeof__(_v), _cmask); \
+       } else {                                                        \
+               _bt_safe_lshift(_v, _ts);                               \
+               _v |= _bt_cast_value_to_unsigned_type(__typeof__(_v), _ptr[_this_unit]); \
+       }                                                               \
+       *_vptr = _v;                                                    \
+} while (0)
+
+#define _bt_bitfield_read_be(ptr, type, start, length, vptr)           \
+do {                                                                   \
+       __typeof__(*(vptr)) *_vptr = (vptr);                            \
+       __typeof__(*_vptr) _v;                                          \
+       type *_ptr = (void *) (ptr);                                    \
+       unsigned long _start = (start), _length = (length);             \
+       type _mask, _cmask;                                             \
+       unsigned long _ts = sizeof(type) * CHAR_BIT; /* type size */    \
+       unsigned long _start_unit, _end_unit, _this_unit;               \
+       unsigned long _end, _cshift; /* _cshift is "complement shift" */ \
+       bool _is_signed_type;                                           \
+                                                                       \
+       if (!_length) {                                                 \
+               *_vptr = 0;                                             \
+               break;                                                  \
+       }                                                               \
+                                                                       \
+       _end = _start + _length;                                        \
+       _start_unit = _start / _ts;                                     \
+       _end_unit = (_end + (_ts - 1)) / _ts;                           \
+                                                                       \
+       _this_unit = _start_unit;                                       \
+       _BT_DIAG_PUSH                                                   \
+       _BT_DIAG_IGNORE_TYPE_LIMITS                                     \
+       _is_signed_type = _bt_is_signed_type(__typeof__(_v));           \
+       _BT_DIAG_POP                                                    \
+       if (_is_signed_type                                             \
+           && (_ptr[_this_unit] & _bt_lshift((type) 1, _ts - (_start % _ts) - 1))) \
+               _v = ~(__typeof__(_v)) 0;                               \
+       else                                                            \
+               _v = 0;                                                 \
+       if (_start_unit == _end_unit - 1) {                             \
+               _cmask = _ptr[_this_unit];                              \
+               _cmask = _bt_rshift(_cmask, (_ts - (_end % _ts)) % _ts); \
+               if ((_end - _start) % _ts) {                            \
+                       _mask = _bt_make_mask(type, _end - _start);     \
+                       _cmask &= _mask;                                \
+               }                                                       \
+               _bt_safe_lshift(_v, _end - _start);                     \
+               _v |= _bt_cast_value_to_unsigned_type(__typeof__(_v), _cmask); \
+               *_vptr = _v;                                            \
+               break;                                                  \
+       }                                                               \
+       if (_start % _ts) {                                             \
+               _cshift = _start % _ts;                                 \
+               _mask = _bt_make_mask(type, _ts - _cshift);             \
+               _cmask = _ptr[_this_unit];                              \
+               _cmask &= _mask;                                        \
+               _bt_safe_lshift(_v, _ts - _cshift);                     \
+               _v |= _bt_cast_value_to_unsigned_type(__typeof__(_v), _cmask); \
+               _start += _ts - _cshift;                                \
+               _this_unit++;                                           \
+       }                                                               \
+       for (; _this_unit < _end_unit - 1; _this_unit++) {              \
+               _bt_safe_lshift(_v, _ts);                               \
+               _v |= _bt_cast_value_to_unsigned_type(__typeof__(_v), _ptr[_this_unit]); \
+               _start += _ts;                                          \
+       }                                                               \
+       if (_end % _ts) {                                               \
+               _mask = _bt_make_mask(type, _end % _ts);                \
+               _cmask = _ptr[_this_unit];                              \
+               _cmask = _bt_rshift(_cmask, _ts - (_end % _ts));        \
+               _cmask &= _mask;                                        \
+               _bt_safe_lshift(_v, _end % _ts);                        \
+               _v |= _bt_cast_value_to_unsigned_type(__typeof__(_v), _cmask); \
+       } else {                                                        \
+               _bt_safe_lshift(_v, _ts);                               \
+               _v |= _bt_cast_value_to_unsigned_type(__typeof__(_v), _ptr[_this_unit]); \
+       }                                                               \
+       *_vptr = _v;                                                    \
+} while (0)
+
+/*
+ * bt_bitfield_read - read integer from a bitfield in native endianness
+ * bt_bitfield_read_le - read integer from a bitfield in little endian
+ * bt_bitfield_read_be - read integer from a bitfield in big endian
+ */
+
+#if (BYTE_ORDER == LITTLE_ENDIAN)
+
+#define bt_bitfield_read(ptr, type, start, length, vptr)               \
+       _bt_bitfield_read_le(ptr, type, start, length, vptr)
+
+#define bt_bitfield_read_le(ptr, type, start, length, vptr)            \
+       _bt_bitfield_read_le(ptr, type, start, length, vptr)
+
+#define bt_bitfield_read_be(ptr, type, start, length, vptr)            \
+       _bt_bitfield_read_be(ptr, unsigned char, start, length, vptr)
+
+#elif (BYTE_ORDER == BIG_ENDIAN)
+
+#define bt_bitfield_read(ptr, type, start, length, vptr)               \
+       _bt_bitfield_read_be(ptr, type, start, length, vptr)
+
+#define bt_bitfield_read_le(ptr, type, start, length, vptr)            \
+       _bt_bitfield_read_le(ptr, unsigned char, start, length, vptr)
+
+#define bt_bitfield_read_be(ptr, type, start, length, vptr)            \
+       _bt_bitfield_read_be(ptr, type, start, length, vptr)
+
+#else /* (BYTE_ORDER == PDP_ENDIAN) */
+
+#error "Byte order not supported"
+
+#endif
+
+#endif /* _BABELTRACE_BITFIELD_H */
diff --git a/include/ust-context-provider.h b/include/ust-context-provider.h
new file mode 100644 (file)
index 0000000..332f914
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * SPDX-License-Identifier: MIT
+ *
+ * Copyright (C) 2016 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ */
+
+#ifndef _LTTNG_UST_CONTEXT_PROVIDER_H
+#define _LTTNG_UST_CONTEXT_PROVIDER_H
+
+#include <stddef.h>
+#include <lttng/ust-events.h>
+#include <urcu/hlist.h>
+
+struct lttng_ust_context_provider {
+       char *name;
+       size_t (*get_size)(struct lttng_ctx_field *field, size_t offset);
+       void (*record)(struct lttng_ctx_field *field,
+                      struct lttng_ust_lib_ring_buffer_ctx *ctx,
+                      struct lttng_channel *chan);
+       void (*get_value)(struct lttng_ctx_field *field,
+                        struct lttng_ctx_value *value);
+       struct cds_hlist_node node;
+};
+
+int lttng_ust_context_provider_register(struct lttng_ust_context_provider *provider);
+void lttng_ust_context_provider_unregister(struct lttng_ust_context_provider *provider);
+
+int lttng_context_is_app(const char *name);
+
+void lttng_ust_context_set_session_provider(const char *name,
+               size_t (*get_size)(struct lttng_ctx_field *field, size_t offset),
+               void (*record)(struct lttng_ctx_field *field,
+                       struct lttng_ust_lib_ring_buffer_ctx *ctx,
+                       struct lttng_channel *chan),
+               void (*get_value)(struct lttng_ctx_field *field,
+                       struct lttng_ctx_value *value));
+
+int lttng_ust_add_app_context_to_ctx_rcu(const char *name, struct lttng_ctx **ctx);
+int lttng_ust_context_set_provider_rcu(struct lttng_ctx **_ctx,
+               const char *name,
+               size_t (*get_size)(struct lttng_ctx_field *field, size_t offset),
+               void (*record)(struct lttng_ctx_field *field,
+                       struct lttng_ust_lib_ring_buffer_ctx *ctx,
+                       struct lttng_channel *chan),
+               void (*get_value)(struct lttng_ctx_field *field,
+                       struct lttng_ctx_value *value));
+int lttng_context_add_rcu(struct lttng_ctx **ctx_p,
+               const struct lttng_ctx_field *f);
+
+#endif /* _LTTNG_UST_CONTEXT_PROVIDER_H */
diff --git a/include/ust-dlfcn.h b/include/ust-dlfcn.h
new file mode 100644 (file)
index 0000000..0681f8f
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * SPDX-License-Identifier: MIT
+ *
+ * Copyright (C) 2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * dlfcn.h compatibility layer.
+ */
+
+#ifndef _LTTNG_UST_DLFCN_H
+#define _LTTNG_UST_DLFCN_H
+
+#ifdef _DLFCN_H
+#error "Please include ust-dlfcn.h before dlfcn.h."
+#endif /* _DLFCN_H */
+
+#ifdef __GLIBC__
+/*
+ * glibc declares dlsym() and dlerror() with __attribute__((leaf)) (see
+ * THROW annotation). Unfortunately, this is not in sync with reality,
+ * as those functions call the memory allocator. Work-around this glibc
+ * bug by declaring our own symbols.
+ *
+ * There has been a similar issue for dlopen() and dlclose(), as
+ * constructors and destructors are called from these functions, so they
+ * are clearly non-leaf. Work-around the issue for those too for older
+ * glibc where these have not been fixed.
+ */
+#define dlopen glibc_dlopen_proto_lies_about_leafness
+#define dlclose glibc_dlclose_proto_lies_about_leafness
+#define dlsym glibc_dlsym_proto_lies_about_leafness
+#define dlerror glibc_dlerror_proto_lies_about_leafness
+#define dlmopen glibc_dlmopen_proto_lies_about_leafness
+#define dlvsym glibc_dlvsym_proto_lies_about_leafness
+#include <dlfcn.h>
+#undef dlvsym
+#undef dlmopen
+#undef dlerror
+#undef dlsym
+#undef dlclose
+#undef dlopen
+
+extern void *dlopen(__const char *__file, int __mode);
+extern int dlclose(void *__handle) __nonnull ((1));
+extern void *dlsym(void *__restrict __handle,
+               __const char *__restrict __name) __nonnull ((2));
+extern char *dlerror(void);
+#ifdef __USE_GNU
+extern void *dlmopen(Lmid_t __nsid, const char *__file, int __mode);
+extern void *dlvsym(void *__restrict __handle,
+               __const char *__restrict __name,
+               __const char *__restrict __version);
+#endif
+#else
+#include <dlfcn.h>
+#endif /* __GLIBC__ */
+
+#endif /* _LTTNG_UST_DLFCN_H */
diff --git a/include/ust-dynamic-type.h b/include/ust-dynamic-type.h
new file mode 100644 (file)
index 0000000..ac56b56
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * SPDX-License-Identifier: MIT
+ *
+ * Copyright (C) 2016 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ */
+
+#ifndef _LTTNG_UST_DYNAMIC_TYPE_H
+#define _LTTNG_UST_DYNAMIC_TYPE_H
+
+#include <lttng/ust-events.h>
+
+int lttng_ust_dynamic_type_choices(size_t *nr_choices,
+               const struct lttng_event_field **choices);
+const struct lttng_event_field *lttng_ust_dynamic_type_field(int64_t value);
+const struct lttng_event_field *lttng_ust_dynamic_type_tag_field(void);
+
+#endif /* _LTTNG_UST_DYNAMIC_TYPE_H */
diff --git a/include/ust-tid.h b/include/ust-tid.h
new file mode 100644 (file)
index 0000000..eae1db9
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * SPDX-License-Identifier: MIT
+ *
+ * Copyright (C) 2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * gettid compatibility layer.
+ */
+
+#ifndef _LTTNG_UST_TID_H
+#define _LTTNG_UST_TID_H
+
+#ifdef __linux__
+#include <sys/syscall.h>
+#endif
+
+#if defined(__NR_gettid)
+
+#include <unistd.h>
+static inline pid_t lttng_gettid(void)
+{
+       return syscall(__NR_gettid);
+}
+
+#else
+
+#include <sys/types.h>
+#include <unistd.h>
+
+/* Fall-back on getpid for tid if not available. */
+static inline pid_t lttng_gettid(void)
+{
+       return getpid();
+}
+
+#endif
+
+#endif /* _LTTNG_UST_TID_H */
index a2e99dafdcef3777c08906c3315fcd5f64461383..478ad1f89bda55f1034bdc2133255c91d97bb3cf 100644 (file)
@@ -14,7 +14,7 @@
 #include <stdarg.h>
 #include <stdio.h>
 #include <share.h>
-#include "lttng/ust-tid.h"
+#include "ust-tid.h"
 
 enum ust_loglevel {
        UST_LOGLEVEL_UNKNOWN = 0,
index 520113860a8683cb11216f8434f231d0735aa55a..8a35d9f7a4a3d3512cde25a6588e67b404f39001 100644 (file)
@@ -25,7 +25,7 @@
 #include <helper.h>
 #include <lttng/ust-error.h>
 #include <lttng/ust-events.h>
-#include <lttng/ust-dynamic-type.h>
+#include <ust-dynamic-type.h>
 #include <usterr-signal-safe.h>
 
 #include "../liblttng-ust/compat.h"
index 004a7ae266596fb939427bb79d9e2f16a6c6c21a..2e4c3c01f9b6dcb0e88d573993a4add6c787baa3 100644 (file)
@@ -13,7 +13,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-#include <lttng/ust-dlfcn.h>
+#include <ust-dlfcn.h>
 #include <lttng/ust-elf.h>
 #include <lttng/ust-events.h>
 #include <helper.h>
index 32fae490bb6bf1739fdc64198cf44f42bff43a44..8fb352806b2655a55517a38a2df28f8216b37d97 100644 (file)
@@ -5,7 +5,7 @@
  * Copyright (C) 2011-2012  Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  */
 
-#include <lttng/ust-dlfcn.h>
+#include <ust-dlfcn.h>
 #include <unistd.h>
 #include <stdio.h>
 #include <signal.h>
index eeb37ebedda9fd3eb2b4c3a67b355e20d3d0f24d..2a06a1b35bb31cfbf3eff02f0f95f44fa12503fe 100644 (file)
@@ -12,7 +12,7 @@
 #include <inttypes.h>
 #include <lttng/ust-events.h>
 #include <lttng/ringbuffer-config.h>
-#include <lttng/ust-context-provider.h>
+#include <ust-context-provider.h>
 
 #include "helper.h"
 #include "lttng_ust_context.h"
index dbd2d1b0f9aa22fd91afc478fd1142993e134991..0ad45445f2041e71985562726fcef5fbd809bb78 100644 (file)
@@ -10,7 +10,7 @@
  * circular dependency loop between this malloc wrapper, liburcu and
  * libc.
  */
-#include <lttng/ust-dlfcn.h>
+#include <ust-dlfcn.h>
 #include <sys/types.h>
 #include <stdio.h>
 #include <assert.h>
index 4875bd003ff77785676d169d88d2bfbcac36ae1b..56d0ea3b35ac6eb0babcc50a83c90dbca4079438 100644 (file)
@@ -9,7 +9,7 @@
  * circular dependency loop between this malloc wrapper, liburcu and
  * libc.
  */
-#include <lttng/ust-dlfcn.h>
+#include <ust-dlfcn.h>
 #include <helper.h>
 #include <pthread.h>
 
index 11c7b7dc53853199248c3fd14b256a6ad18b2f98..bf1f2cac1d996003044e225dd0016352c9f8ba9b 100644 (file)
@@ -14,7 +14,7 @@
 #include <stdbool.h>
 #include <helper.h>
 #include <lttng/ust-events.h>
-#include <lttng/ust-context-provider.h>
+#include <ust-context-provider.h>
 #include <stdint.h>
 #include <assert.h>
 #include <errno.h>
index fe803449d46dec1aaa0f1d135ee34970a2722307..191fa9a74177165d9cd375bbd81a509c5afaef26 100644 (file)
@@ -15,7 +15,7 @@
 #include <lttng/ust-events.h>
 #include <lttng/ust-tracer.h>
 #include <lttng/ringbuffer-config.h>
-#include <lttng/ust-tid.h>
+#include <ust-tid.h>
 #include <urcu/tls-compat.h>
 #include "lttng-tracer-core.h"
 #include "ns.h"
index 893daabc9bb1bf1254fc527f6c72d53baf5580bf..a40ad29d0ad1fe6f0c0b0603637385f0a2282dde 100644 (file)
@@ -15,7 +15,7 @@
 #include <lttng/ust-events.h>
 #include <lttng/ust-tracer.h>
 #include <lttng/ringbuffer-config.h>
-#include <lttng/ust-tid.h>
+#include <ust-tid.h>
 #include <urcu/tls-compat.h>
 #include "lttng-tracer-core.h"
 #include "ns.h"
index d6c807aa35ad6a5625808788b78c5736050f8f64..3ae3860f8bbf9a4d4b5be16f71d892ef79a58db4 100644 (file)
@@ -15,7 +15,7 @@
 #include <lttng/ust-events.h>
 #include <lttng/ust-tracer.h>
 #include <lttng/ringbuffer-config.h>
-#include <lttng/ust-tid.h>
+#include <ust-tid.h>
 #include <urcu/tls-compat.h>
 #include "lttng-tracer-core.h"
 #include "ns.h"
index ea7965c863636624cfa47c9bf757c646b0346bc6..9af001b57284d0b7e45ff1fd00f6a94efd74fa08 100644 (file)
@@ -12,7 +12,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-#include <lttng/ust-context-provider.h>
+#include <ust-context-provider.h>
 
 #include "lttng-tracer-core.h"
 #include "jhash.h"
index 352e2fcc28d6080cf2f72f988759bd480bba80ef..a2365cd200581d901214c754b0bb85fb81c8cb96 100644 (file)
@@ -15,7 +15,7 @@
 #include <lttng/ust-events.h>
 #include <lttng/ust-tracer.h>
 #include <lttng/ringbuffer-config.h>
-#include <lttng/ust-tid.h>
+#include <ust-tid.h>
 #include <urcu/tls-compat.h>
 #include "lttng-tracer-core.h"
 #include "ns.h"
index 5705c0d4556413ece3fb5e7696b04dc05777104c..b61506812a0f16e6a264ed4cd7332e3d3a38054c 100644 (file)
@@ -15,7 +15,7 @@
 #include <lttng/ust-events.h>
 #include <lttng/ust-tracer.h>
 #include <lttng/ringbuffer-config.h>
-#include <lttng/ust-tid.h>
+#include <ust-tid.h>
 #include <urcu/tls-compat.h>
 #include "lttng-tracer-core.h"
 #include "ns.h"
index feb253d08b6d57c69f37d01be5cb2917345c1f0a..bdf0b309788c6dd6b43f495555544e160194f9de 100644 (file)
@@ -13,7 +13,7 @@
 #include <lttng/ust-events.h>
 #include <lttng/ust-tracer.h>
 #include <lttng/ringbuffer-config.h>
-#include <lttng/ust-tid.h>
+#include <ust-tid.h>
 #include <urcu/tls-compat.h>
 #include "lttng-tracer-core.h"
 
index a5d5d03506d674252a803a725185bc3577e525b4..19f392f1c8edba97c6bf58671187c2c144c758c3 100644 (file)
@@ -9,7 +9,7 @@
 #define _LGPL_SOURCE
 #include <lttng/ust-events.h>
 #include <lttng/ust-tracer.h>
-#include <lttng/ust-context-provider.h>
+#include <ust-context-provider.h>
 #include <lttng/urcu/pointer.h>
 #include <usterr-signal-safe.h>
 #include <helper.h>
index 6196fc6a59fbbd89a8336f4526e62c5060109875..47460102ef8813de503d1feeb0cf4b793547b8d8 100644 (file)
@@ -37,8 +37,8 @@
 #include <lttng/ust-ctl.h>
 #include <ust-comm.h>
 #include <ust-fd.h>
-#include <lttng/ust-dynamic-type.h>
-#include <lttng/ust-context-provider.h>
+#include <ust-dynamic-type.h>
+#include <ust-context-provider.h>
 #include "error.h"
 #include "compat.h"
 #include "lttng-ust-uuid.h"
index 579f650dbb4b3e9666668bc2069e8e05f0e331d8..42d68f663f5296d6e089d30cf06f5387a18b3c17 100644 (file)
@@ -9,7 +9,7 @@
 #include <stddef.h>
 #include <stdint.h>
 #include <lttng/ust-events.h>
-#include "lttng/bitfield.h"
+#include "ust-bitfield.h"
 #include "clock.h"
 #include "lttng-tracer.h"
 #include "../libringbuffer/frontend_types.h"
index fbb138714060b87cfd39ebd4467435402d7cb70e..0b0a65fc7dd1776385561580cda276662a0e0a0b 100644 (file)
@@ -9,7 +9,7 @@
 #include <stddef.h>
 #include <stdint.h>
 #include <lttng/ust-events.h>
-#include "lttng/bitfield.h"
+#include "ust-bitfield.h"
 #include "lttng-tracer.h"
 #include "../libringbuffer/frontend_types.h"
 
index aad0216fe0f14266eaa51e6bb59d3ed588895343..3c1314c433715c005dbdfb2e2fa7ad4e80f517c1 100644 (file)
@@ -13,7 +13,7 @@
 #include <inttypes.h>
 
 #include <helper.h>
-#include <lttng/ust-dynamic-type.h>
+#include <ust-dynamic-type.h>
 
 #define ctf_enum_value(_string, _value)                                        \
        {                                                               \
index 824a0fcd484a1037a5e05d4f3e2f7bda417a4e96..3d026095039091c6610e00557303c3ee3c9c78b2 100644 (file)
@@ -31,7 +31,7 @@ struct mmsghdr;
 /* Internal header. */
 #include <lttng/ust-events.h>
 #include <lttng/ringbuffer-config.h>
-#include <lttng/ust-context-provider.h>
+#include <ust-context-provider.h>
 
 static __thread unsigned int test_count;
 
This page took 0.080536 seconds and 4 git commands to generate.