X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=ltt%2Fmarker-field.h;h=7092b92b2c7dac39966a9e45317cb9e9c8b68164;hb=1184dc3;hp=252bd8925fc7b4ee0b001474787d1f02488a0ad9;hpb=2e2088e13a4514ce9c0ee0bd508fc831c6dc0edf;p=lttv.git diff --git a/ltt/marker-field.h b/ltt/marker-field.h index 252bd892..7092b92b 100644 --- a/ltt/marker-field.h +++ b/ltt/marker-field.h @@ -19,11 +19,18 @@ enum ltt_type { LTT_TYPE_NONE, }; +/* + * Fields "offset" and "size" below are only valid while the event is being + * read. They are also being shared with events of the same type coming from + * other per-cpu tracefiles. Therefore, the "LttEvent" fields_offsets offset and + * size should be used rather than these. + */ struct marker_field { GQuark name; enum ltt_type type; - unsigned long offset; /* offset in the event data */ - unsigned long size; + unsigned int index; /* Field index within the event */ + unsigned long _offset; /* offset in the event data, USED ONLY INTERNALLY BY LIB */ + unsigned long _size; /* size of field. USED ONLY INTERNALLY BY LIB */ unsigned long alignment; unsigned long attributes; int static_offset; /* boolean - private - is the field offset statically @@ -41,9 +48,17 @@ static inline enum ltt_type marker_field_get_type(struct marker_field *field) return field->type; } -static inline unsigned long marker_field_get_size(struct marker_field *field) +/* + * Returns 0 if size is not known statically. + */ +static inline long marker_field_get_size(struct marker_field *field) +{ + return field->_size; +} + +static inline unsigned int marker_field_get_index(struct marker_field *field) { - return field->size; + return field->index; } #endif //_LTT_MARKERS_FIELD_H