Filter for selecting trace and tracefile
[lttv.git] / ltt / branches / poly / include / ltt / ltt-private.h
index 55a2e0e1bc401d0217af4bfc31b98c29f8302b51..faf2baffe29a3d3e51a8be65ab755ca030029e18 100644 (file)
@@ -2,11 +2,13 @@
 #define LTT_PRIVATE_H
 
 #include <glib.h>
+#include <sys/types.h>
 #include <ltt/ltt.h>
-#include <ltt/LTTTypes.h>
 #include <ltt/type.h>
 #include <ltt/trace.h>
 
+#define LTT_PACKED_STRUCT __attribute__ ((packed))
+
 /* enumeration definition */
 
 typedef enum _BuildinEvent{
@@ -22,19 +24,19 @@ typedef enum _BuildinEvent{
 typedef struct _FacilityLoad{
   char * name;
   LttChecksum checksum;
-  uint32_t base_code;
+  guint32     base_code;
 } LTT_PACKED_STRUCT FacilityLoad;
 
 typedef struct _BlockStart {
   LttTime       time;       //Time stamp of this block
   LttCycleCount cycle_count; //cycle count of the event
-  uint32_t      block_id;    //block id 
+  guint32       block_id;    //block id 
 } LTT_PACKED_STRUCT BlockStart;
 
 typedef struct _BlockEnd {
   LttTime       time;       //Time stamp of this block
   LttCycleCount cycle_count; //cycle count of the event
-  uint32_t      block_id;    //block id 
+  guint32       block_id;    //block id 
 } LTT_PACKED_STRUCT BlockEnd;
 
 typedef struct _TimeHeartbeat {
@@ -97,8 +99,8 @@ struct _LttField{
 };
 
 struct _LttEvent{
-  uint16_t event_id;
-  uint32_t time_delta;
+  guint16  event_id;
+  guint32  time_delta;
   LttTime event_time;
   LttCycleCount event_cycle_count;
   LttTracefile * tracefile;
@@ -111,7 +113,7 @@ struct _LttFacility{
   char * name;               //facility name 
   int event_number;          //number of events in the facility 
   LttChecksum checksum;      //checksum of the facility 
-  uint32_t base_id;          //base id of the facility
+  guint32  base_id;          //base id of the facility
   LttEventType ** events;    //array of event types 
   LttType ** named_types;
   int  named_types_number;
@@ -134,9 +136,12 @@ struct _LttTracefile{
   void * buffer;                     //the buffer containing the block
   double cycle_per_nsec;             //Cycles per nsec
   unsigned cur_heart_beat_number;    //current number of heart beat in the buf
+  LttCycleCount cur_cycle_count;     //current cycle count of the event
+  void * last_event_pos;
 
   LttTime prev_block_end_time;       //the end time of previous block
   LttTime prev_event_time;           //the time of the previous event
+  LttEvent an_event;
 };
 
 struct _LttTrace{
@@ -145,6 +150,7 @@ struct _LttTrace{
   guint control_tracefile_number;           //the number of control files 
   guint per_cpu_tracefile_number;           //the number of per cpu files 
   LttSystemDescription * system_description;//system description 
+
   GPtrArray *control_tracefiles;            //array of control tracefiles 
   GPtrArray *per_cpu_tracefiles;            //array of per cpu tracefiles 
   GPtrArray *facilities;                    //array of facilities 
@@ -152,12 +158,23 @@ struct _LttTrace{
   LttArchEndian my_arch_endian;             //endian type of the local machine
 };
 
+struct _LttEventPosition{
+  unsigned      block_num;          //block which contains the event 
+  unsigned      event_num;          //event index in the block
+  unsigned      event_offset;       //event position in the block
+  LttTime       event_time;         //the time of the event
+  LttCycleCount event_cycle_count;  //the cycle count of the event
+  unsigned      heart_beat_number;  //current number of heart beats  
+  LttTracefile *tf;                 //tracefile containing the event
+  gboolean      old_position;       //flag to show if it is the position
+                                    //being remembered
+};
 
 /*****************************************************************************
  macro for size of some data types
  *****************************************************************************/
-#define EVENT_ID_SIZE     sizeof(uint16_t)
-#define TIME_DELTA_SIZE   sizeof(uint32_t)
+#define EVENT_ID_SIZE     sizeof(guint16)
+#define TIME_DELTA_SIZE   sizeof(guint32)
 #define EVENT_HEADER_SIZE (EVENT_ID_SIZE + TIME_DELTA_SIZE)
 
 
This page took 0.023441 seconds and 4 git commands to generate.