1 #ifndef _LTT_TYPE_SERIALIZER_H
2 #define _LTT_TYPE_SERIALIZER_H
4 //ust// #include "tracer.h"
5 #include <ust/marker.h>
9 * largest_align must be non-zero, equal to the minimum between the largest type
12 extern void _ltt_specialized_trace(const struct ust_marker
*mdata
, void *probe_data
,
13 void *serialize_private
, unsigned int data_size
,
14 unsigned int largest_align
);
17 * Statically check that 0 < largest_align < sizeof(void *) to make sure it is
18 * dumb-proof. It will make sure 0 is changed into 1 and unsigned long long is
19 * changed into sizeof(void *) on 32-bit architectures.
21 static inline void ltt_specialized_trace(const struct ust_marker
*mdata
,
23 void *serialize_private
, unsigned int data_size
,
24 unsigned int largest_align
)
26 largest_align
= min_t(unsigned int, largest_align
, sizeof(void *));
27 largest_align
= max_t(unsigned int, largest_align
, 1);
28 _ltt_specialized_trace(mdata
, probe_data
, serialize_private
, data_size
,
33 * Type serializer definitions.
37 * Return size of structure without end-of-structure padding.
39 #define serialize_sizeof(type) offsetof(typeof(type), end_field)
41 struct serialize_long_int
{
44 unsigned char end_field
[0];
47 struct serialize_int_int_long
{
51 unsigned char end_field
[0];
54 struct serialize_int_int_short
{
58 unsigned char end_field
[0];
61 struct serialize_long_long_long
{
65 unsigned char end_field
[0];
68 struct serialize_long_long_int
{
72 unsigned char end_field
[0];
75 struct serialize_long_long_short_char
{
80 unsigned char end_field
[0];
83 struct serialize_long_long_short
{
87 unsigned char end_field
[0];
90 struct serialize_long_short_char
{
94 unsigned char end_field
[0];
97 struct serialize_long_short
{
100 unsigned char end_field
[0];
103 struct serialize_long_char
{
106 unsigned char end_field
[0];
109 struct serialize_sizet_int
{
112 unsigned char end_field
[0];
115 struct serialize_long_long_sizet_int
{
120 unsigned char end_field
[0];
123 struct serialize_long_long_sizet_int_int
{
129 unsigned char end_field
[0];
132 struct serialize_l4421224411111
{
147 unsigned char end_field
[0];
150 struct serialize_l214421224411111
{
167 uint8_t end_field
[0];
170 struct serialize_l4412228
{
179 unsigned char end_field
[0];
181 #endif /* _LTT_TYPE_SERIALIZER_H */