ust/lttng-events.h \
ust/version.h \
ust/lttng-ust-abi.h \
- ust/ringbuffer-abi.h
+ ust/ringbuffer-abi.h \
+ ust/lttng-tracer.h \
+ ust/usterr-signal-safe.h \
+ ust/core.h \
+ ust/share.h
+
+# note: usterr-signal-safe.h, core.h and share.h need namespace cleanup.
noinst_HEADERS = \
- share.h \
usterr.h \
ust_snprintf.h \
- usterr_signal_safe.h \
ust/compat.h \
ust/config.h \
- ust/core.h \
ust/marker-internal.h \
ust/tracepoint-internal.h \
ust/clock.h \
+++ /dev/null
-/* Copyright (C) 2009 Pierre-Marc Fournier
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef UST_SHARE_H
-#define UST_SHARE_H
-
-/* write() */
-#include <unistd.h>
-
-/* send() */
-#include <sys/types.h>
-#include <sys/socket.h>
-
-#include <errno.h>
-
-/* This write is patient because it restarts if it was incomplete.
- */
-
-static __inline__ ssize_t patient_write(int fd, const void *buf, size_t count)
-{
- const char *bufc = (const char *) buf;
- int result;
-
- for(;;) {
- result = write(fd, bufc, count);
- if(result == -1 && errno == EINTR) {
- continue;
- }
- if(result <= 0) {
- return result;
- }
- count -= result;
- bufc += result;
-
- if(count == 0) {
- break;
- }
- }
-
- return bufc-(const char *)buf;
-}
-
-static __inline__ ssize_t patient_send(int fd, const void *buf, size_t count, int flags)
-{
- const char *bufc = (const char *) buf;
- int result;
-
- for(;;) {
- result = send(fd, bufc, count, flags);
- if(result == -1 && errno == EINTR) {
- continue;
- }
- if(result <= 0) {
- return result;
- }
- count -= result;
- bufc += result;
-
- if(count == 0) {
- break;
- }
- }
-
- return bufc-(const char *)buf;
-}
-
-#endif /* UST_SHARE_H */
#include <uuid/uuid.h>
#include <stdint.h>
#include <ust/lttng-ust-abi.h>
+#include <ust/lttng-tracer.h>
#include <endian.h>
#include <float.h>
-#undef is_signed_type
-#define is_signed_type(type) (((type)(-1)) < 0)
-
struct ltt_channel;
struct ltt_session;
struct lib_ring_buffer_ctx;
.u.basic.integer = \
{ \
.size = sizeof(_type) * CHAR_BIT, \
- .alignment = ltt_alignof(_type) * CHAR_BIT, \
- .signedness = is_signed_type(_type), \
+ .alignment = lttng_alignof(_type) * CHAR_BIT, \
+ .signedness = lttng_is_signed_type(_type), \
.reverse_byte_order = _byte_order != __BYTE_ORDER, \
.base = _base, \
.encoding = lttng_encode_##_encoding, \
.exp_dig = sizeof(_type) * CHAR_BIT \
- _float_mant_dig(_type), \
.mant_dig = _float_mant_dig(_type), \
- .alignment = ltt_alignof(_type) * CHAR_BIT, \
- .signedness = is_signed_type(_type), \
+ .alignment = lttng_alignof(_type) * CHAR_BIT, \
+ .signedness = lttng_is_signed_type(_type), \
.reverse_byte_order = __BYTE_ORDER != __FLOAT_WORD_ORDER, \
}, \
} \
#include <stdio.h>
#include <urcu/compiler.h>
#include <ust/lttng-events.h>
+#include <ust/usterr-signal-safe.h>
#include <ust/ringbuffer-config.h>
/*
/* Helpers */
#define _TP_ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
+#define _tp_max_t(type, x, y) \
+ ({ \
+ type __max1 = (x); \
+ type __max2 = (y); \
+ __max1 > __max2 ? __max1: __max2; \
+ })
+
+
/*
* Stage 1 of the trace events.
*
#undef TRACEPOINT_EVENT_CLASS
#define TRACEPOINT_EVENT_CLASS(_name, _proto, _args, _fields) \
- TRACEPOINT_EVENT_CLASS_NOARGS(_name, _fields)
+ TRACEPOINT_EVENT_CLASS_NOARGS(_name, TP_PARAMS(_fields))
#include TRACEPOINT_INCLUDE(TRACEPOINT_INCLUDE_FILE)
#undef ctf_integer_ext
#define ctf_integer_ext(_type, _item, _src, _byte_order, _base) \
- __event_len += lib_ring_buffer_align(__event_len, ltt_alignof(_type)); \
+ __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_type)); \
__event_len += sizeof(_type);
#undef ctf_float
#define ctf_float(_type, _item, _src) \
- __event_len += lib_ring_buffer_align(__event_len, ltt_alignof(_type)); \
+ __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_type)); \
__event_len += sizeof(_type);
#undef ctf_array_encoded
#define ctf_array_encoded(_type, _item, _src, _length) \
- __event_len += lib_ring_buffer_align(__event_len, ltt_alignof(_type)); \
+ __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_type)); \
__event_len += sizeof(_type) * (_length);
#undef ctf_sequence_encoded
#define ctf_sequence_encoded(_type, _item, _src, _length_type, \
_src_length, _encoding) \
- __event_len += lib_ring_buffer_align(__event_len, ltt_alignof(_length_type)); \
+ __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_length_type)); \
__event_len += sizeof(_length_type); \
- __event_len += lib_ring_buffer_align(__event_len, ltt_alignof(_type)); \
+ __event_len += lib_ring_buffer_align(__event_len, lttng_alignof(_type)); \
__dynamic_len[__dynamic_len_idx] = (_length); \
__event_len += sizeof(_type) * __dynamic_len[__dynamic_len_idx]; \
__dynamic_len_idx++;
#undef ctf_integer_ext
#define ctf_integer_ext(_type, _item, _src, _byte_order, _base) \
- __event_align = max_t(size_t, __event_align, ltt_alignof(_type));
+ __event_align = _tp_max_t(size_t, __event_align, lttng_alignof(_type));
#undef ctf_float
#define ctf_float(_type, _item, _src) \
- __event_align = max_t(size_t, __event_align, ltt_alignof(_type));
+ __event_align = _tp_max_t(size_t, __event_align, lttng_alignof(_type));
#undef ctf_array_encoded
#define ctf_array_encoded(_type, _item, _src, _length) \
- __event_align = max_t(size_t, __event_align, ltt_alignof(_type));
+ __event_align = _tp_max_t(size_t, __event_align, lttng_alignof(_type));
#undef ctf_sequence_encoded
#define ctf_sequence_encoded(_type, _item, _src, _length_type, \
_src_length, _encoding) \
- __event_align = max_t(size_t, __event_align, ltt_alignof(_length_type)); \
- __event_align = max_t(size_t, __event_align, ltt_alignof(_type));
+ __event_align = _tp_max_t(size_t, __event_align, lttng_alignof(_length_type)); \
+ __event_align = _tp_max_t(size_t, __event_align, lttng_alignof(_type));
#undef ctf_string
#define ctf_string(_item, _src)
#define ctf_integer_ext(_type, _item, _src, _byte_order, _base) \
{ \
_type __tmp = (_src); \
- lib_ring_buffer_align_ctx(&ctx, ltt_alignof(__tmp)); \
+ lib_ring_buffer_align_ctx(&ctx, lttng_alignof(__tmp)); \
__chan->ops->event_write(&ctx, &__tmp, sizeof(__tmp)); \
}
#define ctf_float(_type, _item, _src) \
{ \
_type __tmp = (_src); \
- lib_ring_buffer_align_ctx(&ctx, ltt_alignof(__tmp)); \
+ lib_ring_buffer_align_ctx(&ctx, lttng_alignof(__tmp)); \
__chan->ops->event_write(&ctx, &__tmp, sizeof(__tmp)); \
}
#undef ctf_array_encoded
#define ctf_array_encoded(_type, _item, _src, _length) \
- lib_ring_buffer_align_ctx(&ctx, ltt_alignof(_type)); \
+ lib_ring_buffer_align_ctx(&ctx, lttng_alignof(_type)); \
__chan->ops->event_write(&ctx, _src, _length);
#undef ctf_sequence_encoded
_src_length, _encoding) \
{ \
_length_type __tmpl = __dynamic_len[__dynamic_len_idx]; \
- lib_ring_buffer_align_ctx(&ctx, ltt_alignof(_length_type)); \
+ lib_ring_buffer_align_ctx(&ctx, lttng_alignof(_length_type)); \
__chan->ops->event_write(&ctx, &__tmpl, sizeof(_length_type)); \
} \
- lib_ring_buffer_align_ctx(&ctx, ltt_alignof(_type)); \
+ lib_ring_buffer_align_ctx(&ctx, lttng_alignof(_type)); \
__chan->ops->event_write(&ctx, _src, \
sizeof(_type) * __get_sequence_len(dest));
--- /dev/null
+/* Copyright (C) 2009 Pierre-Marc Fournier
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef UST_SHARE_H
+#define UST_SHARE_H
+
+/* write() */
+#include <unistd.h>
+
+/* send() */
+#include <sys/types.h>
+#include <sys/socket.h>
+
+#include <errno.h>
+
+/* This write is patient because it restarts if it was incomplete.
+ */
+
+static __inline__ ssize_t patient_write(int fd, const void *buf, size_t count)
+{
+ const char *bufc = (const char *) buf;
+ int result;
+
+ for(;;) {
+ result = write(fd, bufc, count);
+ if(result == -1 && errno == EINTR) {
+ continue;
+ }
+ if(result <= 0) {
+ return result;
+ }
+ count -= result;
+ bufc += result;
+
+ if(count == 0) {
+ break;
+ }
+ }
+
+ return bufc-(const char *)buf;
+}
+
+static __inline__ ssize_t patient_send(int fd, const void *buf, size_t count, int flags)
+{
+ const char *bufc = (const char *) buf;
+ int result;
+
+ for(;;) {
+ result = send(fd, bufc, count, flags);
+ if(result == -1 && errno == EINTR) {
+ continue;
+ }
+ if(result <= 0) {
+ return result;
+ }
+ count -= result;
+ bufc += result;
+
+ if(count == 0) {
+ break;
+ }
+ }
+
+ return bufc-(const char *)buf;
+}
+
+#endif /* UST_SHARE_H */
--- /dev/null
+#ifndef _USTERR_SIGNAL_SAFE_H
+#define _USTERR_SIGNAL_SAFE_H
+
+/*
+ * Copyright (C) 2009 Pierre-Marc Fournier
+ * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; version 2.1 of
+ * the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <string.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <errno.h>
+#include <stdarg.h>
+#include <stdio.h>
+
+#include <ust/core.h>
+
+#include <ust/share.h>
+
+enum ust_loglevel {
+ UST_LOGLEVEL_UNKNOWN = 0,
+ UST_LOGLEVEL_NORMAL,
+ UST_LOGLEVEL_DEBUG,
+};
+
+extern volatile enum ust_loglevel ust_loglevel;
+void init_usterr(void);
+
+static inline int ust_debug(void)
+{
+ return ust_loglevel == UST_LOGLEVEL_DEBUG;
+}
+
+#ifndef UST_COMPONENT
+//#error UST_COMPONENT is undefined
+#define UST_COMPONENT libust
+#endif
+
+/* To stringify the expansion of a define */
+#define UST_XSTR(d) UST_STR(d)
+#define UST_STR(s) #s
+
+/* We sometimes print in the tracing path, and tracing can occur in
+ * signal handlers, so we must use a print method which is signal safe.
+ */
+
+extern int ust_safe_snprintf(char *str, size_t n, const char *fmt, ...)
+ __attribute__ ((format (printf, 3, 4)));
+
+static inline void __attribute__ ((format (printf, 1, 2)))
+ __check_ust_safe_fmt(const char *fmt, ...)
+{
+}
+
+#define sigsafe_print_err(fmt, args...) \
+{ \
+ /* Can't use dynamic allocation. Limit ourselves to 250 chars. */ \
+ char ____buf[250]; \
+ int ____saved_errno; \
+ \
+ /* Save the errno. */ \
+ ____saved_errno = errno; \
+ \
+ ust_safe_snprintf(____buf, sizeof(____buf), fmt, ## args); \
+ \
+ /* Add end of string in case of buffer overflow. */ \
+ ____buf[sizeof(____buf) - 1] = 0; \
+ \
+ patient_write(STDERR_FILENO, ____buf, strlen(____buf)); \
+ /* \
+ * Can't print errors because we are in the error printing code \
+ * path. \
+ */ \
+ \
+ /* Restore errno, in order to be async-signal safe. */ \
+ errno = ____saved_errno; \
+}
+
+#define UST_STR_COMPONENT UST_XSTR(UST_COMPONENT)
+
+#define ERRMSG(fmt, args...) \
+ do { \
+ sigsafe_print_err(UST_STR_COMPONENT "[%ld/%ld]: " fmt " (in %s() at " __FILE__ ":" UST_XSTR(__LINE__) ")\n", \
+ (long) getpid(), \
+ (long) syscall(SYS_gettid), \
+ ## args, __func__); \
+ fflush(stderr); \
+ } while(0)
+
+#ifdef UST_DEBUG
+# define DBG(fmt, args...) ERRMSG(fmt, ## args)
+# define DBG_raw(fmt, args...) \
+ do { \
+ sigsafe_print_err(fmt, ## args); \
+ fflush(stderr); \
+ } while(0)
+#else
+# define DBG(fmt, args...) \
+ do { \
+ if (ust_debug()) \
+ ERRMSG(fmt, ## args); \
+ } while (0)
+# define DBG_raw(fmt, args...) \
+ do { \
+ if (ust_debug()) { \
+ sigsafe_print_err(fmt, ## args); \
+ fflush(stderr); \
+ } \
+ } while(0)
+#endif
+#define WARN(fmt, args...) ERRMSG("Warning: " fmt, ## args)
+#define ERR(fmt, args...) ERRMSG("Error: " fmt, ## args)
+#define BUG(fmt, args...) ERRMSG("BUG: " fmt, ## args)
+
+#if (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE)
+#define PERROR(call, args...)\
+ do { \
+ char buf[200] = "Error in strerror_r()"; \
+ strerror_r(errno, buf, sizeof(buf)); \
+ ERRMSG("Error: " call ": %s", ## args, buf); \
+ } while(0);
+#else
+#define PERROR(call, args...)\
+ do { \
+ char *buf; \
+ char tmp[200]; \
+ buf = strerror_r(errno, tmp, sizeof(tmp)); \
+ ERRMSG("Error: " call ": %s", ## args, buf); \
+ } while(0);
+#endif
+
+#define BUG_ON(condition) \
+ do { \
+ if (unlikely(condition)) \
+ ERR("condition not respected (BUG) on line %s:%d", __FILE__, __LINE__); \
+ } while(0)
+#define WARN_ON(condition) \
+ do { \
+ if (unlikely(condition)) \
+ WARN("condition not respected on line %s:%d", __FILE__, __LINE__); \
+ } while(0)
+#define WARN_ON_ONCE(condition) WARN_ON(condition)
+
+#endif /* _USTERR_SIGNAL_SAFE_H */
+++ /dev/null
-#ifndef _USTERR_SIGNAL_SAFE_H
-#define _USTERR_SIGNAL_SAFE_H
-
-/*
- * Copyright (C) 2009 Pierre-Marc Fournier
- * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; version 2.1 of
- * the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <string.h>
-#include <sys/types.h>
-#include <sys/syscall.h>
-#include <errno.h>
-#include <stdarg.h>
-#include <stdio.h>
-
-#include <ust/core.h>
-
-#include "share.h"
-
-enum ust_loglevel {
- UST_LOGLEVEL_UNKNOWN = 0,
- UST_LOGLEVEL_NORMAL,
- UST_LOGLEVEL_DEBUG,
-};
-
-extern volatile enum ust_loglevel ust_loglevel;
-void init_usterr(void);
-
-static inline int ust_debug(void)
-{
- return ust_loglevel == UST_LOGLEVEL_DEBUG;
-}
-
-#ifndef UST_COMPONENT
-//#error UST_COMPONENT is undefined
-#define UST_COMPONENT libust
-#endif
-
-/* To stringify the expansion of a define */
-#define XSTR(d) STR(d)
-#define STR(s) #s
-
-/* We sometimes print in the tracing path, and tracing can occur in
- * signal handlers, so we must use a print method which is signal safe.
- */
-
-extern int ust_safe_snprintf(char *str, size_t n, const char *fmt, ...)
- __attribute__ ((format (printf, 3, 4)));
-
-static inline void __attribute__ ((format (printf, 1, 2)))
- __check_ust_safe_fmt(const char *fmt, ...)
-{
-}
-
-#define sigsafe_print_err(fmt, args...) \
-{ \
- /* Can't use dynamic allocation. Limit ourselves to 250 chars. */ \
- char ____buf[250]; \
- int ____saved_errno; \
- \
- /* Save the errno. */ \
- ____saved_errno = errno; \
- \
- ust_safe_snprintf(____buf, sizeof(____buf), fmt, ## args); \
- \
- /* Add end of string in case of buffer overflow. */ \
- ____buf[sizeof(____buf) - 1] = 0; \
- \
- patient_write(STDERR_FILENO, ____buf, strlen(____buf)); \
- /* \
- * Can't print errors because we are in the error printing code \
- * path. \
- */ \
- \
- /* Restore errno, in order to be async-signal safe. */ \
- errno = ____saved_errno; \
-}
-
-#define UST_STR_COMPONENT XSTR(UST_COMPONENT)
-
-#define ERRMSG(fmt, args...) \
- do { \
- sigsafe_print_err(UST_STR_COMPONENT "[%ld/%ld]: " fmt " (in %s() at " __FILE__ ":" XSTR(__LINE__) ")\n", \
- (long) getpid(), \
- (long) syscall(SYS_gettid), \
- ## args, __func__); \
- fflush(stderr); \
- } while(0)
-
-#ifdef UST_DEBUG
-# define DBG(fmt, args...) ERRMSG(fmt, ## args)
-# define DBG_raw(fmt, args...) \
- do { \
- sigsafe_print_err(fmt, ## args); \
- fflush(stderr); \
- } while(0)
-#else
-# define DBG(fmt, args...) \
- do { \
- if (ust_debug()) \
- ERRMSG(fmt, ## args); \
- } while (0)
-# define DBG_raw(fmt, args...) \
- do { \
- if (ust_debug()) { \
- sigsafe_print_err(fmt, ## args); \
- fflush(stderr); \
- } \
- } while(0)
-#endif
-#define WARN(fmt, args...) ERRMSG("Warning: " fmt, ## args)
-#define ERR(fmt, args...) ERRMSG("Error: " fmt, ## args)
-#define BUG(fmt, args...) ERRMSG("BUG: " fmt, ## args)
-
-#if (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE)
-#define PERROR(call, args...)\
- do { \
- char buf[200] = "Error in strerror_r()"; \
- strerror_r(errno, buf, sizeof(buf)); \
- ERRMSG("Error: " call ": %s", ## args, buf); \
- } while(0);
-#else
-#define PERROR(call, args...)\
- do { \
- char *buf; \
- char tmp[200]; \
- buf = strerror_r(errno, tmp, sizeof(tmp)); \
- ERRMSG("Error: " call ": %s", ## args, buf); \
- } while(0);
-#endif
-
-#define BUG_ON(condition) \
- do { \
- if (unlikely(condition)) \
- ERR("condition not respected (BUG) on line %s:%d", __FILE__, __LINE__); \
- } while(0)
-#define WARN_ON(condition) \
- do { \
- if (unlikely(condition)) \
- WARN("condition not respected on line %s:%d", __FILE__, __LINE__); \
- } while(0)
-#define WARN_ON_ONCE(condition) WARN_ON(condition)
-
-
-#endif /* _USTERR_SIGNAL_SAFE_H */
#include "ust/core.h"
-#include "usterr_signal_safe.h"
+#include <ust/usterr-signal-safe.h>
#include <ust/ringbuffer-config.h>
#include "backend_types.h"
#include "shm.h"
*/
#include <stdint.h>
+#include <ust/usterr-signal-safe.h>
#include "ust/core.h"
-#include "usterr_signal_safe.h"
#define SHM_MAGIC 0x54335433
#define SHM_MAJOR 0
#include "channels.h"
#include "tracer.h"
#include "tracercore.h"
-#include "usterr_signal_safe.h"
+#include <ust/usterr-signal-safe.h>
struct ltt_reserve_switch_offsets {
long begin, end, old;
#include <ust/lttng-events.h>
#include <ust/core.h>
#include <string.h>
-#include <usterr_signal_safe.h>
+#include <ust/usterr-signal-safe.h>
/*
* Note: as we append context information, the pointer location may change.
#include <sys/shm.h>
#include <sys/ipc.h>
#include <ust/lttng-events.h>
-#include "usterr_signal_safe.h"
+#include <ust/usterr-signal-safe.h>
#include "ust/core.h"
#include "ltt-tracer.h"
#include "ust/wait.h"
" } extended;\n"
" } v;\n"
"} align(%u);\n\n",
- ltt_alignof(uint32_t) * CHAR_BIT,
- ltt_alignof(uint16_t) * CHAR_BIT
+ lttng_alignof(uint32_t) * CHAR_BIT,
+ lttng_alignof(uint16_t) * CHAR_BIT
);
}
" uint32_t stream_id;\n"
" };\n"
"};\n\n",
- ltt_alignof(uint8_t) * CHAR_BIT,
- ltt_alignof(uint16_t) * CHAR_BIT,
- ltt_alignof(uint32_t) * CHAR_BIT,
- ltt_alignof(uint64_t) * CHAR_BIT,
+ lttng_alignof(uint8_t) * CHAR_BIT,
+ lttng_alignof(uint16_t) * CHAR_BIT,
+ lttng_alignof(uint32_t) * CHAR_BIT,
+ lttng_alignof(uint64_t) * CHAR_BIT,
CTF_VERSION_MAJOR,
CTF_VERSION_MINOR,
uuid_s,
switch (ltt_chan->header_type) {
case 1: /* compact */
- padding = lib_ring_buffer_align(offset, ltt_alignof(uint32_t));
+ padding = lib_ring_buffer_align(offset, lttng_alignof(uint32_t));
offset += padding;
if (!(ctx->rflags & (RING_BUFFER_RFLAG_FULL_TSC | LTT_RFLAG_EXTENDED))) {
offset += sizeof(uint32_t); /* id and timestamp */
/* Minimum space taken by 5-bit id */
offset += sizeof(uint8_t);
/* Align extended struct on largest member */
- offset += lib_ring_buffer_align(offset, ltt_alignof(uint64_t));
+ offset += lib_ring_buffer_align(offset, lttng_alignof(uint64_t));
offset += sizeof(uint32_t); /* id */
- offset += lib_ring_buffer_align(offset, ltt_alignof(uint64_t));
+ offset += lib_ring_buffer_align(offset, lttng_alignof(uint64_t));
offset += sizeof(uint64_t); /* timestamp */
}
break;
case 2: /* large */
- padding = lib_ring_buffer_align(offset, ltt_alignof(uint16_t));
+ padding = lib_ring_buffer_align(offset, lttng_alignof(uint16_t));
offset += padding;
offset += sizeof(uint16_t);
if (!(ctx->rflags & (RING_BUFFER_RFLAG_FULL_TSC | LTT_RFLAG_EXTENDED))) {
- offset += lib_ring_buffer_align(offset, ltt_alignof(uint32_t));
+ offset += lib_ring_buffer_align(offset, lttng_alignof(uint32_t));
offset += sizeof(uint32_t); /* timestamp */
} else {
/* Align extended struct on largest member */
- offset += lib_ring_buffer_align(offset, ltt_alignof(uint64_t));
+ offset += lib_ring_buffer_align(offset, lttng_alignof(uint64_t));
offset += sizeof(uint32_t); /* id */
- offset += lib_ring_buffer_align(offset, ltt_alignof(uint64_t));
+ offset += lib_ring_buffer_align(offset, lttng_alignof(uint64_t));
offset += sizeof(uint64_t); /* timestamp */
}
break;
uint16_t id = event_id;
lib_ring_buffer_write(config, ctx, &id, sizeof(id));
- lib_ring_buffer_align_ctx(ctx, ltt_alignof(uint32_t));
+ lib_ring_buffer_align_ctx(ctx, lttng_alignof(uint32_t));
lib_ring_buffer_write(config, ctx, ×tamp, sizeof(timestamp));
break;
}
bt_bitfield_write(&id, uint8_t, 0, 5, 31);
lib_ring_buffer_write(config, ctx, &id, sizeof(id));
/* Align extended struct on largest member */
- lib_ring_buffer_align_ctx(ctx, ltt_alignof(uint64_t));
+ lib_ring_buffer_align_ctx(ctx, lttng_alignof(uint64_t));
lib_ring_buffer_write(config, ctx, &event_id, sizeof(event_id));
- lib_ring_buffer_align_ctx(ctx, ltt_alignof(uint64_t));
+ lib_ring_buffer_align_ctx(ctx, lttng_alignof(uint64_t));
lib_ring_buffer_write(config, ctx, ×tamp, sizeof(timestamp));
}
break;
uint16_t id = event_id;
lib_ring_buffer_write(config, ctx, &id, sizeof(id));
- lib_ring_buffer_align_ctx(ctx, ltt_alignof(uint32_t));
+ lib_ring_buffer_align_ctx(ctx, lttng_alignof(uint32_t));
lib_ring_buffer_write(config, ctx, ×tamp, sizeof(timestamp));
} else {
uint16_t id = 65535;
lib_ring_buffer_write(config, ctx, &id, sizeof(id));
/* Align extended struct on largest member */
- lib_ring_buffer_align_ctx(ctx, ltt_alignof(uint64_t));
+ lib_ring_buffer_align_ctx(ctx, lttng_alignof(uint64_t));
lib_ring_buffer_write(config, ctx, &event_id, sizeof(event_id));
- lib_ring_buffer_align_ctx(ctx, ltt_alignof(uint64_t));
+ lib_ring_buffer_align_ctx(ctx, lttng_alignof(uint64_t));
lib_ring_buffer_write(config, ctx, ×tamp, sizeof(timestamp));
}
break;
#include <ust/kcompat/kcompat.h>
#include <ust/core.h>
+#include <ust/lttng-tracer.h>
#include <urcu/list.h>
-
-#ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
-/* Align data on its natural alignment */
-#define RING_BUFFER_ALIGN
-#endif
-
-#include "usterr_signal_safe.h"
+#include <ust/usterr-signal-safe.h>
#include "ust/bug.h"
+
#include <ust/ringbuffer-config.h>
struct ltt_session;
#include <ust/lttng-events.h>
#include "ltt-tracer-core.h"
-#define LTTNG_UST_VERSION 0
-#define LTTNG_UST_PATCHLEVEL 9
-#define LTTNG_UST_SUBLEVEL 1
-
-#ifndef CHAR_BIT
-#define CHAR_BIT 8
-#endif
-
/* Number of bytes to log with a read/write event */
#define LTT_LOG_RW_SIZE 32L
#define LTT_MAX_SMALL_SIZE 0xFFFFU
-#ifdef RING_BUFFER_ALIGN
-#define ltt_alignof(type) __alignof__(type)
-#else
-#define ltt_alignof(type) 1
-#endif
-
/* Tracer properties */
#define CTF_MAGIC_NUMBER 0xC1FC1FC1
#define TSDL_MAGIC_NUMBER 0x75D11D57
#include <urcu/compiler.h>
#include <urcu/list.h>
#include <ust/lttng-events.h>
-#include "usterr_signal_safe.h"
+#include <ust/usterr-signal-safe.h>
#include "ust/core.h"
#include "ltt-tracer.h"
#include <urcu-bp.h>
#include <urcu/hlist.h>
-#include "usterr_signal_safe.h"
+#include <ust/usterr-signal-safe.h>
extern struct tracepoint * const __start___tracepoints_ptrs[]
__attribute__((visibility("hidden")));
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <usterr_signal_safe.h>
+#include <ust/usterr-signal-safe.h>
#include <stdlib.h>
volatile enum ust_loglevel ust_loglevel;
#include <ust/tracepoint.h>
TRACEPOINT_EVENT(ust_tests_hello_tptest,
- TP_PROTO(int anint),
- TP_ARGS(anint),
- TP_FIELDS())
+ TP_PROTO(int anint),
+ TP_ARGS(anint),
+ TP_FIELDS(
+ ctf_integer(int, intfield, anint)
+ ))
TRACEPOINT_EVENT_NOARGS(ust_tests_hello_tptest_sighandler,
TP_FIELDS())