b23e74378719f6f16140f045095c2f7b1abfb7e4
[ust.git] / libust / tracerconst.h
1 #ifndef TRACERCONST_H
2 #define TRACERCONST_H
3
4 /* Hardcoded event headers
5 *
6 * event header for a trace with active heartbeat : 27 bits timestamps
7 *
8 * headers are 32-bits aligned. In order to insure such alignment, a dynamic per
9 * trace alignment value must be done.
10 *
11 * Remember that the C compiler does align each member on the boundary
12 * equivalent to their own size.
13 *
14 * As relay subbuffers are aligned on pages, we are sure that they are 4 and 8
15 * bytes aligned, so the buffer header and trace header are aligned.
16 *
17 * Event headers are aligned depending on the trace alignment option.
18 *
19 * Note using C structure bitfields for cross-endianness and portability
20 * concerns.
21 */
22
23 #define LTT_RESERVED_EVENTS 3
24 #define LTT_EVENT_BITS 5
25 #define LTT_FREE_EVENTS ((1 << LTT_EVENT_BITS) - LTT_RESERVED_EVENTS)
26 #define LTT_TSC_BITS 27
27 #define LTT_TSC_MASK ((1 << LTT_TSC_BITS) - 1)
28
29 struct ltt_event_header {
30 u32 id_time; /* 5 bits event id (MSB); 27 bits time (LSB) */
31 };
32
33 /* Reservation flags */
34 #define LTT_RFLAG_ID (1 << 0)
35 #define LTT_RFLAG_ID_SIZE (1 << 1)
36 #define LTT_RFLAG_ID_SIZE_TSC (1 << 2)
37
38 #define LTT_MAX_SMALL_SIZE 0xFFFFU
39
40 #endif /* TRACERCONST_H */
This page took 0.030963 seconds and 3 git commands to generate.