ust/tracepoint.h \
ust/define_trace.h \
ust/ust_trace.h \
- ust/processor.h \
- ust/probe.h \
- ust/ust.h \
ust/tracectl.h \
ust/config.h \
+ ust/stringify.h \
+ ust/ustctl.h \
+ ust/ustconsumer.h
+
+noinst_HEADERS = \
+ share.h \
+ usterr.h \
+ ust_snprintf.h \
+ usterr_signal_safe.h \
ust/core.h \
+ ust/marker-internal.h \
+ ust/tracepoint-internal.h \
ust/clock.h \
+ ust/probe.h \
+ ust/processor.h \
ust/kcompat/kcompat.h \
- ust/kcompat/compiler.h \
ust/kcompat/jhash.h \
+ ust/kcompat/compiler.h \
ust/kcompat/simple.h \
- ust/kcompat/types.h \
- ust/kcompat/stringify.h \
- ust/ustctl.h \
- ust/ustconsumer.h
-
-noinst_HEADERS = share.h usterr.h ust_snprintf.h usterr_signal_safe.h \
- ust/marker-internal.h ust/tracepoint-internal.h \
- ust/type-serializer.h
+ ust/kcompat/types.h
#include <time.h>
#include <sys/time.h>
-#include <ust/kcompat/kcompat.h>
+#include <stdint.h>
+#include <stddef.h>
+#include <ust/core.h>
/* TRACE CLOCK */
#define CLOCK_TRACE 15
union lttng_timespec {
struct timespec ts;
- u64 lttng_ts;
+ uint64_t lttng_ts;
};
extern int ust_clock_source;
/* Choosing correct trace clock */
-static __inline__ u64 trace_clock_read64(void)
+static __inline__ uint64_t trace_clock_read64(void)
{
struct timespec ts;
- u64 retval;
+ uint64_t retval;
union lttng_timespec *lts = (union lttng_timespec *) &ts;
clock_gettime(ust_clock_source, &ts);
}
#if __i386__ || __x86_64__
-static __inline__ u64 trace_clock_frequency(void)
+static __inline__ uint64_t trace_clock_frequency(void)
{
struct timespec ts;
union lttng_timespec *lts = (union lttng_timespec *) &ts;
return 1000000000LL;
}
#else /* #if __i386__ || __x86_64__ */
-static __inline__ u64 trace_clock_frequency(void)
+static __inline__ uint64_t trace_clock_frequency(void)
{
return 1000000000LL;
}
#endif /* #else #if __i386__ || __x86_64__ */
-static __inline__ u32 trace_clock_freq_scale(void)
+static __inline__ uint32_t trace_clock_freq_scale(void)
{
return 1;
}
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
-#ifndef HAVE_EFFICIENT_UNALIGNED_ACCESS
-
-/*
- * Calculate the offset needed to align the type.
- * size_of_type must be non-zero.
- */
-static inline unsigned int ltt_align(size_t align_drift, size_t size_of_type)
-{
- size_t alignment = min(sizeof(void *), size_of_type);
- return (alignment - align_drift) & (alignment - 1);
-}
-/* Default arch alignment */
-#define LTT_ALIGN
-
-static inline int ltt_get_alignment(void)
-{
- return sizeof(void *);
-}
-
-#else /* HAVE_EFFICIENT_UNALIGNED_ACCESS */
-
-static inline unsigned int ltt_align(size_t align_drift,
- size_t size_of_type)
-{
- return 0;
-}
-
-#define LTT_ALIGN __attribute__((packed))
-
-static inline int ltt_get_alignment(void)
-{
- return 0;
-}
-#endif /* HAVE_EFFICIENT_UNALIGNED_ACCESS */
-
-
/* ARRAYS */
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
/*
* Copyright (C) 2009 Steven Rostedt <srostedt@redhat.com>
+ * 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
/* Prevent recursion */
#undef TRACEPOINT_CREATE_PROBES
-#include <ust/kcompat/stringify.h>
+#include <ust/stringify.h>
#undef TRACEPOINT_EVENT
#define TRACEPOINT_EVENT(name, proto, args, fields) \
+++ /dev/null
-#ifndef __LINUX_STRINGIFY_H
-#define __LINUX_STRINGIFY_H
-/*
- * Copyright (C) 2009 Zhaolei <zhaolei@cn.fujitsu.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
-
- */
-
-/* Indirect stringification. Doing two levels allows the parameter to be a
- * macro itself. For example, compile with -DFOO=bar, __stringify(FOO)
- * converts to "bar".
- */
-
-#define __stringify_1(x...) #x
-#define __stringify(x...) __stringify_1(x)
-
-#endif /* !__LINUX_STRINGIFY_H */
*/
#include <stdarg.h>
+#include <stdint.h>
+#include <stddef.h>
#include <bits/wordsize.h>
#include <urcu/list.h>
-#include <ust/core.h>
-#include <ust/kcompat/kcompat.h>
struct ust_marker;
char state; /* State. */
char ptype; /* probe type : 0 : single, 1 : multi */
/* Probe wrapper */
- u16 channel_id; /* Numeric channel identifier, dynamic */
- u16 event_id; /* Numeric event identifier, dynamic */
+ uint16_t channel_id; /* Numeric channel identifier, dynamic */
+ uint16_t event_id; /* Numeric event identifier, dynamic */
void (*call)(const struct ust_marker *mdata, void *call_private, ...);
struct ust_marker_probe_closure single;
struct ust_marker_probe_closure *multi;
do { \
_DEFINE_UST_MARKER(channel, name, NULL, NULL, format); \
__ust_marker_check_format(format, ## args); \
- if (unlikely(__ust_marker_def_##name.state)) \
+ if (__builtin_expect(!!(__ust_marker_def_##name.state), 0)) \
(__ust_marker_def_##name.call) \
(&__ust_marker_def_##name, call_private,\
## args); \
/* To be used for string format validity checking with gcc */
static inline
-void __printf(1, 2) ___ust_marker_check_format(const char *fmt, ...)
+void __attribute__((format(printf, 1, 2)))
+ ___ust_marker_check_format(const char *fmt, ...)
{
}
--- /dev/null
+#ifndef __LINUX_STRINGIFY_H
+#define __LINUX_STRINGIFY_H
+/*
+ * Copyright (C) 2009 Zhaolei <zhaolei@cn.fujitsu.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
+ */
+
+/* Indirect stringification. Doing two levels allows the parameter to be a
+ * macro itself. For example, compile with -DFOO=bar, __stringify(FOO)
+ * converts to "bar".
+ */
+
+#define __stringify_1(x...) #x
+#define __stringify(x...) __stringify_1(x)
+
+#endif /* !__LINUX_STRINGIFY_H */
*/
#include <urcu-bp.h>
-#include <ust/core.h>
#include <urcu/list.h>
struct tracepoint_probe {
+++ /dev/null
-#ifndef _LTT_TYPE_SERIALIZER_H
-#define _LTT_TYPE_SERIALIZER_H
-
-#include <ust/marker.h>
-#include <ust/marker-internal.h>
-#include <ust/core.h>
-
-/*
- * largest_align must be non-zero, equal to the minimum between the largest type
- * and sizeof(void *).
- */
-extern void _ltt_specialized_trace(const struct ust_marker *mdata, void *probe_data,
- void *serialize_private, unsigned int data_size,
- unsigned int largest_align);
-
-/*
- * Statically check that 0 < largest_align < sizeof(void *) to make sure it is
- * dumb-proof. It will make sure 0 is changed into 1 and unsigned long long is
- * changed into sizeof(void *) on 32-bit architectures.
- */
-static inline void ltt_specialized_trace(const struct ust_marker *mdata,
- void *probe_data,
- void *serialize_private, unsigned int data_size,
- unsigned int largest_align)
-{
- largest_align = min_t(unsigned int, largest_align, sizeof(void *));
- largest_align = max_t(unsigned int, largest_align, 1);
- _ltt_specialized_trace(mdata, probe_data, serialize_private, data_size,
- largest_align);
-}
-
-/*
- * Type serializer definitions.
- */
-
-/*
- * Return size of structure without end-of-structure padding.
- */
-#define serialize_sizeof(type) offsetof(typeof(type), end_field)
-
-struct serialize_long_int {
- unsigned long f1;
- unsigned int f2;
- unsigned char end_field[0];
-} LTT_ALIGN;
-
-struct serialize_int_int_long {
- unsigned int f1;
- unsigned int f2;
- unsigned long f3;
- unsigned char end_field[0];
-} LTT_ALIGN;
-
-struct serialize_int_int_short {
- unsigned int f1;
- unsigned int f2;
- unsigned short f3;
- unsigned char end_field[0];
-} LTT_ALIGN;
-
-struct serialize_long_long_long {
- unsigned long f1;
- unsigned long f2;
- unsigned long f3;
- unsigned char end_field[0];
-} LTT_ALIGN;
-
-struct serialize_long_long_int {
- unsigned long f1;
- unsigned long f2;
- unsigned int f3;
- unsigned char end_field[0];
-} LTT_ALIGN;
-
-struct serialize_long_long_short_char {
- unsigned long f1;
- unsigned long f2;
- unsigned short f3;
- unsigned char f4;
- unsigned char end_field[0];
-} LTT_ALIGN;
-
-struct serialize_long_long_short {
- unsigned long f1;
- unsigned long f2;
- unsigned short f3;
- unsigned char end_field[0];
-} LTT_ALIGN;
-
-struct serialize_long_short_char {
- unsigned long f1;
- unsigned short f2;
- unsigned char f3;
- unsigned char end_field[0];
-} LTT_ALIGN;
-
-struct serialize_long_short {
- unsigned long f1;
- unsigned short f2;
- unsigned char end_field[0];
-} LTT_ALIGN;
-
-struct serialize_long_char {
- unsigned long f1;
- unsigned char f2;
- unsigned char end_field[0];
-} LTT_ALIGN;
-
-struct serialize_sizet_int {
- size_t f1;
- unsigned int f2;
- unsigned char end_field[0];
-} LTT_ALIGN;
-
-struct serialize_long_long_sizet_int {
- unsigned long f1;
- unsigned long f2;
- size_t f3;
- unsigned int f4;
- unsigned char end_field[0];
-} LTT_ALIGN;
-
-struct serialize_long_long_sizet_int_int {
- unsigned long f1;
- unsigned long f2;
- size_t f3;
- unsigned int f4;
- unsigned int f5;
- unsigned char end_field[0];
-} LTT_ALIGN;
-
-struct serialize_l4421224411111 {
- unsigned long f1;
- uint32_t f2;
- uint32_t f3;
- uint16_t f4;
- uint8_t f5;
- uint16_t f6;
- uint16_t f7;
- uint32_t f8;
- uint32_t f9;
- uint8_t f10;
- uint8_t f11;
- uint8_t f12;
- uint8_t f13;
- uint8_t f14;
- unsigned char end_field[0];
-} LTT_ALIGN;
-
-struct serialize_l214421224411111 {
- unsigned long f1;
- uint16_t f2;
- uint8_t f3;
- uint32_t f4;
- uint32_t f5;
- uint16_t f6;
- uint8_t f7;
- uint16_t f8;
- uint16_t f9;
- uint32_t f10;
- uint32_t f11;
- uint8_t f12;
- uint8_t f13;
- uint8_t f14;
- uint8_t f15;
- uint8_t f16;
- uint8_t end_field[0];
-} LTT_ALIGN;
-
-struct serialize_l4412228 {
- unsigned long f1;
- uint32_t f2;
- uint32_t f3;
- uint8_t f4;
- uint16_t f5;
- uint16_t f6;
- uint16_t f7;
- uint64_t f8;
- unsigned char end_field[0];
-} LTT_ALIGN;
-
-#endif /* _LTT_TYPE_SERIALIZER_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_H
-#define UST_H
-
-#include <ust/marker.h>
-#include <ust/processor.h>
-#include <ust/tracepoint.h>
-#include <ust/probe.h>
-#include <ust/core.h>
-
-#endif /* UST_H */
#include <pthread.h>
#include <dirent.h>
-#include <ust/kcompat/kcompat.h>
+#include <unistd.h>
#include <urcu/list.h>
#define USTCONSUMER_DEFAULT_TRACE_PATH "/tmp/usttrace"
long consumed_old;
- s64 pidunique;
+ int64_t pidunique;
void *user_data;
};
serialize.c \
tracectl.c \
tracerconst.h \
- header-inline.h \
+ type-serializer.h \
type-serializer.c
libust_la_LDFLAGS = -no-undefined -version-info 0:0:0
#include "channels.h"
#include "tracerconst.h"
#include "tracercore.h"
-#include "header-inline.h"
/***** FIXME: SHOULD BE REMOVED ***** */
extern void ltt_force_switch_lockless_slow(struct ust_buffer *buf,
enum force_switch_mode mode);
+#ifndef HAVE_EFFICIENT_UNALIGNED_ACCESS
+
+/*
+ * Calculate the offset needed to align the type.
+ * size_of_type must be non-zero.
+ */
+static inline unsigned int ltt_align(size_t align_drift, size_t size_of_type)
+{
+ size_t alignment = min(sizeof(void *), size_of_type);
+ return (alignment - align_drift) & (alignment - 1);
+}
+/* Default arch alignment */
+#define LTT_ALIGN
+
+static inline int ltt_get_alignment(void)
+{
+ return sizeof(void *);
+}
+
+#else /* HAVE_EFFICIENT_UNALIGNED_ACCESS */
+
+static inline unsigned int ltt_align(size_t align_drift,
+ size_t size_of_type)
+{
+ return 0;
+}
+
+#define LTT_ALIGN __attribute__((packed))
+
+static inline int ltt_get_alignment(void)
+{
+ return 0;
+}
+#endif /* HAVE_EFFICIENT_UNALIGNED_ACCESS */
static __inline__ void ust_buffers_do_copy(void *dest, const void *src, size_t len)
{
}
#endif
+/*
+ * ust_get_header_size
+ *
+ * Calculate alignment offset to 32-bits. This is the alignment offset of the
+ * event header.
+ *
+ * Important note :
+ * The event header must be 32-bits. The total offset calculated here :
+ *
+ * Alignment of header struct on 32 bits (min arch size, header size)
+ * + sizeof(header struct) (32-bits)
+ * + (opt) u16 (ext. event id)
+ * + (opt) u16 (event_size) (if event_size == 0xFFFFUL, has ext. event size)
+ * + (opt) u32 (ext. event size)
+ * + (opt) u64 full TSC (aligned on min(64-bits, arch size))
+ *
+ * The payload must itself determine its own alignment from the biggest type it
+ * contains.
+ * */
+static __inline__ unsigned char ust_get_header_size(
+ struct ust_channel *channel,
+ size_t offset,
+ size_t data_size,
+ size_t *before_hdr_pad,
+ unsigned int rflags)
+{
+ size_t orig_offset = offset;
+ size_t padding;
+
+ padding = ltt_align(offset, sizeof(struct ltt_event_header));
+ offset += padding;
+ offset += sizeof(struct ltt_event_header);
+
+ if(unlikely(rflags)) {
+ switch (rflags) {
+ case LTT_RFLAG_ID_SIZE_TSC:
+ offset += sizeof(u16) + sizeof(u16);
+ if (data_size >= 0xFFFFU)
+ offset += sizeof(u32);
+ offset += ltt_align(offset, sizeof(u64));
+ offset += sizeof(u64);
+ break;
+ case LTT_RFLAG_ID_SIZE:
+ offset += sizeof(u16) + sizeof(u16);
+ if (data_size >= 0xFFFFU)
+ offset += sizeof(u32);
+ break;
+ case LTT_RFLAG_ID:
+ offset += sizeof(u16);
+ break;
+ }
+ }
+
+ *before_hdr_pad = padding;
+ return offset - orig_offset;
+}
+
static __inline__ void ltt_reserve_push_reader(
struct ust_channel *rchan,
struct ust_buffer *buf,
+++ /dev/null
-/*
- * Copyright (C) 2008 - Mathieu Desnoyers (mathieu.desnoyers@polymtl.ca)
- *
- * 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_HEADER_INLINE_H
-#define UST_HEADER_INLINE_H
-
-#include <ust/core.h>
-
-/*
- * ust_get_header_size
- *
- * Calculate alignment offset to 32-bits. This is the alignment offset of the
- * event header.
- *
- * Important note :
- * The event header must be 32-bits. The total offset calculated here :
- *
- * Alignment of header struct on 32 bits (min arch size, header size)
- * + sizeof(header struct) (32-bits)
- * + (opt) u16 (ext. event id)
- * + (opt) u16 (event_size) (if event_size == 0xFFFFUL, has ext. event size)
- * + (opt) u32 (ext. event size)
- * + (opt) u64 full TSC (aligned on min(64-bits, arch size))
- *
- * The payload must itself determine its own alignment from the biggest type it
- * contains.
- * */
-static __inline__ unsigned char ust_get_header_size(
- struct ust_channel *channel,
- size_t offset,
- size_t data_size,
- size_t *before_hdr_pad,
- unsigned int rflags)
-{
- size_t orig_offset = offset;
- size_t padding;
-
- padding = ltt_align(offset, sizeof(struct ltt_event_header));
- offset += padding;
- offset += sizeof(struct ltt_event_header);
-
- if(unlikely(rflags)) {
- switch (rflags) {
- case LTT_RFLAG_ID_SIZE_TSC:
- offset += sizeof(u16) + sizeof(u16);
- if (data_size >= 0xFFFFU)
- offset += sizeof(u32);
- offset += ltt_align(offset, sizeof(u64));
- offset += sizeof(u64);
- break;
- case LTT_RFLAG_ID_SIZE:
- offset += sizeof(u16) + sizeof(u16);
- if (data_size >= 0xFFFFU)
- offset += sizeof(u32);
- break;
- case LTT_RFLAG_ID:
- offset += sizeof(u16);
- break;
- }
- }
-
- *before_hdr_pad = padding;
- return offset - orig_offset;
-}
-
-#endif /* UST_HEADER_INLINE_H */
#define _GNU_SOURCE
#define _LGPL_SOURCE
#include <urcu/rculist.h>
-#include <ust/type-serializer.h>
#include <ust/core.h>
#include <ust/clock.h>
#include <urcu-bp.h>
#include "tracer.h"
+#include "type-serializer.h"
notrace
void _ltt_specialized_trace(const struct ust_marker *mdata, void *probe_data,
--- /dev/null
+#ifndef _LTT_TYPE_SERIALIZER_H
+#define _LTT_TYPE_SERIALIZER_H
+
+#include <ust/marker.h>
+#include <ust/marker-internal.h>
+#include <ust/core.h>
+#include "buffers.h"
+
+/*
+ * largest_align must be non-zero, equal to the minimum between the largest type
+ * and sizeof(void *).
+ */
+extern void _ltt_specialized_trace(const struct ust_marker *mdata, void *probe_data,
+ void *serialize_private, unsigned int data_size,
+ unsigned int largest_align);
+
+/*
+ * Statically check that 0 < largest_align < sizeof(void *) to make sure it is
+ * dumb-proof. It will make sure 0 is changed into 1 and unsigned long long is
+ * changed into sizeof(void *) on 32-bit architectures.
+ */
+static inline void ltt_specialized_trace(const struct ust_marker *mdata,
+ void *probe_data,
+ void *serialize_private, unsigned int data_size,
+ unsigned int largest_align)
+{
+ largest_align = min_t(unsigned int, largest_align, sizeof(void *));
+ largest_align = max_t(unsigned int, largest_align, 1);
+ _ltt_specialized_trace(mdata, probe_data, serialize_private, data_size,
+ largest_align);
+}
+
+/*
+ * Type serializer definitions.
+ */
+
+/*
+ * Return size of structure without end-of-structure padding.
+ */
+#define serialize_sizeof(type) offsetof(typeof(type), end_field)
+
+struct serialize_long_int {
+ unsigned long f1;
+ unsigned int f2;
+ unsigned char end_field[0];
+} LTT_ALIGN;
+
+struct serialize_int_int_long {
+ unsigned int f1;
+ unsigned int f2;
+ unsigned long f3;
+ unsigned char end_field[0];
+} LTT_ALIGN;
+
+struct serialize_int_int_short {
+ unsigned int f1;
+ unsigned int f2;
+ unsigned short f3;
+ unsigned char end_field[0];
+} LTT_ALIGN;
+
+struct serialize_long_long_long {
+ unsigned long f1;
+ unsigned long f2;
+ unsigned long f3;
+ unsigned char end_field[0];
+} LTT_ALIGN;
+
+struct serialize_long_long_int {
+ unsigned long f1;
+ unsigned long f2;
+ unsigned int f3;
+ unsigned char end_field[0];
+} LTT_ALIGN;
+
+struct serialize_long_long_short_char {
+ unsigned long f1;
+ unsigned long f2;
+ unsigned short f3;
+ unsigned char f4;
+ unsigned char end_field[0];
+} LTT_ALIGN;
+
+struct serialize_long_long_short {
+ unsigned long f1;
+ unsigned long f2;
+ unsigned short f3;
+ unsigned char end_field[0];
+} LTT_ALIGN;
+
+struct serialize_long_short_char {
+ unsigned long f1;
+ unsigned short f2;
+ unsigned char f3;
+ unsigned char end_field[0];
+} LTT_ALIGN;
+
+struct serialize_long_short {
+ unsigned long f1;
+ unsigned short f2;
+ unsigned char end_field[0];
+} LTT_ALIGN;
+
+struct serialize_long_char {
+ unsigned long f1;
+ unsigned char f2;
+ unsigned char end_field[0];
+} LTT_ALIGN;
+
+struct serialize_sizet_int {
+ size_t f1;
+ unsigned int f2;
+ unsigned char end_field[0];
+} LTT_ALIGN;
+
+struct serialize_long_long_sizet_int {
+ unsigned long f1;
+ unsigned long f2;
+ size_t f3;
+ unsigned int f4;
+ unsigned char end_field[0];
+} LTT_ALIGN;
+
+struct serialize_long_long_sizet_int_int {
+ unsigned long f1;
+ unsigned long f2;
+ size_t f3;
+ unsigned int f4;
+ unsigned int f5;
+ unsigned char end_field[0];
+} LTT_ALIGN;
+
+struct serialize_l4421224411111 {
+ unsigned long f1;
+ uint32_t f2;
+ uint32_t f3;
+ uint16_t f4;
+ uint8_t f5;
+ uint16_t f6;
+ uint16_t f7;
+ uint32_t f8;
+ uint32_t f9;
+ uint8_t f10;
+ uint8_t f11;
+ uint8_t f12;
+ uint8_t f13;
+ uint8_t f14;
+ unsigned char end_field[0];
+} LTT_ALIGN;
+
+struct serialize_l214421224411111 {
+ unsigned long f1;
+ uint16_t f2;
+ uint8_t f3;
+ uint32_t f4;
+ uint32_t f5;
+ uint16_t f6;
+ uint8_t f7;
+ uint16_t f8;
+ uint16_t f9;
+ uint32_t f10;
+ uint32_t f11;
+ uint8_t f12;
+ uint8_t f13;
+ uint8_t f14;
+ uint8_t f15;
+ uint8_t f16;
+ uint8_t end_field[0];
+} LTT_ALIGN;
+
+struct serialize_l4412228 {
+ unsigned long f1;
+ uint32_t f2;
+ uint32_t f3;
+ uint8_t f4;
+ uint16_t f5;
+ uint16_t f6;
+ uint16_t f7;
+ uint64_t f8;
+ unsigned char end_field[0];
+} LTT_ALIGN;
+
+#endif /* _LTT_TYPE_SERIALIZER_H */
pthread_mutex_unlock(&instance->mutex);
}
-static int get_pidunique(int sock, s64 *pidunique)
+static int get_pidunique(int sock, int64_t *pidunique)
{
struct ustcomm_header _send_hdr, *send_hdr;
struct ustcomm_header _recv_hdr, *recv_hdr;
#include <unistd.h>
#include <stdio.h>
#include <signal.h>
-#include <ust/ust.h>
#include <sched.h>
#include <stdarg.h>
#include <ust/tracectl.h>
#include <signal.h>
#include <string.h>
-#include <ust/ust.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <ust/marker.h>
int main(int argc, char *argv[])
{
#include <string.h>
#include <stdlib.h>
-#include <ust/ust.h>
+#include <ust/marker.h>
#define N_ITER 100000
#define TRACEPOINT_CREATE_PROBES
#include "tracepoint_benchmark.h"
-#include <ust/type-serializer.h>
+
+/* Yes, this is now internal. */
+#include "../../../libust/type-serializer.h"
#define NR_EVENTS 10000000
#include <fcntl.h>
#include <unistd.h>
#include <signal.h>
+#include <inttypes.h>
#include <stdlib.h>
#include <stdio.h>
trace_path = USTCONSUMER_DEFAULT_TRACE_PATH;
}
- if (asprintf(&tmp, "%s/%u_%lld", trace_path, buf->pid, buf->pidunique) < 0) {
- ERR("on_open_buffer : asprintf failed (%s/%u_%lld)",
+ if (asprintf(&tmp, "%s/%u_%" PRId64 "", trace_path, buf->pid, buf->pidunique) < 0) {
+ ERR("on_open_buffer : asprintf failed (%s/%u_%" PRId64 ")",
trace_path, buf->pid, buf->pidunique);
return 1;
}
}
free(tmp);
- if (asprintf(&tmp, "%s/%u_%lld/%s", trace_path, buf->pid, buf->pidunique, buf->name) < 0) {
- ERR("on_open_buffer : asprintf failed (%s/%u_%lld/%s)",
+ if (asprintf(&tmp, "%s/%u_%" PRId64 "/%s", trace_path, buf->pid, buf->pidunique, buf->name) < 0) {
+ ERR("on_open_buffer : asprintf failed (%s/%u_%" PRId64 "/%s)",
trace_path, buf->pid, buf->pidunique, buf->name);
return 1;
}