move ltt-private.h from public directroy into private directroy
authoryangxx <yangxx@04897980-b3bd-0310-b5e0-8ef037075253>
Tue, 11 Nov 2003 21:50:38 +0000 (21:50 +0000)
committeryangxx <yangxx@04897980-b3bd-0310-b5e0-8ef037075253>
Tue, 11 Nov 2003 21:50:38 +0000 (21:50 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@334 04897980-b3bd-0310-b5e0-8ef037075253

22 files changed:
ltt/branches/poly/include/ltt/Makefile.am
ltt/branches/poly/include/ltt/event.h
ltt/branches/poly/include/ltt/facility.h
ltt/branches/poly/include/ltt/ltt-private.h [deleted file]
ltt/branches/poly/include/ltt/ltt.h
ltt/branches/poly/include/ltt/trace.h
ltt/branches/poly/include/ltt/type.h
ltt/branches/poly/ltt/Makefile.am
ltt/branches/poly/ltt/event.c
ltt/branches/poly/ltt/facility.c
ltt/branches/poly/ltt/ltt-private.h [new file with mode: 0644]
ltt/branches/poly/ltt/tracefile.c
ltt/branches/poly/ltt/type.c
ltt/branches/poly/lttv/batchAnalysis.c
ltt/branches/poly/lttv/modules/gui/mainWin/src/callbacks.c
ltt/branches/poly/lttv/modules/gui/mainWin/src/init_module.c
ltt/branches/poly/lttv/modules/gui/mainWin/src/lttvfilter.c
ltt/branches/poly/lttv/modules/guiEvents.c
ltt/branches/poly/lttv/modules/guiStatistic/guiStatistic.c
ltt/branches/poly/lttv/processTrace.c
ltt/branches/poly/lttv/state.c
ltt/branches/poly/lttv/textDump.c

index 70065316b53458bff6c5e646dd6e384f274ea66b..2ffd924445db3d5b928dca3b1d7fef057c121332 100644 (file)
@@ -1,7 +1,6 @@
 lttinclude_HEADERS = \
        event.h\
        facility.h\
-       ltt-private.h\
        ltt.h\
        time.h\
        trace.h\
index 1ba598dfe62c8086ccfb64cbe14c9643dfec32fb..7c231ccc2312f28d960545120ea59bc2c57e3174 100644 (file)
@@ -43,6 +43,8 @@ LttCycleCount ltt_event_cycle_count(LttEvent *e);
 
 void ltt_event_position(LttEvent *e, LttEventPosition *ep);
 
+LttEventPosition * ltt_event_position_new();
+
 void ltt_event_position_get(LttEventPosition *ep,
     unsigned *block_number, unsigned *index_in_block, LttTracefile ** tf);
 
index ae1dd9f19155202cfd598708e2500ef37bc0ac3b..4bca4fd1423f4e6746182a51a281e29e416babc9 100644 (file)
@@ -11,6 +11,8 @@ char *ltt_facility_name(LttFacility *f);
 
 LttChecksum ltt_facility_checksum(LttFacility *f);
 
+/* open facility */
+void ltt_facility_open(LttTrace * t, char * facility_name);
 
 /* Discover the event types within the facility. The event type integer id
    relative to the trace is from 0 to nb_event_types - 1. The event
diff --git a/ltt/branches/poly/include/ltt/ltt-private.h b/ltt/branches/poly/include/ltt/ltt-private.h
deleted file mode 100644 (file)
index faf2baf..0000000
+++ /dev/null
@@ -1,204 +0,0 @@
-#ifndef LTT_PRIVATE_H
-#define LTT_PRIVATE_H
-
-#include <glib.h>
-#include <sys/types.h>
-#include <ltt/ltt.h>
-#include <ltt/type.h>
-#include <ltt/trace.h>
-
-#define LTT_PACKED_STRUCT __attribute__ ((packed))
-
-/* enumeration definition */
-
-typedef enum _BuildinEvent{
-  TRACE_FACILITY_LOAD = 0,
-  TRACE_BLOCK_START   = 17,
-  TRACE_BLOCK_END     = 18,
-  TRACE_TIME_HEARTBEAT= 19
-} BuildinEvent;
-
-
-/* structure definition */
-
-typedef struct _FacilityLoad{
-  char * name;
-  LttChecksum checksum;
-  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
-  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
-  guint32       block_id;    //block id 
-} LTT_PACKED_STRUCT BlockEnd;
-
-typedef struct _TimeHeartbeat {
-  LttTime       time;       //Time stamp of this block
-  LttCycleCount cycle_count; //cycle count of the event
-} LTT_PACKED_STRUCT TimeHeartbeat;
-
-
-struct _LttType{
-  char * type_name;                //type name if it is a named type
-  char * element_name;             //elements name of the struct
-  char * fmt;
-  int size;
-  LttTypeEnum type_class;          //which type
-  char ** enum_strings;            //for enum labels
-  struct _LttType ** element_type; //for array, sequence and struct
-  unsigned element_number;         //the number of elements 
-                                   //for enum, array, sequence and structure
-};
-
-struct _LttEventType{
-  char * name;
-  char * description;
-  int index;              //id of the event type within the facility
-  LttFacility * facility; //the facility that contains the event type
-  LttField * root_field;  //root field
-  int latest_block;       //the latest block using the event type
-  int latest_event;       //the latest event using the event type
-};
-
-struct _LttField{
-  unsigned field_pos;        //field position within its parent
-  LttType * field_type;      //field type, if it is root field
-                             //then it must be struct type
-
-  off_t offset_root;         //offset from the root, -1:uninitialized 
-  short fixed_root;          //offset fixed according to the root
-                             //-1:uninitialized, 0:unfixed, 1:fixed
-  off_t offset_parent;       //offset from the parent,-1:uninitialized
-  short fixed_parent;        //offset fixed according to its parent
-                             //-1:uninitialized, 0:unfixed, 1:fixed
-  //  void * base_address;       //base address of the field  ????
-  
-  int  field_size;           //>0: size of the field, 
-                             //0 : uncertain
-                             //-1: uninitialize
-  int sequ_number_size;      //the size of unsigned used to save the
-                             //number of elements in the sequence
-
-  int element_size;          //the element size of the sequence
-  int field_fixed;           //0: field has string or sequence
-                             //1: field has no string or sequenc
-                             //-1: uninitialize
-
-  struct _LttField * parent;
-  struct _LttField ** child; //for array, sequence and struct: 
-                             //list of fields, it may have only one
-                             //field if the element is not a struct 
-  unsigned current_element;  //which element is currently processed
-};
-
-struct _LttEvent{
-  guint16  event_id;
-  guint32  time_delta;
-  LttTime event_time;
-  LttCycleCount event_cycle_count;
-  LttTracefile * tracefile;
-  void * data;               //event data
-  int which_block;           //the current block of the event
-  int which_event;           //the position of the event
-};
-
-struct _LttFacility{
-  char * name;               //facility name 
-  int event_number;          //number of events in the facility 
-  LttChecksum checksum;      //checksum of the facility 
-  guint32  base_id;          //base id of the facility
-  LttEventType ** events;    //array of event types 
-  LttType ** named_types;
-  int  named_types_number;
-};
-
-struct _LttTracefile{
-  char * name;                       //tracefile name
-  LttTrace * trace;                  //trace containing the tracefile
-  int fd;                            //file descriptor 
-  off_t file_size;                   //file size
-  unsigned block_size;               //block_size
-  int block_number;                  //number of blocks in the file
-  int which_block;                   //which block the current block is
-  int which_event;                   //which event of the current block 
-                                     //is currently processed 
-  LttTime current_event_time;        //time of the current event
-  BlockStart * a_block_start;        //block start of the block
-  BlockEnd   * a_block_end;          //block end of the block
-  void * cur_event_pos;              //the position of the current event
-  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{
-  char * pathname;                          //the pathname of the trace
-  guint facility_number;                    //the number of facilities 
-  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 
-  LttArchSize my_arch_size;                 //data size of the local machine
-  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(guint16)
-#define TIME_DELTA_SIZE   sizeof(guint32)
-#define EVENT_HEADER_SIZE (EVENT_ID_SIZE + TIME_DELTA_SIZE)
-
-
-
-
-/* obtain the time of an event */
-LttTime getEventTime(LttTracefile * tf);
-
-/* get the data type size and endian type of the local machine */
-void getDataEndianType(LttArchSize * size, LttArchEndian * endian);
-
-/* get an integer number */
-int getIntNumber(int size1, void *evD);
-
-/* open facility */
-void ltt_facility_open(LttTrace * t, char * facility_name);
-
-/* get facility by event id */
-LttFacility * ltt_trace_facility_by_id(LttTrace * trace, unsigned id);
-
-/* open tracefile */
-LttTracefile * ltt_tracefile_open(LttTrace *t, char * tracefile_name);
-void ltt_tracefile_open_cpu(LttTrace *t, char * tracefile_name);
-void ltt_tracefile_open_control(LttTrace *t, char * control_name);
-
-
-#endif /* LTT_PRIVATE_H */
index 9e14dece46b4c1145ac5108b604daebfa30ce2e9..ed86a5db8c394e5b5e89a535116ea56fbad546f5 100644 (file)
@@ -106,7 +106,10 @@ typedef enum _LttArchEndian
 { LTT_LITTLE_ENDIAN, LTT_BIG_ENDIAN
 } LttArchEndian;
 
-#include <ltt/ltt-private.h>
+typedef enum _LttTypeEnum 
+{ LTT_INT, LTT_UINT, LTT_FLOAT, LTT_STRING, LTT_ENUM, LTT_ARRAY, 
+  LTT_SEQUENCE, LTT_STRUCT, LTT_UNION
+} LttTypeEnum;
 
  
 #endif // LTT_H
index 191422c693ec8cf2733943a13ebb65d77fefe89c..284d4babc6bc0e7ed3f7147a1dad11727a288dbd 100644 (file)
@@ -20,30 +20,6 @@ char * ltt_trace_name(LttTrace *t);
 void ltt_trace_close(LttTrace *t); 
 
 
-/* The characteristics of the system on which the trace was obtained
-   is described in a LttSystemDescription structure. */
-
-struct _LttSystemDescription {
-  char *description;
-  char *node_name;
-  char *domain_name;
-  unsigned nb_cpu;
-  LttArchSize size;
-  LttArchEndian endian;
-  char *kernel_name;
-  char *kernel_release;
-  char *kernel_version;
-  char *machine;
-  char *processor;
-  char *hardware_platform;
-  char *operating_system;
-  unsigned ltt_major_version;
-  unsigned ltt_minor_version;
-  unsigned ltt_block_size;
-  LttTime trace_start;
-  LttTime trace_end;
-};
-
 LttSystemDescription *ltt_trace_system_description(LttTrace *t);
 
 
@@ -56,6 +32,7 @@ unsigned ltt_trace_facility_number(LttTrace *t);
 
 LttFacility *ltt_trace_facility_get(LttTrace *t, unsigned i);
 
+LttFacility * ltt_trace_facility_by_id(LttTrace * trace, unsigned id);
 
 /* Look for a facility by name. It returns the number of facilities found
    and sets the position argument to the first found. Returning 0, the named
@@ -127,4 +104,46 @@ void ltt_tracefile_seek_position(LttTracefile *t,
 
 LttEvent *ltt_tracefile_read(LttTracefile *t);
 
+/* open tracefile */
+
+LttTracefile * ltt_tracefile_open(LttTrace *t, char * tracefile_name);
+
+void ltt_tracefile_open_cpu(LttTrace *t, char * tracefile_name);
+
+void ltt_tracefile_open_control(LttTrace *t, char * control_name);
+
+
+/* obtain the time of an event */
+
+LttTime getEventTime(LttTracefile * tf);
+
+
+/* get the data type size and endian type of the local machine */
+
+void getDataEndianType(LttArchSize * size, LttArchEndian * endian);
+
+/* get an integer number */
+
+int getIntNumber(int size1, void *evD);
+
+
+/* get the node name of the system */
+
+char * ltt_trace_system_description_node_name (LttSystemDescription * s);
+
+
+/* get the domain name of the system */
+
+char * ltt_trace_system_description_domain_name (LttSystemDescription * s);
+
+
+/* get the description of the system */
+
+char * ltt_trace_system_description_description (LttSystemDescription * s);
+
+
+/* get the start time of the trace */
+
+LttTime ltt_trace_system_description_trace_start_time(LttSystemDescription *s);
+
 #endif // TRACE_H
index 3e5679755dc2a8d043b812e93db59dabffc2b1a6..2d0655a91af68ea675511614a418c3b86d35a2b8 100644 (file)
@@ -4,11 +4,6 @@
 
 /* Different types allowed */
 
-typedef enum _LttTypeEnum 
-{ LTT_INT, LTT_UINT, LTT_FLOAT, LTT_STRING, LTT_ENUM, LTT_ARRAY, 
-  LTT_SEQUENCE, LTT_STRUCT, LTT_UNION
-} LttTypeEnum;
-
 #include <ltt/ltt.h>
 
 
@@ -84,4 +79,6 @@ LttField *ltt_field_member(LttField *f, unsigned i);
 
 LttType *ltt_field_type(LttField *f);
 
+int ltt_field_size(LttField * f);
+
 #endif // TYPE_H
index c78c7406dfb5a8ae0b56ca686f573d976b369451..92e4dcef035175c3227beb8dec9afc8926019b5a 100644 (file)
@@ -13,7 +13,7 @@ LIBS += $(GLIB_LIBS)
 
 lib_LTLIBRARIES = libtraceread.la
 libtraceread_la_SOURCES = event.c facility.c parser.c tracefile.c type.c
-noinst_HEADERS = parser.h 
+noinst_HEADERS = parser.h ltt-private.h
 
 
 EXTRA_DIST = crc32.tab
index 9b3ff0d9984b63155baaf14ab3c6b54fa4c90c45..8a3174cff8a8e124322dd5ed75b2fa217f10c72f 100644 (file)
@@ -1,8 +1,12 @@
 #include <stdio.h>
 #include <asm/types.h>
 #include <linux/byteorder/swab.h>
+
 #include "parser.h"
+#include <ltt/ltt.h>
+#include "ltt-private.h"
 #include <ltt/event.h>
+#include <ltt/trace.h>
 
 /*****************************************************************************
  *Function name
@@ -200,6 +204,11 @@ void ltt_event_position(LttEvent *e, LttEventPosition *ep)
   ep->tf                = e->tracefile;
 }
 
+LttEventPosition * ltt_event_position_new()
+{
+  return g_new(LttEventPosition, 1);
+}
+
 /*****************************************************************************
  *Function name
  *    ltt_event_position_get : get the block number and index of the event
index 6d70d5728af3a1d7e0de8553433a80c1ff2f95b8..6807ef0e91a8081ede942fd1d5dc10d33a457b60 100644 (file)
@@ -3,6 +3,8 @@
 #include <stdio.h>
 
 #include "parser.h"
+#include <ltt/ltt.h>
+#include "ltt-private.h"
 #include <ltt/facility.h>
 
 /* search for the (named) type in the table, if it does not exist
diff --git a/ltt/branches/poly/ltt/ltt-private.h b/ltt/branches/poly/ltt/ltt-private.h
new file mode 100644 (file)
index 0000000..ea4dff8
--- /dev/null
@@ -0,0 +1,203 @@
+#ifndef LTT_PRIVATE_H
+#define LTT_PRIVATE_H
+
+#include <glib.h>
+#include <sys/types.h>
+#include <ltt/ltt.h>
+
+#define LTT_PACKED_STRUCT __attribute__ ((packed))
+
+/* enumeration definition */
+
+typedef enum _BuildinEvent{
+  TRACE_FACILITY_LOAD = 0,
+  TRACE_BLOCK_START   = 17,
+  TRACE_BLOCK_END     = 18,
+  TRACE_TIME_HEARTBEAT= 19
+} BuildinEvent;
+
+
+/* structure definition */
+
+typedef struct _FacilityLoad{
+  char * name;
+  LttChecksum checksum;
+  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
+  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
+  guint32       block_id;    //block id 
+} LTT_PACKED_STRUCT BlockEnd;
+
+typedef struct _TimeHeartbeat {
+  LttTime       time;       //Time stamp of this block
+  LttCycleCount cycle_count; //cycle count of the event
+} LTT_PACKED_STRUCT TimeHeartbeat;
+
+
+struct _LttType{
+  char * type_name;                //type name if it is a named type
+  char * element_name;             //elements name of the struct
+  char * fmt;
+  int size;
+  LttTypeEnum type_class;          //which type
+  char ** enum_strings;            //for enum labels
+  struct _LttType ** element_type; //for array, sequence and struct
+  unsigned element_number;         //the number of elements 
+                                   //for enum, array, sequence and structure
+};
+
+struct _LttEventType{
+  char * name;
+  char * description;
+  int index;              //id of the event type within the facility
+  LttFacility * facility; //the facility that contains the event type
+  LttField * root_field;  //root field
+  int latest_block;       //the latest block using the event type
+  int latest_event;       //the latest event using the event type
+};
+
+struct _LttField{
+  unsigned field_pos;        //field position within its parent
+  LttType * field_type;      //field type, if it is root field
+                             //then it must be struct type
+
+  off_t offset_root;         //offset from the root, -1:uninitialized 
+  short fixed_root;          //offset fixed according to the root
+                             //-1:uninitialized, 0:unfixed, 1:fixed
+  off_t offset_parent;       //offset from the parent,-1:uninitialized
+  short fixed_parent;        //offset fixed according to its parent
+                             //-1:uninitialized, 0:unfixed, 1:fixed
+  //  void * base_address;       //base address of the field  ????
+  
+  int  field_size;           //>0: size of the field, 
+                             //0 : uncertain
+                             //-1: uninitialize
+  int sequ_number_size;      //the size of unsigned used to save the
+                             //number of elements in the sequence
+
+  int element_size;          //the element size of the sequence
+  int field_fixed;           //0: field has string or sequence
+                             //1: field has no string or sequenc
+                             //-1: uninitialize
+
+  struct _LttField * parent;
+  struct _LttField ** child; //for array, sequence and struct: 
+                             //list of fields, it may have only one
+                             //field if the element is not a struct 
+  unsigned current_element;  //which element is currently processed
+};
+
+struct _LttEvent{
+  guint16  event_id;
+  guint32  time_delta;
+  LttTime event_time;
+  LttCycleCount event_cycle_count;
+  LttTracefile * tracefile;
+  void * data;               //event data
+  int which_block;           //the current block of the event
+  int which_event;           //the position of the event
+};
+
+struct _LttFacility{
+  char * name;               //facility name 
+  int event_number;          //number of events in the facility 
+  LttChecksum checksum;      //checksum of the facility 
+  guint32  base_id;          //base id of the facility
+  LttEventType ** events;    //array of event types 
+  LttType ** named_types;
+  int  named_types_number;
+};
+
+struct _LttTracefile{
+  char * name;                       //tracefile name
+  LttTrace * trace;                  //trace containing the tracefile
+  int fd;                            //file descriptor 
+  off_t file_size;                   //file size
+  unsigned block_size;               //block_size
+  int block_number;                  //number of blocks in the file
+  int which_block;                   //which block the current block is
+  int which_event;                   //which event of the current block 
+                                     //is currently processed 
+  LttTime current_event_time;        //time of the current event
+  BlockStart * a_block_start;        //block start of the block
+  BlockEnd   * a_block_end;          //block end of the block
+  void * cur_event_pos;              //the position of the current event
+  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{
+  char * pathname;                          //the pathname of the trace
+  guint facility_number;                    //the number of facilities 
+  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 
+  LttArchSize my_arch_size;                 //data size of the local machine
+  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
+};
+
+/* The characteristics of the system on which the trace was obtained
+   is described in a LttSystemDescription structure. */
+
+struct _LttSystemDescription {
+  char *description;
+  char *node_name;
+  char *domain_name;
+  unsigned nb_cpu;
+  LttArchSize size;
+  LttArchEndian endian;
+  char *kernel_name;
+  char *kernel_release;
+  char *kernel_version;
+  char *machine;
+  char *processor;
+  char *hardware_platform;
+  char *operating_system;
+  unsigned ltt_major_version;
+  unsigned ltt_minor_version;
+  unsigned ltt_block_size;
+  LttTime trace_start;
+  LttTime trace_end;
+};
+
+/*****************************************************************************
+ macro for size of some data types
+ *****************************************************************************/
+#define EVENT_ID_SIZE     sizeof(guint16)
+#define TIME_DELTA_SIZE   sizeof(guint32)
+#define EVENT_HEADER_SIZE (EVENT_ID_SIZE + TIME_DELTA_SIZE)
+
+
+#endif /* LTT_PRIVATE_H */
index 3d213971e4721b6f05c678f054b50b6a7b922f41..debf0327eb40bdc235b69963afb317cd26f2752f 100644 (file)
@@ -6,7 +6,10 @@
 #include <linux/errno.h>  
 
 #include "parser.h"
+#include <ltt/ltt.h>
+#include "ltt-private.h"
 #include <ltt/trace.h>
+#include <ltt/facility.h>
 
 #define DIR_NAME_SIZE 256
 
@@ -1384,3 +1387,34 @@ void getDataEndianType(LttArchSize * size, LttArchEndian * endian)
   else *size = LTT_UNKNOWN;
 }
 
+/* get the node name of the system */
+
+char * ltt_trace_system_description_node_name (LttSystemDescription * s)
+{
+  return s->node_name;
+}
+
+
+/* get the domain name of the system */
+
+char * ltt_trace_system_description_domain_name (LttSystemDescription * s)
+{
+  return s->domain_name;
+}
+
+
+/* get the description of the system */
+
+char * ltt_trace_system_description_description (LttSystemDescription * s)
+{
+  return s->description;
+}
+
+
+/* get the start time of the trace */
+
+LttTime ltt_trace_system_description_trace_start_time(LttSystemDescription *s)
+{
+  return s->trace_start;
+}
+
index be96a3c732c0f6333061ed3b057cea0a2b189036..dc39d9d1d082b6dbf6b194fcba5064e5362e9e64 100644 (file)
@@ -1,6 +1,8 @@
 #include <stdio.h>
 
 #include "parser.h"
+#include <ltt/ltt.h>
+#include "ltt-private.h"
 #include <ltt/type.h>
 
 static unsigned intSizes[] = {
@@ -315,3 +317,8 @@ LttType *ltt_field_type(LttField *f)
   return f->field_type;
 }
 
+int ltt_field_size(LttField * f)
+{
+  if(!f)return 0;
+  return f->field_size;
+}
index 98a686cd33d0be1d45255fbea3177bc303c18d66..6270342945534a2317a50d94f119a57f0ab8972e 100644 (file)
@@ -10,6 +10,7 @@
 #include <lttv/processTrace.h>
 #include <lttv/state.h>
 #include <lttv/stats.h>
+#include <ltt/trace.h>
 
 static LttvTraceset *traceset;
 
index df9aa693072b9109ac23c9ec84b8c6e2ed1cf2b6..fd708324a87f15debb672047204f99ea0d19a94c 100644 (file)
@@ -16,6 +16,7 @@
 #include <lttv/gtkdirsel.h>
 #include <lttv/iattribute.h>
 #include <lttv/lttvfilter.h>
+#include <ltt/trace.h>
 
 #define PATH_LENGTH          256
 #define DEFAULT_TIME_WIDTH_S   1
@@ -378,7 +379,7 @@ void remove_trace(GtkWidget * widget, gpointer user_data)
     trace_v = lttv_traceset_get(mw_data->current_tab->
                                traceset_info->traceset, i);
     trace = lttv_trace(trace_v);
-    name[i] = trace->pathname;
+    name[i] = ltt_trace_name(trace);
   }
 
   remove_trace_name = get_remove_trace(name, nb_trace);
index 1fe80b546f9525cdd467a441cceeaf7da76a2c14..7bf2f5e37f0399319f0690f4d637ae27f57b62de 100644 (file)
@@ -24,6 +24,8 @@
 #include "support.h"
 #include <lttv/mainWindow.h>
 #include "callbacks.h"
+#include <ltt/trace.h>
+
 
 /* global variable */
 static WindowCreationData  win_creation_data;
index 242215690dccb222b2233916eec21067b8c40ce2..ed5f98243c927d0616fe77efe7dbc0ff9684c013 100644 (file)
@@ -1,6 +1,7 @@
 
 #include <lttv/lttvfilter.h>
 #include <stdio.h>
+#include <ltt/trace.h>
 
 struct _LttvTracesetSelector {
   char      * traceset_name;
index 94fc4a2d35c5b7d79488852616bdf234f460f241..a53f7262fa4cd260d651633e1aa037759af1f6e1 100644 (file)
@@ -67,7 +67,7 @@ typedef struct _RawTraceData{
   int pid;
   unsigned entry_length;
   char * event_description;
-  LttEventPosition ep;
+  LttEventPosition *ep;
 } RawTraceData;
 
 #define RESERVE_BIG_SIZE      1000
@@ -835,20 +835,20 @@ void get_test_data(double time_value, guint list_height,
            raw_data = (RawTraceData*)g_list_nth_data(first,0);
            end = raw_data->time;
            end.tv_nsec--;
-           ltt_event_position_get(&raw_data->ep, &block_num, &event_num, &tf);
+           ltt_event_position_get(raw_data->ep, &block_num, &event_num, &tf);
            if(size !=0){
              if(event_num > minNum){
                backward_num = event_num > RESERVE_SMALL_SIZE 
                              ? event_num - RESERVE_SMALL_SIZE : 1;
-               ltt_event_position_set(&raw_data->ep, block_num, backward_num);
-               ltt_tracefile_seek_position(tf, &raw_data->ep);
+               ltt_event_position_set(raw_data->ep, block_num, backward_num);
+               ltt_tracefile_seek_position(tf, raw_data->ep);
                ev = ltt_tracefile_read(tf);
                start = ltt_event_time(ev);
                maxNum = G_MAXULONG;
              }else{
                if(block_num > 1){
-                 ltt_event_position_set(&raw_data->ep, block_num-1, 1);
-                 ltt_tracefile_seek_position(tf, &raw_data->ep);
+                 ltt_event_position_set(raw_data->ep, block_num-1, 1);
+                 ltt_tracefile_seek_position(tf, raw_data->ep);
                  ev = ltt_tracefile_read(tf);
                  start = ltt_event_time(ev);                 
                }else{
@@ -859,8 +859,8 @@ void get_test_data(double time_value, guint list_height,
              }
            }else{
              if(block_num > count){
-               ltt_event_position_set(&raw_data->ep, block_num-count, 1);
-               ltt_tracefile_seek_position(tf, &raw_data->ep);
+               ltt_event_position_set(raw_data->ep, block_num-count, 1);
+               ltt_tracefile_seek_position(tf, raw_data->ep);
                ev = ltt_tracefile_read(tf);
                start = ltt_event_time(ev);                   
              }else{
@@ -934,13 +934,13 @@ void get_test_data(double time_value, guint list_height,
          raw_data = (RawTraceData*)g_list_nth_data(first,0);
          end = raw_data->time;
          end.tv_nsec--;
-         ltt_event_position_get(&raw_data->ep, &block_num, &event_num, &tf);
+         ltt_event_position_get(raw_data->ep, &block_num, &event_num, &tf);
          
          if(event_num > list_height - size){
            backward_num = event_num > RESERVE_SMALL_SIZE 
              ? event_num - RESERVE_SMALL_SIZE : 1;
-           ltt_event_position_set(&raw_data->ep, block_num, backward_num);
-           ltt_tracefile_seek_position(tf, &raw_data->ep);
+           ltt_event_position_set(raw_data->ep, block_num, backward_num);
+           ltt_tracefile_seek_position(tf, raw_data->ep);
            ev = ltt_tracefile_read(tf);
            start = ltt_event_time(ev);
            maxNum = G_MAXULONG;
@@ -1390,11 +1390,12 @@ gboolean parse_event(void *hook_data, void *call_data)
   tmp_raw_trace_data->cpu_id = ltt_event_cpu_id(e);
   tmp_raw_trace_data->event_name = g_strdup(ltt_eventtype_name(ltt_event_eventtype(e)));
   tmp_raw_trace_data->time = time;
+  tmp_raw_trace_data->ep = ltt_event_position_new();
 
   if(prev_raw_trace_data) tmp_raw_trace_data->pid = prev_raw_trace_data->pid;
   else tmp_raw_trace_data->pid = -1;
 
-  tmp_raw_trace_data->entry_length = field == NULL ? 0 : field->field_size;
+  tmp_raw_trace_data->entry_length = field == NULL ? 0 : ltt_field_size(field);
   if(field) get_event_detail(e, field, detail_event);
   tmp_raw_trace_data->event_description  = g_strdup(detail_event->str);
 
@@ -1414,7 +1415,7 @@ gboolean parse_event(void *hook_data, void *call_data)
     }
   }
   
-  ltt_event_position(e, &tmp_raw_trace_data->ep);
+  ltt_event_position(e, tmp_raw_trace_data->ep);
 
   if(event_viewer_data->raw_trace_data_queue_tmp->length >= RESERVE_SMALL_SIZE){
     if(event_viewer_data->append){
index 230cd842502790afa8d14ef1e6075461f9b495a4..31fece3d0e297a723a53c01006255d508e5db9d4 100644 (file)
@@ -377,7 +377,8 @@ void show_traceset_stats(StatisticViewerData * statistic_viewer_data)
     tcs = (LttvTraceStats *)(LTTV_TRACESET_CONTEXT(tscs)->traces[i]);
     desc = ltt_trace_system_description(tcs->parent.parent.t);    
     sprintf(trace_str, "Trace on system %s at time %d secs", 
-           desc->node_name,desc->trace_start.tv_sec);
+           ltt_trace_system_description_node_name(desc),
+           (ltt_trace_system_description_trace_start_time(desc)).tv_sec);
     
     gtk_tree_store_append (store, &iter, NULL);  
     gtk_tree_store_set (store, &iter,NAME_COLUMN,trace_str,-1);  
index 9eaa5e5507403663850448f9b2d44669a70f85aa..92c19758dbd4cfc58ea3b0e9428cfae07474f247 100644 (file)
@@ -2,6 +2,8 @@
 #include <lttv/processTrace.h>
 #include <ltt/event.h>
 #include <ltt/facility.h>
+#include <ltt/trace.h>
+#include <ltt/type.h>
 
 void lttv_context_init(LttvTracesetContext *self, LttvTraceset *ts)
 {
index 4176313c82391c008ede664a67c4f92886266af1..a753b80240a9f94ada179f2b76f32ff9910a11d4 100644 (file)
@@ -3,6 +3,7 @@
 #include <ltt/facility.h>
 #include <ltt/trace.h>
 #include <ltt/event.h>
+#include <ltt/type.h>
 
 LttvExecutionMode
   LTTV_STATE_MODE_UNKNOWN,
@@ -257,7 +258,7 @@ static void state_save(LttvTraceState *self, LttvAttribute *container)
         LTTV_POINTER);
     if(tfcs->parent.e == NULL) *(value.v_pointer) = NULL;
     else {
-      ep = g_new(LttEventPosition, 1);
+      ep = ltt_event_position_new();
       ltt_event_position(tfcs->parent.e, ep);
       *(value.v_pointer) = ep;
     }
@@ -861,7 +862,7 @@ static gboolean block_end(void *hook_data, void *call_data)
 
   LttvTraceState *tcs = (LttvTraceState *)(tfcs->parent.t_context);
 
-  LttEventPosition ep;
+  LttEventPosition *ep = ltt_event_position_new();
 
   guint nb_block, nb_event;
 
@@ -871,9 +872,9 @@ static gboolean block_end(void *hook_data, void *call_data)
 
   LttvAttributeValue value;
 
-  ltt_event_position(tfcs->parent.e, &ep);
+  ltt_event_position(tfcs->parent.e, ep);
 
-  ltt_event_position_get(&ep, &nb_block, &nb_event, &tf);
+  ltt_event_position_get(ep, &nb_block, &nb_event, &tf);
   tcs->nb_event += nb_event - tfcs->saved_position;
   tfcs->saved_position = 0;
   if(tcs->nb_event >= tcs->save_interval) {
index dbdd253668466a1c31b3b6e142639cb8d3a6457f..3333823d9095778bf315a75f1e2cc044b4ebe50b 100644 (file)
@@ -218,8 +218,9 @@ print_stats(FILE *fp, LttvTracesetStats *tscs)
   for(i = 0 ; i < nb ; i++) {
     tcs = (LttvTraceStats *)(LTTV_TRACESET_CONTEXT(tscs)->traces[i]);
     desc = ltt_trace_system_description(tcs->parent.parent.t);
-    fprintf(fp, "Trace on system %s at time %d secs:\n", desc->node_name, 
-        desc->trace_start.tv_sec);
+    fprintf(fp, "Trace on system %s at time %d secs:\n", 
+           ltt_trace_system_description_node_name(desc), 
+           (ltt_trace_system_description_trace_start_time(desc)).tv_sec);
     saved_length = indent->len;
     g_string_append(indent, "  ");
     print_tree(fp, indent, tcs->stats);
@@ -279,8 +280,10 @@ static gboolean write_trace_header(void *hook_data, void *call_data)
 
   LttSystemDescription *system = ltt_trace_system_description(tc->t);
 
-  fprintf(a_file,"  Trace from %s in %s\n%s\n\n", system->node_name, 
-      system->domain_name, system->description);
+  fprintf(a_file,"  Trace from %s in %s\n%s\n\n", 
+         ltt_trace_system_description_node_name(system), 
+         ltt_trace_system_description_domain_name(system), 
+         ltt_trace_system_description_description(system));
   return FALSE;
 }
 
This page took 0.037667 seconds and 4 git commands to generate.