X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Fltt%2Fltt-private.h;h=55374263f0bce980335fac2aca3bbcbcd80d794d;hb=bf33dd5091178cd0ad175b1914d74056db60e7af;hp=25f2d82443f3b5c94e1977b2ceee9df7fd8bafa2;hpb=3b10b765f2ed7b5758cf37c4dea8cb511edd289a;p=lttv.git diff --git a/ltt/branches/poly/ltt/ltt-private.h b/ltt/branches/poly/ltt/ltt-private.h index 25f2d824..55374263 100644 --- a/ltt/branches/poly/ltt/ltt-private.h +++ b/ltt/branches/poly/ltt/ltt-private.h @@ -47,7 +47,6 @@ #define LTT_GET_FLOAT_BO(t) \ (((t)->float_word_order==__BYTE_ORDER)?0:1) - /* Hardcoded core events */ enum ltt_core_events { LTT_EVENT_FACILITY_LOAD, @@ -137,33 +136,75 @@ struct ltt_event_header_nohb { uint16_t event_size; } LTT_PACKED_STRUCT; -struct ltt_trace_header { + +/* Block and trace headers */ + +struct ltt_trace_header_any { uint32_t magic_number; uint32_t arch_type; uint32_t arch_variant; + uint32_t float_word_order; uint8_t arch_size; - //uint32_t system_type; - uint8_t major_version; - uint8_t minor_version; - uint8_t flight_recorder; - uint8_t has_heartbeat; - uint8_t has_alignment; /* Event header alignment */ - uint8_t has_tsc; + uint8_t major_version; + uint8_t minor_version; + uint8_t flight_recorder; + uint8_t has_heartbeat; + uint8_t has_alignment; /* Event header alignment */ + uint8_t has_tsc; +} LTT_PACKED_STRUCT; + + +/* For version 0.3 */ + +struct ltt_trace_header_0_3 { + uint32_t magic_number; + uint32_t arch_type; + uint32_t arch_variant; + uint32_t float_word_order; + uint8_t arch_size; + uint8_t major_version; + uint8_t minor_version; + uint8_t flight_recorder; + uint8_t has_heartbeat; + uint8_t has_alignment; /* Event header alignment */ + uint8_t has_tsc; +} LTT_PACKED_STRUCT; + +/* For version 0.4 */ + +struct ltt_trace_header_0_4 { + uint32_t magic_number; + uint32_t arch_type; + uint32_t arch_variant; + uint32_t float_word_order; + uint8_t arch_size; + uint8_t major_version; + uint8_t minor_version; + uint8_t flight_recorder; + uint8_t has_heartbeat; + uint8_t has_alignment; /* Event header alignment */ + uint8_t has_tsc; + uint64_t start_freq; + uint64_t start_tsc; + uint64_t start_monotonic; + struct timespec start_time; } LTT_PACKED_STRUCT; struct ltt_block_start_header { struct { - struct timeval timestamp; + uint64_t timestamp; uint64_t cycle_count; + uint64_t freq; } begin; struct { - struct timeval timestamp; + uint64_t timestamp; uint64_t cycle_count; + uint64_t freq; } end; uint32_t lost_size; /* Size unused at the end of the buffer */ uint32_t buf_size; /* The size of this sub-buffer */ - struct ltt_trace_header trace; + struct ltt_trace_header_any trace[0]; } LTT_PACKED_STRUCT; @@ -303,16 +344,20 @@ typedef struct _LttBuffer { struct { LttTime timestamp; uint64_t cycle_count; + uint64_t freq; /* Frequency in khz */ } begin; struct { LttTime timestamp; uint64_t cycle_count; + uint64_t freq; /* Frequency in khz */ } end; uint32_t lost_size; /* Size unused at the end of the buffer */ /* Timekeeping */ uint64_t tsc; /* Current timestamp counter */ - double nsecs_per_cycle; + uint64_t freq; /* Frequency in khz */ + //double nsecs_per_cycle; /* Precalculated from freq */ + guint32 cyc2ns_scale; } LttBuffer; struct _LttTracefile{ @@ -328,6 +373,8 @@ struct _LttTracefile{ gboolean reverse_bo; //must we reverse byte order ? gboolean float_word_order; //what is the byte order of floats ? + size_t buffer_header_size; + /* Current event */ LttEvent event; //Event currently accessible in the trace @@ -367,6 +414,11 @@ struct _LttTrace{ guint8 has_heartbeat; guint8 has_alignment; guint8 has_tsc; + uint64_t start_freq; + uint64_t start_tsc; + uint64_t start_monotonic; + LttTime start_time; + LttTime start_time_from_tsc; GData *tracefiles; //tracefiles groups };