1 #ifndef _LTT_TYPE_SERIALIZER_H
2 #define _LTT_TYPE_SERIALIZER_H
4 #include <ust/marker.h>
5 #include <ust/marker-internal.h>
10 * largest_align must be non-zero, equal to the minimum between the largest type
13 extern void _ltt_specialized_trace(const struct ust_marker
*mdata
, void *probe_data
,
14 void *serialize_private
, unsigned int data_size
,
15 unsigned int largest_align
);
18 * Statically check that 0 < largest_align < sizeof(void *) to make sure it is
19 * dumb-proof. It will make sure 0 is changed into 1 and unsigned long long is
20 * changed into sizeof(void *) on 32-bit architectures.
22 static inline void ltt_specialized_trace(const struct ust_marker
*mdata
,
24 void *serialize_private
, unsigned int data_size
,
25 unsigned int largest_align
)
27 largest_align
= min_t(unsigned int, largest_align
, sizeof(void *));
28 largest_align
= max_t(unsigned int, largest_align
, 1);
29 _ltt_specialized_trace(mdata
, probe_data
, serialize_private
, data_size
,
34 * Type serializer definitions.
38 * Return size of structure without end-of-structure padding.
40 #define serialize_sizeof(type) offsetof(typeof(type), end_field)
42 struct serialize_long_int
{
45 unsigned char end_field
[0];
48 struct serialize_int_int_long
{
52 unsigned char end_field
[0];
55 struct serialize_int_int_short
{
59 unsigned char end_field
[0];
62 struct serialize_long_long_long
{
66 unsigned char end_field
[0];
69 struct serialize_long_long_int
{
73 unsigned char end_field
[0];
76 struct serialize_long_long_short_char
{
81 unsigned char end_field
[0];
84 struct serialize_long_long_short
{
88 unsigned char end_field
[0];
91 struct serialize_long_short_char
{
95 unsigned char end_field
[0];
98 struct serialize_long_short
{
101 unsigned char end_field
[0];
104 struct serialize_long_char
{
107 unsigned char end_field
[0];
110 struct serialize_sizet_int
{
113 unsigned char end_field
[0];
116 struct serialize_long_long_sizet_int
{
121 unsigned char end_field
[0];
124 struct serialize_long_long_sizet_int_int
{
130 unsigned char end_field
[0];
133 struct serialize_l4421224411111
{
148 unsigned char end_field
[0];
151 struct serialize_l214421224411111
{
168 uint8_t end_field
[0];
171 struct serialize_l4412228
{
180 unsigned char end_field
[0];
183 #endif /* _LTT_TYPE_SERIALIZER_H */