fix mistake about buf size duplicated in tracefile structure
[lttv.git] / ltt / branches / poly / ltt / ltt-private.h
index 8c0308c49b9a241ff2715cb2ee0c8a9a005e786d..4040433df432cae199464a2f467b1da30c0dfb15 100644 (file)
@@ -43,8 +43,8 @@
 enum ltt_core_events {
     LTT_EVENT_FACILITY_LOAD,
     LTT_EVENT_FACILITY_UNLOAD,
-    LTT_EVENT_STATE_DUMP_FACILITY_LOAD,
-    LTT_EVENT_HEARTBEAT
+    LTT_EVENT_HEARTBEAT,
+    LTT_EVENT_STATE_DUMP_FACILITY_LOAD
 };
 
 
@@ -86,7 +86,7 @@ typedef guint16 uint16_t;
 typedef guint32 uint32_t;
 typedef guint64 uint64_t;
 
-/* Hardcoded facility load event : this plus an following "name" string */
+/* Hardcoded facility load event : this plus an preceding "name" string */
 struct LttFacilityLoad {
   guint32 checksum;
   guint32 id;
@@ -94,11 +94,11 @@ struct LttFacilityLoad {
   guint32 pointer_size;
   guint32 size_t_size;
   guint32 alignment;
-};
+} LTT_PACKED_STRUCT;
 
 struct LttFacilityUnload {
   guint32 id;
-};
+} LTT_PACKED_STRUCT;
 
 struct LttStateDumpFacilityLoad {
   guint32 checksum;
@@ -107,9 +107,7 @@ struct LttStateDumpFacilityLoad {
   guint32 pointer_size;
   guint32 size_t_size;
   guint32 alignment;
-};
-
-
+} LTT_PACKED_STRUCT;
 
 typedef struct _TimeHeartbeat {
   LttTime       time;       //Time stamp of this block
@@ -121,14 +119,14 @@ struct ltt_event_header_hb {
   unsigned char  facility_id;
   unsigned char event_id;
   uint16_t      event_size;
-} __attribute((aligned(8)));
+} LTT_PACKED_STRUCT;
 
 struct ltt_event_header_nohb {
   uint64_t      timestamp;
   unsigned char  facility_id;
   unsigned char event_id;
   uint16_t      event_size;
-} __attribute((aligned(8)));
+} LTT_PACKED_STRUCT;
 
 struct ltt_trace_header {
   uint32_t        magic_number;
@@ -142,7 +140,7 @@ struct ltt_trace_header {
   uint8_t          has_heartbeat;
   uint8_t          has_alignment;  /* Event header alignment */
        uint8_t                                  has_tsc;
-} __attribute((aligned(8)));
+} LTT_PACKED_STRUCT;
 
 
 struct ltt_block_start_header {
@@ -157,7 +155,7 @@ struct ltt_block_start_header {
   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;
-} __attribute((aligned(8)));
+} LTT_PACKED_STRUCT;
 
 
 struct _LttType{
@@ -206,6 +204,8 @@ struct _LttEvent{
 
   void * data;               //event data
   guint  data_size;
+  guint  event_size;         //event_size field of the header : 
+                             //used to verify data_size from facility.
 
   int      count;                    //the number of overflow of cycle count
   gint64 overflow_nsec;              //precalculated nsec for overflows
@@ -268,6 +268,7 @@ struct _LttFacility{
   guint32  id;          //id of the facility
  
   guint32 pointer_size;
+  guint32 long_size;
   guint32 size_t_size;
   guint32 alignment;
 
@@ -307,12 +308,13 @@ typedef struct _LttBuffer {
 
 struct _LttTracefile{
   gboolean cpu_online;               //is the cpu online ?
+  GQuark long_name;                  //tracefile complete filename
   GQuark name;                       //tracefile name
   guint cpu_num;                     //cpu number of the tracefile
   LttTrace * trace;                  //trace containing the tracefile
   int fd;                            //file descriptor 
   off_t file_size;                   //file size
-  unsigned block_size;               //block_size
+  //unsigned block_size;               //block_size
   unsigned int num_blocks;           //number of blocks in the file
   gboolean  reverse_bo;              //must we reverse byte order ?
 
@@ -345,11 +347,14 @@ struct _LttTrace{
                                         /* Points to array of fac_id of all the
                                          * facilities that has this name. */
 
+  guint32   arch_type;
+  guint32   arch_variant;
+  guint8    arch_size;
   guint8    ltt_major_version;
   guint8    ltt_minor_version;
   guint8    flight_recorder;
   guint8    has_heartbeat;
// guint8    alignment;
 guint8    has_alignment;
        guint8          has_tsc;
 
   GData     *tracefiles;                    //tracefiles groups
This page took 0.024958 seconds and 4 git commands to generate.