| 1 | #ifndef _LTT_MARKERS_FIELD_H |
| 2 | #define _LTT_MARKERS_FIELD_H |
| 3 | |
| 4 | /* |
| 5 | * Marker field support header. |
| 6 | * |
| 7 | * Mathieu Desnoyers, August 2007 |
| 8 | * License: LGPL. |
| 9 | */ |
| 10 | |
| 11 | #include <glib.h> |
| 12 | |
| 13 | enum ltt_type { |
| 14 | LTT_TYPE_SIGNED_INT, |
| 15 | LTT_TYPE_UNSIGNED_INT, |
| 16 | LTT_TYPE_POINTER, |
| 17 | LTT_TYPE_STRING, |
| 18 | LTT_TYPE_COMPACT, |
| 19 | LTT_TYPE_NONE, |
| 20 | }; |
| 21 | |
| 22 | struct marker_field { |
| 23 | GQuark name; |
| 24 | enum ltt_type type; |
| 25 | unsigned long offset; /* offset in the event data */ |
| 26 | unsigned long size; |
| 27 | unsigned long alignment; |
| 28 | unsigned long attributes; |
| 29 | int static_offset; /* boolean - private - is the field offset statically |
| 30 | * known with the preceding types ? */ |
| 31 | GString *fmt; |
| 32 | }; |
| 33 | |
| 34 | static inline GQuark marker_field_get_name(struct marker_field *field) |
| 35 | { |
| 36 | return field->name; |
| 37 | } |
| 38 | |
| 39 | static inline enum ltt_type marker_field_get_type(struct marker_field *field) |
| 40 | { |
| 41 | return field->type; |
| 42 | } |
| 43 | |
| 44 | static inline unsigned long marker_field_get_size(struct marker_field *field) |
| 45 | { |
| 46 | return field->size; |
| 47 | } |
| 48 | |
| 49 | #endif //_LTT_MARKERS_FIELD_H |