1 #ifndef UST_HEADER_INLINE_H
2 #define UST_HEADER_INLINE_H
4 #include "tracercore.h"
9 * Calculate alignment offset to 32-bits. This is the alignment offset of the
13 * The event header must be 32-bits. The total offset calculated here :
15 * Alignment of header struct on 32 bits (min arch size, header size)
16 * + sizeof(header struct) (32-bits)
17 * + (opt) u16 (ext. event id)
18 * + (opt) u16 (event_size) (if event_size == 0xFFFFUL, has ext. event size)
19 * + (opt) u32 (ext. event size)
20 * + (opt) u64 full TSC (aligned on min(64-bits, arch size))
22 * The payload must itself determine its own alignment from the biggest type it
25 static __inline__
unsigned char ust_get_header_size(
26 struct ust_channel
*channel
,
29 size_t *before_hdr_pad
,
32 size_t orig_offset
= offset
;
35 padding
= ltt_align(offset
, sizeof(struct ltt_event_header
));
37 offset
+= sizeof(struct ltt_event_header
);
39 if(unlikely(rflags
)) {
41 case LTT_RFLAG_ID_SIZE_TSC
:
42 offset
+= sizeof(u16
) + sizeof(u16
);
43 if (data_size
>= 0xFFFFU
)
44 offset
+= sizeof(u32
);
45 offset
+= ltt_align(offset
, sizeof(u64
));
46 offset
+= sizeof(u64
);
48 case LTT_RFLAG_ID_SIZE
:
49 offset
+= sizeof(u16
) + sizeof(u16
);
50 if (data_size
>= 0xFFFFU
)
51 offset
+= sizeof(u32
);
54 offset
+= sizeof(u16
);
59 *before_hdr_pad
= padding
;
60 return offset
- orig_offset
;
63 #endif /* UST_HEADER_INLINE_H */
This page took 0.039167 seconds and 4 git commands to generate.