compile fixes
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 23 Jun 2003 14:49:42 +0000 (14:49 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Mon, 23 Jun 2003 14:49:42 +0000 (14:49 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@94 04897980-b3bd-0310-b5e0-8ef037075253

19 files changed:
ltt/branches/poly/doc/user/guiEvents.txt
ltt/branches/poly/include/ltt/LTTTypes.h [new file with mode: 0644]
ltt/branches/poly/include/ltt/ltt-private.h
ltt/branches/poly/include/ltt/ltt.h
ltt/branches/poly/include/lttv/gtkTraceSet.h
ltt/branches/poly/include/lttv/hook.h
ltt/branches/poly/include/lttv/traceSet.h
ltt/branches/poly/ltt/LTTTypes.h [deleted file]
ltt/branches/poly/ltt/event.c
ltt/branches/poly/ltt/facility.c
ltt/branches/poly/ltt/tracefile.c
ltt/branches/poly/ltt/type.c
ltt/branches/poly/lttv/attribute.c
ltt/branches/poly/lttv/hook.c
ltt/branches/poly/lttv/main.c
ltt/branches/poly/lttv/module.c
ltt/branches/poly/lttv/option.c
ltt/branches/poly/lttv/plugins/README
ltt/branches/poly/lttv/plugins/guiEvents.c

index e7531b1a5c7489c0f010f81634ee01df4a358457..585b55aaf479708ce29801345fca02475c5139ee 100644 (file)
@@ -14,12 +14,12 @@ tab or remove it.
 
 It them appears in the current tab. If there are events to display in the
 current time frame selected by the tab, you should already see them in the
-list. You can move the scrollbar on the left side up and down to display
+list. You can move the scrollbar on the right side up and down to display
 the different events in the list. As you can see, this list is limited to
 the currently viewed time interval. In order to see more events in this
 list, you can use a Zoom Extended of the main window (this will show all
 the trace's events). You can also specify the laps of time you want to see
-using Show Time Frame.
+using the main window's Show Time Frame.
 
 One important feature of this plugin is the ability to inform the tab in
 which it resides of the currently selected event. By clicking on an event,
diff --git a/ltt/branches/poly/include/ltt/LTTTypes.h b/ltt/branches/poly/include/ltt/LTTTypes.h
new file mode 100644 (file)
index 0000000..2c054a1
--- /dev/null
@@ -0,0 +1,142 @@
+/*
+ * LTTTypes.h
+ *
+ * Copyright (C) 2000 Karim Yaghmour (karym@opersys.com).
+ *
+ * This is distributed under GPL.
+ *
+ * Header for LTT-secific types.
+ *
+ * History : 
+ *    K.Y.  07/09/2001, Added David Schleef's architecture independent ltt_set_bit/ltt_clear_bit/ltt_test_bit
+ *    JAL,  05/01/2001, Modified PPC bit manipulation functions for x86 compatibility.
+ *                      (andy_lowe@mvista.com)
+ *    K.Y., 31/05/2000, Initial typing.
+ */
+
+#ifndef __TRACE_TOOLKIT_TYPES_HEADER__
+#define __TRACE_TOOLKIT_TYPES_HEADER__
+
+#include <sys/types.h>
+#include <sys/time.h>
+
+#if defined(sun)
+
+typedef unsigned char          u_int8_t;
+typedef unsigned short         u_int16_t;
+typedef unsigned int           u_int32_t;
+#ifdef _LP64
+typedef unsigned long          u_int64_t;
+#else  /* _ILP32 */
+#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
+typedef unsigned long long     u_int64_t;
+#endif /* __STDC__ - 0 == 0 && !defined(_NO_LONGLONG) */
+#endif /* _LP64 */
+
+#endif /* defined(sun) */
+
+extern __inline__ int ltt_set_bit(int nr, void * addr)
+{
+  unsigned char *p = addr;
+  unsigned char mask = 1 << (nr&7);
+  unsigned char old;
+
+  p += nr>>3;
+  old = *p;
+  *p |= mask;
+  return ((old & mask) != 0);
+}
+
+extern __inline__ int ltt_clear_bit(int nr, void * addr)
+{
+  unsigned char *p = addr;
+  unsigned char mask = 1 << (nr&7);
+  unsigned char old;
+
+  p += nr>>3;
+  old = *p;
+  *p &= ~mask;
+  return ((old & mask) != 0);
+}
+
+extern __inline__ int ltt_test_bit(int nr,void *addr)
+{
+  unsigned char *p = addr;
+  unsigned char mask = 1 << (nr&7);
+  p += nr>>3;
+  return ((*p & mask) != 0);
+}
+
+/* Big-endian/little-endian conversion macros for cross-development. */
+#if TARGET_NATIVE
+/* For native development, these conversion macros aren't needed. */
+#define BREV16(x)   (x)
+#define BREV32(x)   (x)
+#define BREV64(x)   (x)
+#define RFT8(db,x)  (x)
+#define RFT16(db,x) (x)
+#define RFT32(db,x) (x)
+#define RFT64(db,x) (x)
+
+/* Non-native development */
+#else
+        /* BREV16: byte-reverse a 16-bit integer */
+#define BREV16(x) ((((x) & 0xff00) >> 8) | (((x) & 0x00ff) << 8))
+       /* BREV32: byte-reverse a 32-bit integer */
+#define BREV32(x) ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) \
+                | (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
+       /* BREV64: byte-reverse a 64-bit integer */
+#define BREV64(x) ((((x) & 0xff00000000000000) >> 56) \
+                 | (((x) & 0x00ff000000000000) >> 40) \
+                | (((x) & 0x0000ff0000000000) >> 24) \
+                | (((x) & 0x000000ff00000000) >>  8) \
+                | (((x) & 0x00000000ff000000) <<  8) \
+                | (((x) & 0x0000000000ff0000) << 24) \
+                | (((x) & 0x000000000000ff00) << 40) \
+                | (((x) & 0x00000000000000ff) << 56))
+       /* RFTn: Read From Trace
+        *      Conditionally byte-reverse an 8-, 16-, 32-, or 64-bit integer
+        *      based on the value of the ByteRev member of the trace database
+        *      structure pointer passed as the first argument..
+        */
+#define RFT8(db,x)  (x)
+#define RFT16(db,x) ((db)->ByteRev ? BREV16(x) : (x))
+#define RFT32(db,x) ((db)->ByteRev ? BREV32(x) : (x))
+#define RFT64(db,x) ((db)->ByteRev ? BREV64(x) : (x))
+#endif /* TRACE_TARGET_NATIVE */
+
+#if !defined(sun)
+/* Some type corrections, just in case */
+#ifndef uint8_t
+#define uint8_t u_int8_t
+#endif
+#ifndef uint16_t
+#define uint16_t u_int16_t
+#endif
+#ifndef uint32_t
+#define uint32_t u_int32_t
+#endif
+#ifndef uint64_t
+#define uint64_t u_int64_t
+#endif
+#endif /* !defined(sun) */
+
+/* Structure packing */
+#if LTT_UNPACKED_STRUCTS
+#define LTT_PACKED_STRUCT
+#else
+#define LTT_PACKED_STRUCT __attribute__ ((packed))
+#endif /* UNPACKED_STRUCTS */
+
+/* Trace mask */
+typedef uint64_t trace_event_mask;
+
+/* Boolean stuff */
+#define TRUE  1
+#define FALSE 0
+
+#endif /* __TRACE_TOOLKIT_TYPES_HEADER__ */
index a15c9f434342c7876cb600d5ab345735447ae08e..31fba84b966ce1e078eb20baec1ec9660301725b 100644 (file)
@@ -1,5 +1,11 @@
+#ifndef LTT_PRIVATE_H
+#define LTT_PRIVATE_H
+
 #include <glib.h>
-#include "ltt/ltt.h"
+#include <ltt/ltt.h>
+#include <ltt/LTTTypes.h>
+#include <ltt/type.h>
+
 
 /* structure definition */
 
@@ -103,9 +109,10 @@ struct _ltt_facility{
   ltt_checksum checksum;     //checksum of the facility 
   ltt_eventtype ** events;   //array of event types 
   unsigned usage_count;      //usage count
-  table all_named_types;     //an array of named ltt_type
-  sequence all_unnamed_types;//an array of unnamed ltt_type
-  sequence all_fields;       //an array of fields
+  //FIXME Specify those types
+  //table all_named_types;     //an array of named ltt_type
+  //sequence all_unnamed_types;//an array of unnamed ltt_type
+  //sequence all_fields;       //an array of fields
 };
 
 struct _ltt_tracefile{
@@ -174,3 +181,5 @@ typedef struct _ptr_wrap{
   gpointer ptr;
 } ptr_wrap;
 
+
+#endif /* LTT_PRIVATE_H */
index 757005306d716ce9d5c141d216fbfa12b16fb874..b140e8464c40527483917bfec60ed81ca83df11c 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef LTT_H
 #define LTT_H
 
+#include <ltt/LTTTypes.h>
 
 /* A trace is associated with a tracing session run on a single, possibly
    multi-cpu, system. It is defined as a pathname to a directory containing
index 739c09a67be051930733d3f8ce0d6c70f9fdeae7..03911d74cce34375c01ed689a9f8e319dd2e8eda 100644 (file)
@@ -1,8 +1,13 @@
-/**
- * Main window (main module) is the place to contain and display viewers. 
- * Viewers (lttv modules) interacter with main window though API of the 
- * main window and hooks of itself.
+/*! \file gtkTraceSet.h
+ * \brief API used by the graphical viewers to interact with their top window.
+ * 
+ * Main window (gui module) is the place to contain and display viewers. 
+ * Viewers (lttv plugins) interacte with main window through this API and
+ * events sent by gtk.
  * This header file should be included in each graphic module.
+ * This library is used by graphical modules to interact with the
+ * tracesetWindow.
+ * 
  */
 
 #include <gtk/gtk.h>
  * Function to register a view constructor so that main window can generate
  * a toolbar item for the viewer in order to generate a new instance easily. 
  * It will be called by init function of the module.
- * @param pixmap, pixmap shown on the toolbar item.
- * @param tooltip, tooltip of the toolbar item.
- * @view_constructor, constructor of the viewer. 
+ * @param ButtonPixmap image shown on the toolbar item.
+ * @param tooltip tooltip of the toolbar item.
+ * @param view_constructor constructor of the viewer. 
  */
 
-void ToolbarItemReg(GdkPixmap *pixmap, char *tooltip, void *view_constructor);
+void ToolbarItemReg(gchar **ButtonPixmap, char *tooltip, void *view_constructor);
 
 
 /**
  * Function to unregister the viewer's constructor, release the space 
  * occupied by pixmap, tooltip and constructor of the viewer.
  * It will be called when a module is unloaded.
- * @param view_constructor, constructor of the viewer which is used as 
+ * @param view_constructor constructor of the viewer which is used as 
  * a reference to find out where the pixmap and tooltip are.
  */
 
@@ -36,9 +41,9 @@ void ToolbarItemUnreg(void *view_constructor);
  * Function to register a view constructor so that main window can generate
  * a menu item for the viewer in order to generate a new instance easily.
  * It will be called by init function of the module.
- * @param menu_path, path of the menu item.
- * @param menu_text, text of the menu item.
- * @view_constructor, constructor of the viewer. 
+ * @param menu_path path of the menu item.
+ * @param menu_text text of the menu item.
+ * @param view_constructor constructor of the viewer. 
  */
 
 void MenuItemReg(char *menu_path, char *menu_text, void *view_constructor);
@@ -48,7 +53,7 @@ void MenuItemReg(char *menu_path, char *menu_text, void *view_constructor);
  * Function to unregister the viewer's constructor, release the space 
  * occupied by menu_path, menu_text and constructor of the viewer.
  * It will be called when a module is unloaded.
- * @param view_constructor, constructor of the viewer which is used as 
+ * @param view_constructor constructor of the viewer which is used as 
  * a reference to find out where the menu_path and menu_text are.
  */
 
@@ -58,31 +63,32 @@ void MenuItemUnreg(void *view_constructor);
 /**
  * Attach a viewer to the current tab.
  * It will be called in the constructor of the viewer.
- * @param main_win, the main window the viewer belongs to.
- * @param viewer, viewer to be attached to the current tab
+ * @param main_win the main window the viewer belongs to.
+ * @param viewer viewer to be attached to the current tab
  */
 
-void AttachViewer(MainWindow *main_win, GtkWidget *viewer);
+// Not Needed : Main window add widget returned by constructor
+//void AttachViewer(MainWindow *main_win, GtkWidget *viewer);
 
 
-/* ?? Maybe we do not need this function, when a widget is destoried, 
+/* ?? Maybe we do not need this function, when a widget is destroyed, 
  *    it will be removed automatically from its container             
  */
-
+// Not needed
 /**
  * Detach a viewer from the current tab.
  * It will be called in the destructor of the viewer.
- * @param main_win, the main window the viewer belongs to.
- * @param viewer, viewer to be detached from the current tab.
+ * @param main_win the main window the viewer belongs to.
+ * @param viewer viewer to be detached from the current tab.
  */
 
-void DetachViewer(MainWindow *main_win, GtkWidget *viewer);
+//void DetachViewer(MainWindow *main_win, GtkWidget *viewer);
 
 
 /**
  * Update the status bar whenever something changed in the viewer.
- * @param main_win, the main window the viewer belongs to.
- * @param info, the message which will be shown in the status bar.
+ * @param main_win the main window the viewer belongs to.
+ * @param info the message which will be shown in the status bar.
  */
 
 void UpdateStatus(MainWindow *main_win, char *info);
@@ -93,8 +99,8 @@ void UpdateStatus(MainWindow *main_win, char *info);
  * It will be called by a viewer's hook function to update the 
  * time interval of the viewer and also be called by the constructor
  * of the viewer.
- * @param main_win, the main window the viewer belongs to.
- * @param time_interval, a pointer where time interval will be stored.
+ * @param main_win the main window the viewer belongs to.
+ * @param time_interval a pointer where time interval will be stored.
  */
 
 void GetTimeInterval(MainWindow *main_win, TimeInterval *time_interval);
@@ -104,8 +110,8 @@ void GetTimeInterval(MainWindow *main_win, TimeInterval *time_interval);
  * Function to set the time interval of the current tab.
  * It will be called by a viewer's signal handle associated with 
  * the move_slider signal
- * @param main_win, the main window the viewer belongs to.
- * @param time_interval, a pointer where time interval is stored.
+ * @param main_win the main window the viewer belongs to.
+ * @param time_interval a pointer where time interval is stored.
  */
 
 void SetTimeInterval(MainWindow *main_win, TimeInterval *time_interval);
@@ -115,8 +121,8 @@ void SetTimeInterval(MainWindow *main_win, TimeInterval *time_interval);
  * Function to get the current time/event of the current tab.
  * It will be called by a viewer's hook function to update the 
  * current time/event of the viewer.
- * @param main_win, the main window the viewer belongs to.
- * @param ltt_time, a pointer where time will be stored.
+ * @param main_win the main window the viewer belongs to.
+ * @param ltt_time a pointer where time will be stored.
  */
 
 void GetCurrentTime(MainWindow *main_win, ltt_time *time);
@@ -126,8 +132,8 @@ void GetCurrentTime(MainWindow *main_win, ltt_time *time);
  * Function to set the current time/event of the current tab.
  * It will be called by a viewer's signal handle associated with 
  * the button-release-event signal
- * @param main_win, the main window the viewer belongs to.
- * @param ltt_time, a pointer where time is stored.
+ * @param main_win the main window the viewer belongs to.
+ * @param ltt_time a pointer where time is stored.
  */
 
 void SetCurrentTime(MainWindow *main_win, ltt_time *time);
@@ -137,8 +143,8 @@ void SetCurrentTime(MainWindow *main_win, ltt_time *time);
  * Function to get the traceset from the current tab.
  * It will be called by the constructor of the viewer and also be
  * called by a hook funtion of the viewer to update its traceset.
- * @param main_win, the main window the viewer belongs to.
- * @param traceset, a pointer to a traceset.
+ * @param main_win the main window the viewer belongs to.
+ * @param traceset a pointer to a traceset.
  */
 
 void GetTraceset(MainWindow *main_win, Traceset *traceset);
@@ -159,9 +165,9 @@ void GetFilter(MainWindow *main_win, Filter *filter);
  * Function to register a hook function for a viewer to set/update its
  * time interval.
  * It will be called by the constructor of the viewer.
- * @param hook, hook function of the viewer.
- * @param hook_data, hook data associated with the hook function.
- * @param main_win, the main window the viewer belongs to.
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
  */
 
 void RegUpdateTimeInterval(lttv_hook *hook, TimeInterval *hook_data,
@@ -172,9 +178,9 @@ void RegUpdateTimeInterval(lttv_hook *hook, TimeInterval *hook_data,
  * Function to unregister a viewer's hook function which is used to 
  * set/update the time interval of the viewer.
  * It will be called by the destructor of the viewer.
- * @param hook, hook function of the viewer.
- * @param hook_data, hook data associated with the hook function.
- * @param main_win, the main window the viewer belongs to.
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
  */
 
 void UnregUpdateTimeInterval(lttv_hook *hook, TimeInterval *hook_data,
@@ -185,9 +191,9 @@ void UnregUpdateTimeInterval(lttv_hook *hook, TimeInterval *hook_data,
  * Function to register a hook function for a viewer to set/update its 
  * traceset.
  * It will be called by the constructor of the viewer.
- * @param hook, hook function of the viewer.
- * @param hook_data, hook data associated with the hook function.
- * @param main_win, the main window the viewer belongs to.
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
  */
 
 void RegUpdateTraceset(lttv_hook *hook, Traceset *hook_data,
@@ -198,9 +204,9 @@ void RegUpdateTraceset(lttv_hook *hook, Traceset *hook_data,
  * Function to unregister a viewer's hook function which is used to 
  * set/update the traceset of the viewer.
  * It will be called by the destructor of the viewer.
- * @param hook, hook function of the viewer.
- * @param hook_data, hook data associated with the hook function.
- * @param main_win, the main window the viewer belongs to.
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
  */
 
 void UnregUpdateTraceset(lttv_hook *hook, Traceset *hook_data,
@@ -211,9 +217,9 @@ void UnregUpdateTraceset(lttv_hook *hook, Traceset *hook_data,
  * Function to register a hook function for a viewer to set/update its 
  * filter.
  * It will be called by the constructor of the viewer.
- * @param hook, hook function of the viewer.
- * @param hook_data, hook data associated with the hook function.
- * @param main_win, the main window the viewer belongs to.
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
  */
 
 void RegUpdateFilter(lttv_hook *hook, Filter *hook_data, 
@@ -224,9 +230,9 @@ void RegUpdateFilter(lttv_hook *hook, Filter *hook_data,
  * Function to unregister a viewer's hook function which is used to 
  * set/update the filter of the viewer.
  * It will be called by the destructor of the viewer.
- * @param hook, hook function of the viewer.
- * @param hook_data, hook data associated with the hook function.
- * @param main_win, the main window the viewer belongs to.
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
  */
 
 void UnregUpdateFilter(lttv_hook *hook, Filter *hook_data,
@@ -237,9 +243,9 @@ void UnregUpdateFilter(lttv_hook *hook, Filter *hook_data,
  * Function to register a hook function for a viewer to set/update its 
  * current time.
  * It will be called by the constructor of the viewer.
- * @param hook, hook function of the viewer.
- * @param hook_data, hook data associated with the hook function.
- * @param main_win, the main window the viewer belongs to.
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
  */
 
 void RegUpdateCurrentTime(lttv_hook *hook, ltt_time *hook_data, 
@@ -250,9 +256,9 @@ void RegUpdateCurrentTime(lttv_hook *hook, ltt_time *hook_data,
  * Function to unregister a viewer's hook function which is used to 
  * set/update the current time of the viewer.
  * It will be called by the destructor of the viewer.
- * @param hook, hook function of the viewer.
- * @param hook_data, hook data associated with the hook function.
- * @param main_win, the main window the viewer belongs to.
+ * @param hook hook function of the viewer.
+ * @param hook_data hook data associated with the hook function.
+ * @param main_win the main window the viewer belongs to.
  */
 
 void UnregUpdateCurrentTime(lttv_hook *hook, ltt_time *hook_data,
index b5e6ed8d97b42ee19e0574a91995456a76b89ec2..e3417d0124ce1f0cabd50ab2580118fcfee7796d 100644 (file)
@@ -6,8 +6,8 @@
 /* A hook is a function to call with the supplied hook data, and with 
    call site specific data (e.g., hooks for events are called with a 
    pointer to the current event). */
-
-typedef bool (*lttv_hook)(void *hook_data, void *call_data);
+// MD compile fix: int instead of bool as return value
+typedef int (*lttv_hook)(void *hook_data, void *call_data);
 
 
 /* A list of hooks allows registering hooks to be called later. */
@@ -29,9 +29,9 @@ void lttv_hooks_get(lttv_hooks *h, unsigned i, lttv_hook *f, void **hook_data);
 
 void lttv_hooks_remove_by_position(lttv_hooks *h, unsigned i);
 
-bool lttv_hooks_call(lttv_hooks *h, void *call_data);
+int lttv_hooks_call(lttv_hooks *h, void *call_data);
 
-bool lttv_hooks_call_check(lttv_hooks *h, void *call_data);
+int lttv_hooks_call_check(lttv_hooks *h, void *call_data);
 
 
 /* Sometimes different hooks need to be called based on the case. The
index 60955bc7d7c3ed4f14002a6faafc84da78c7f45f..292b6e83c321baccccfecd8e1f42fb75713335bd 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <lttv/attribute.h>
 #include <lttv/hook.h>
+#include <ltt/ltt.h>
 
 /* A traceSet is a set of traces to be analyzed together. */
 
diff --git a/ltt/branches/poly/ltt/LTTTypes.h b/ltt/branches/poly/ltt/LTTTypes.h
deleted file mode 100644 (file)
index 2c054a1..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * LTTTypes.h
- *
- * Copyright (C) 2000 Karim Yaghmour (karym@opersys.com).
- *
- * This is distributed under GPL.
- *
- * Header for LTT-secific types.
- *
- * History : 
- *    K.Y.  07/09/2001, Added David Schleef's architecture independent ltt_set_bit/ltt_clear_bit/ltt_test_bit
- *    JAL,  05/01/2001, Modified PPC bit manipulation functions for x86 compatibility.
- *                      (andy_lowe@mvista.com)
- *    K.Y., 31/05/2000, Initial typing.
- */
-
-#ifndef __TRACE_TOOLKIT_TYPES_HEADER__
-#define __TRACE_TOOLKIT_TYPES_HEADER__
-
-#include <sys/types.h>
-#include <sys/time.h>
-
-#if defined(sun)
-
-typedef unsigned char          u_int8_t;
-typedef unsigned short         u_int16_t;
-typedef unsigned int           u_int32_t;
-#ifdef _LP64
-typedef unsigned long          u_int64_t;
-#else  /* _ILP32 */
-#if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)
-typedef unsigned long long     u_int64_t;
-#endif /* __STDC__ - 0 == 0 && !defined(_NO_LONGLONG) */
-#endif /* _LP64 */
-
-#endif /* defined(sun) */
-
-extern __inline__ int ltt_set_bit(int nr, void * addr)
-{
-  unsigned char *p = addr;
-  unsigned char mask = 1 << (nr&7);
-  unsigned char old;
-
-  p += nr>>3;
-  old = *p;
-  *p |= mask;
-  return ((old & mask) != 0);
-}
-
-extern __inline__ int ltt_clear_bit(int nr, void * addr)
-{
-  unsigned char *p = addr;
-  unsigned char mask = 1 << (nr&7);
-  unsigned char old;
-
-  p += nr>>3;
-  old = *p;
-  *p &= ~mask;
-  return ((old & mask) != 0);
-}
-
-extern __inline__ int ltt_test_bit(int nr,void *addr)
-{
-  unsigned char *p = addr;
-  unsigned char mask = 1 << (nr&7);
-  p += nr>>3;
-  return ((*p & mask) != 0);
-}
-
-/* Big-endian/little-endian conversion macros for cross-development. */
-#if TARGET_NATIVE
-/* For native development, these conversion macros aren't needed. */
-#define BREV16(x)   (x)
-#define BREV32(x)   (x)
-#define BREV64(x)   (x)
-#define RFT8(db,x)  (x)
-#define RFT16(db,x) (x)
-#define RFT32(db,x) (x)
-#define RFT64(db,x) (x)
-
-/* Non-native development */
-#else
-        /* BREV16: byte-reverse a 16-bit integer */
-#define BREV16(x) ((((x) & 0xff00) >> 8) | (((x) & 0x00ff) << 8))
-       /* BREV32: byte-reverse a 32-bit integer */
-#define BREV32(x) ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) \
-                | (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
-       /* BREV64: byte-reverse a 64-bit integer */
-#define BREV64(x) ((((x) & 0xff00000000000000) >> 56) \
-                 | (((x) & 0x00ff000000000000) >> 40) \
-                | (((x) & 0x0000ff0000000000) >> 24) \
-                | (((x) & 0x000000ff00000000) >>  8) \
-                | (((x) & 0x00000000ff000000) <<  8) \
-                | (((x) & 0x0000000000ff0000) << 24) \
-                | (((x) & 0x000000000000ff00) << 40) \
-                | (((x) & 0x00000000000000ff) << 56))
-       /* RFTn: Read From Trace
-        *      Conditionally byte-reverse an 8-, 16-, 32-, or 64-bit integer
-        *      based on the value of the ByteRev member of the trace database
-        *      structure pointer passed as the first argument..
-        */
-#define RFT8(db,x)  (x)
-#define RFT16(db,x) ((db)->ByteRev ? BREV16(x) : (x))
-#define RFT32(db,x) ((db)->ByteRev ? BREV32(x) : (x))
-#define RFT64(db,x) ((db)->ByteRev ? BREV64(x) : (x))
-#endif /* TRACE_TARGET_NATIVE */
-
-#if !defined(sun)
-/* Some type corrections, just in case */
-#ifndef uint8_t
-#define uint8_t u_int8_t
-#endif
-#ifndef uint16_t
-#define uint16_t u_int16_t
-#endif
-#ifndef uint32_t
-#define uint32_t u_int32_t
-#endif
-#ifndef uint64_t
-#define uint64_t u_int64_t
-#endif
-#endif /* !defined(sun) */
-
-/* Structure packing */
-#if LTT_UNPACKED_STRUCTS
-#define LTT_PACKED_STRUCT
-#else
-#define LTT_PACKED_STRUCT __attribute__ ((packed))
-#endif /* UNPACKED_STRUCTS */
-
-/* Trace mask */
-typedef uint64_t trace_event_mask;
-
-/* Boolean stuff */
-#define TRUE  1
-#define FALSE 0
-
-#endif /* __TRACE_TOOLKIT_TYPES_HEADER__ */
index 20d71d91a17d09b1e4c5e2e8160dc2425c045111..791dabcc5512c49e8ef1fcf06c2f8c267d8282fc 100644 (file)
@@ -2,7 +2,7 @@
 #include <asm/types.h>
 #include <linux/byteorder/swab.h>
 
-#include "LTTTypes.h"  
+#include <ltt/LTTTypes.h> 
 #include "parser.h"
 #include <ltt/event.h>
 
index ad489cae211988fd0b4ce4a7e32502cbb17336c4..5ededcaa9514d2f9daea2313c4633a0f9492cfa4 100644 (file)
@@ -2,7 +2,7 @@
 #include <string.h>
 #include <stdio.h>
 
-#include "LTTTypes.h"  
+#include <ltt/LTTTypes.h>  
 #include "parser.h"
 #include <ltt/facility.h>
 
index bfd8748230ef8829c46dc5e891b218c8a99ef65d..f1b14a828d28db792f52b4a86d87fb4392334318 100644 (file)
@@ -4,7 +4,7 @@
 #include <sys/types.h>
 #include <linux/errno.h>  
 
-#include "LTTTypes.h"  
+#include <ltt/LTTTypes.h>  
 #include "parser.h"
 #include <ltt/tracefile.h>
 
index 981507726abcd6b9107aa8ddc9776a0885c6f4ed..34a7b5d6a8dea3fe4c2c456270ce244a6bf3ad15 100644 (file)
@@ -1,6 +1,6 @@
 #include <stdio.h>
 
-#include "LTTTypes.h"  
+#include <ltt/LTTTypes.h> 
 #include "parser.h"
 #include <ltt/type.h>
 
index 973bdc9e98e4ae59afcefd8b44c549ae0a19bce6..a8c7211595c9e97e49cb7d6877f022763e612e8e 100644 (file)
@@ -1,4 +1,4 @@
-#include "attribute.h"
+#include <lttv/attribute.h>
 
 inline lttv_string_id lttv_string_id_from_string(const char *s) {
   return g_quark_from_string(s);
@@ -311,7 +311,6 @@ int lttv_key_compare_priority(lttv_key *a, lttv_key *b, void *compare_data)
   return 0;
 }
 
-
 typedef struct _select_data {
   lttv_attributes *a;
   lttv_key *k;
index 18ed98efb2dc0b3e91e33bb91d844167ea1fee12..eb7c5d9f194a302d9d3d0f4f1104320419e460cb 100644 (file)
@@ -30,7 +30,7 @@ inline void lttv_hooks_add(lttv_hooks *h, lttv_hook f, void *hook_data) {
 }
 
 
-void lttv_hooks_call(lttv_hooks *h, void *call_data)
+int lttv_hooks_call(lttv_hooks *h, void *call_data)
 {
   int i;
   lttv_hook_closure * c;
index 54093b267cd1b129d19d74ded454fae556ab9802..d44d8f51b90f623b88e462f45543a90131924b8a 100644 (file)
@@ -2,11 +2,13 @@
 #include <lttv/hook.h>
 #include <lttv/module.h>
 
-#include "lttv.h"
-#include "trace.h"
-#include "attribute.h"
-#include "option.h"
+#include <lttv/lttv.h>
+#include <lttv/attribute.h>
+#include <lttv/option.h>
 
+#include <lttv/traceSet.h>
+
+#include <ltt/trace.h>
 /* The main program maintains a few central data structures and relies
    on modules for the rest. These data structures may be accessed by modules
    through an exported API */
index efeceec09c6b79684b2d378627032d7cedc4a5cc..384ad3437079b5f7728ecc8907fa4aaed3813086 100644 (file)
@@ -9,7 +9,7 @@
 
 #include <popt.h>
 #include <lttv/module.h>
-#include "lttv.h"
+#include <lttv/lttv.h>
 
 /* Table of loaded modules and paths where to search for modules */
 
@@ -267,7 +267,7 @@ int lttv_module_unload(lttv_module_info *moduleInfo, loadtype load) {
 }
 
 #define MODULE_I ((lttv_module_info *)modulesStandalone->pdata[i])
-
+//FIXME use g_ptr_array_index instead
 /* unload all the modules in the hash table, calling module_destroy for
  * each of them.
  *
index eb62e6c354da31c13b9b5e5691139a9c545eb322..c5046ef861a2100dd10d115373e0cec20ea58efa 100644 (file)
@@ -1,8 +1,8 @@
 #include <popt.h>
 
 #include <lttv/hook.h>
-#include "lttv.h"
-#include "option.h"
+#include <lttv/lttv.h>
+#include <lttv/option.h>
 
 /* Extensible array of popt command line options. Modules add options as
    they are loaded and initialized. */
index 7649e025cecb0f59d88c3f17858c99cc64ff0056..e812e6a810d7aa74493cfa61055c1f17d86dc464 100644 (file)
@@ -3,8 +3,11 @@
 |Graphical Plugins|
 |-----------------|
 
-guiEvents.c : Display events for time interval, drawing them using gdk.
-guiControlFlow.c : Display the control flow of the trace for time interval.
+guiEvents.c : Display events for time interval into a list.
+guiControlFlow.c : Display the control flow of the trace for time interval
+                   using gdk and a GtkDrawingArea. Pixmaps for icons are
+                  defined with each event inside the event related
+                  information.
 
 
 |---------------------|
index 5efe8a95602e3b273d093cdac93542a74ad07e02..b24dac40dbe321c5bbca73902260c371c9da8df7 100644 (file)
@@ -14,7 +14,8 @@
  * creates ans register through API functions what is needed to interact
  * with the TraceSet window.
  *
- * Author : Mathieu Desnoyers, June 2003
+ * Author : Karim Yaghmour
+ *          Integrated to LTTng by Mathieu Desnoyers, June 2003
  */
 
 #include <glib.h>
@@ -26,6 +27,9 @@
 
 #include "icons/guiEventsInsert.xpm"
 
+/** Array containing instanced objects. Used when module is unloaded */
+static GPtrArray *RawTracesArray = NULL;
+
 //! Event Viewer's constructor
 GtkWidget *guiEvents(GtkWidget *ParentWindow);
 
@@ -44,6 +48,7 @@ G_MODULE_EXPORT void init() {
        /* Register the menu item insert entry */
        MenuItemReg("/", "Insert Event Viewer", guiEvent);
 
+       RawTracesArray = g_ptr_array_new();
 }
 
 /**
@@ -53,8 +58,16 @@ G_MODULE_EXPORT void init() {
  * everything that has been registered in the gtkTraceSet API.
  */
 G_MODULE_EXPORT void destroy() {
+       int i;
+       
        g_critical("GUI Event Viewer destroy()");
 
+       for(i=0 ; i<RawTracesArray->len ; i++) {
+               gtk_widget_destroy((Widget *)g_ptr_array_index(RawTracesArray,i));
+       }
+       
+       g_ptr_array_free(RawTracesArray);
+
        /* Unregister the toolbar insert button */
        ToolbarItemUnreg(guiEvent);
 
@@ -73,10 +86,415 @@ G_MODULE_EXPORT void destroy() {
 static GtkWidget *
 guiEvents(GtkWidget *ParentWindow)
 {
+       
+
+  /* Create raw trace list and pack it */
+  pWindow->RTCList  = gtk_clist_new_with_titles(RTCLIST_NB_COLUMNS, RTCListTitles);
+  gtk_clist_set_selection_mode(GTK_CLIST(pWindow->RTCList), GTK_SELECTION_SINGLE);
+  gtk_box_pack_start(GTK_BOX(pWindow->RTHBox), pWindow->RTCList, TRUE, TRUE, 0);
+
+  /* Create vertical scrollbar and pack it */
+  pWindow->RTVScroll  = gtk_vscrollbar_new(NULL);
+  gtk_box_pack_start(GTK_BOX(pWindow->RTHBox), pWindow->RTVScroll, FALSE, TRUE, 0);
+
+  /* Get the vertical scrollbar's adjustment */
+  pWindow->RTVAdjust = gtk_range_get_adjustment(GTK_RANGE(pWindow->RTVScroll));
+
+  /* Configure the columns of the list */
+  gtk_clist_set_column_justification(GTK_CLIST(pWindow->RTCList), 0, GTK_JUSTIFY_LEFT);
+  gtk_clist_set_column_justification(GTK_CLIST(pWindow->RTCList), 1, GTK_JUSTIFY_LEFT);
+  gtk_clist_set_column_justification(GTK_CLIST(pWindow->RTCList), 2, GTK_JUSTIFY_RIGHT);
+  gtk_clist_set_column_justification(GTK_CLIST(pWindow->RTCList), 3, GTK_JUSTIFY_RIGHT);
+  gtk_clist_set_column_justification(GTK_CLIST(pWindow->RTCList), 4, GTK_JUSTIFY_RIGHT);
+  gtk_clist_set_column_justification(GTK_CLIST(pWindow->RTCList), 5, GTK_JUSTIFY_LEFT);
+  gtk_clist_set_column_width(GTK_CLIST(pWindow->RTCList), 0, 45);
+  gtk_clist_set_column_width(GTK_CLIST(pWindow->RTCList), 1, 120);
+  gtk_clist_set_column_width(GTK_CLIST(pWindow->RTCList), 2, 120);
+  gtk_clist_set_column_width(GTK_CLIST(pWindow->RTCList), 3, 45);
+  gtk_clist_set_column_width(GTK_CLIST(pWindow->RTCList), 4, 60);
+
+
+       
+  /*  Raw event trace */
+  gtk_widget_show(pmWindow->RTHBox);
+  gtk_widget_show(pmWindow->RTCList);
+  gtk_widget_show(pmWindow->RTVScroll);
+
+
+}
+
+static GtkWidget
+~guiEvents(GtkWidget *guiEvents)
+{
+  /*  Clear raw event trace */
+  gtk_clist_clear(GTK_CLIST(pSysView->Window->RTCList));
+  gtk_widget_queue_resize(pSysView->Window->RTCList);
+
+  /* Reset the CList adjustment */
+  pSysView->Window->RTVAdjust->lower          = 0;
+  pSysView->Window->RTVAdjust->upper          = 0;
+  pSysView->Window->RTVAdjust->step_increment = 0;
+  pSysView->Window->RTVAdjust->page_increment = 0;
+  pSysView->Window->RTVAdjust->page_size      = 0;
+  gtk_adjustment_changed(GTK_ADJUSTMENT(pSysView->Window->RTVAdjust));
+
+}
+
+
+/* Imported code from LTT 0.9.6pre2 tracevisualizer */
+
+
+/******************************************************************
+ * Function :
+ *    WDI_gtk_clist_set_last_row_data_full()
+ * Description :
+ *    Appends data to the last row of a GtkClist.
+ * Parameters :
+ * Return values :
+ *    NONE.
+ * History :
+ *    J.H.D., 27/08/99, Initial typing.
+ * Note :
+ *    Based on gtk_clist_set_row_data_full() version 1.2.3.
+ *    Much faster than using gtk_clist_set_row_data_full().
+ ******************************************************************/
+void WDI_gtk_clist_set_last_row_data_full(GtkCList*         pmClist,
+                                         gpointer          pmData,
+                                         GtkDestroyNotify  pmDestroy)
+{
+  GtkCListRow *pClistRow;
 
+  g_return_if_fail (pmClist != NULL);
+  g_return_if_fail (GTK_IS_CLIST (pmClist));
+  g_return_if_fail (pmClist->row_list_end != NULL);
 
+  pClistRow = pmClist->row_list_end->data;
+  pClistRow->data    = pmData;
+  pClistRow->destroy = pmDestroy;
 }
 
 
+/******************************************************************
+ * Function :
+ *    SHRTEventSelect()
+ * Description :
+ * Parameters :
+ * Return values :
+ * History :
+ * Note :
+ ******************************************************************/
+void SHRTEventSelect(GtkWidget*      pmCList,
+                    gint            pmRow,
+                    gint            pmColumn,
+                    GdkEventButton* pmEvent,
+                    gpointer        pmData)
+{
+  systemView*  pSysView;        /* The system being displayed */
+
+  /* Do we have anything meaningfull */
+  if((pSysView = (systemView*) pmData) == NULL)
+    return;
+
+  /* Store the selected event */
+  pSysView->Window->LastSelectedEvent = *(event*) gtk_clist_get_row_data(GTK_CLIST(pmCList), pmRow);
+  pSysView->Window->EventSelected = TRUE;
+}
+
+/******************************************************************
+ * Function :
+ *    SHRTEventButtonPress()
+ * Description :
+ * Parameters :
+ * Return values :
+ * History :
+ * Note :
+ ******************************************************************/
+void SHRTEventButtonPress(GtkWidget*      pmCList,
+                         GdkEventButton* pmEvent,
+                         gpointer        pmData)
+{
+  systemView*  pSysView;        /* The system being displayed */
+  gint         row, column;     /* The clicked row and column */
+
+  /* Do we have anything meaningfull */
+  if((pSysView = (systemView*) pmData) == NULL)
+    return;
+
+  /* if we have a right-click event */
+  if(pmEvent->button == 3)
+    /* If we clicked on an item, get its row and column values */
+    if(gtk_clist_get_selection_info(GTK_CLIST(pmCList), pmEvent->x, pmEvent->y, &row, &column))
+      {
+      /* Highlight the selected row */
+      gtk_clist_select_row(GTK_CLIST(pmCList), row, column);
+
+      /* Store the selected event */
+      pSysView->Window->LastSelectedEvent = *(event*) gtk_clist_get_row_data(GTK_CLIST(pmCList), row);
+      pSysView->Window->EventSelected = TRUE;
+
+      /* Display the popup menu */
+      gtk_menu_popup(GTK_MENU(pSysView->Window->RawEventPopup),
+                    NULL, NULL, NULL, NULL,
+                    pmEvent->button, GDK_CURRENT_TIME);
+      }
+}
+
+
+/******************************************************************
+ * Function :
+ *    SHRTVAdjustValueChanged()
+ * Description :
+ * Parameters :
+ * Return values :
+ * History :
+ * Note :
+ ******************************************************************/
+void SHRTVAdjustValueChanged(GtkAdjustment*  pmVAdjust,
+                            gpointer        pmData)
+{
+  event        lEvent;          /* Event used for searching */
+  guint32      lPosition;       /* The position to scroll to */
+  systemView*  pSysView;        /* The system being displayed */
+
+  /* Do we have anything meaningfull */
+  if((pSysView = (systemView*) pmData) == NULL)
+    return;
+
+  /* Is there an event database? */
+  if(pSysView->EventDB == NULL)
+    return;
+
+  /* Set the pointer to the first event */
+  if(pSysView->EventDB->TraceStart == NULL)
+    return;
+
+  /* Are we closer to the beginning? */
+  if((pmVAdjust->value - (pmVAdjust->upper / 2)) < 0)
+    {
+    /* Set the navigation pointer to the beginning of the list */
+    lEvent =  pSysView->EventDB->FirstEvent;
+
+    /* Calculate distance from beginning */
+    lPosition = (guint32) pmVAdjust->value;
+
+    /* Find the event in the event database */
+    while(lPosition > 0)
+      {
+      lPosition--;
+      if(DBEventNext(pSysView->EventDB, &lEvent) != TRUE)
+       break;
+      }
+    }
+  else
+    {
+    /* Set the navigation pointer to the end of the list */
+    lEvent = pSysView->EventDB->LastEvent;
+
+    /* Calculate distance from end */
+    lPosition = (guint32) (pmVAdjust->upper - pmVAdjust->value);
+
+    /* Find the event in the event database */
+    while(lPosition > 0)
+      {
+      lPosition--;
+      if(DBEventPrev(pSysView->EventDB, &lEvent) != TRUE)
+       break;
+      }
+    }
+
+  /* Fill the event list according to what was found */
+  WDFillEventList(pSysView->Window->RTCList,
+                 pSysView->EventDB,
+                 pSysView->System,
+                 &lEvent,
+                 &(pSysView->Window->LastSelectedEvent));
+}
+
+
+
+/******************************************************************
+ * Function :
+ *    WDConnectSignals()
+ * Description :
+ *    Attaches signal handlers to the window items.
+ * Parameters :
+ *    pmSysView, System view for which signals have to be connected
+ * Return values :
+ *    NONE
+ * History :
+ * Note :
+ *    This function attaches a pointer to the main window during
+ *    the connect. This means that the handlers will get a pointer
+ *    to the window in the data argument.
+ ******************************************************************/
+void WDConnectSignals(systemView* pmSysView)
+{
+  /* Raw event Popup menu */
+  gtk_signal_connect(GTK_OBJECT(pmSysView->Window->RawGotoProcess),
+                    "activate",
+                    GTK_SIGNAL_FUNC(SHGotoProcAnalysis),
+                    pmSysView);
+  gtk_signal_connect(GTK_OBJECT(pmSysView->Window->RawViewEvent),
+                    "activate",
+                    GTK_SIGNAL_FUNC(SHViewEventInEG),
+                    pmSysView);
+
+  /* Set event list callbacks */
+  gtk_signal_connect(GTK_OBJECT(pmSysView->Window->RTCList),
+                    "select_row",
+                    GTK_SIGNAL_FUNC(SHRTEventSelect),
+                    pmSysView);
+  gtk_signal_connect(GTK_OBJECT(pmSysView->Window->RTCList),
+                    "button-press-event",
+                    GTK_SIGNAL_FUNC(SHRTEventButtonPress),
+                    pmSysView);
+  gtk_signal_connect(GTK_OBJECT(pmSysView->Window->RTVAdjust),
+                    "value-changed",
+                    GTK_SIGNAL_FUNC(SHRTVAdjustValueChanged),
+                    pmSysView);
+
+
+}
+
+
+/******************************************************************
+ * Function :
+ *    WDFillEventList()
+ * Description :
+ *    Fills the window's event list using the trace database.
+ * Parameters :
+ *    pmList, The list to be filled.
+ *    pmTraceDB, The database of events.
+ *    pmSystem, The system to which this list belongs.
+ *    pmEvent, Event from which we start drawing.
+ *    pmSelectedEvent, Event selected if any.
+ * Return values :
+ *    NONE.
+ * History :
+ *    K.Y., 18/06/99, Initial typing.
+ * Note :
+ ******************************************************************/
+void WDFillEventList(GtkWidget*  pmList,
+                    db*         pmTraceDB,
+                    systemInfo* pmSystem,
+                    event*      pmEvent,
+                    event*      pmSelectedEvent)
+{
+  gint                i = 0;                              /* Generic index */
+  event               lEvent;                             /* Generic event */
+  gchar               lTimeStr[TIME_STR_LEN];             /* Time of event */
+  static gchar*       lString[RTCLIST_NB_COLUMNS]={'\0'}; /* Strings describing event */
+  process*            pProcess;                           /* Generic process pointer */
+#if SUPP_RTAI
+  RTAItask*           pTask = NULL;                       /* Generic task pointer */
+#endif /* SUPP_RTAI */
+  eventDescription    lEventDesc;                         /* Description of event */
+
+  /* Did we allocate space for strings */
+  if(lString[0] == NULL)
+    /* Allocate space for strings */
+    for (i = 0;  i < RTCLIST_NB_COLUMNS - 1; i++)
+      lString[i] = (char*) g_malloc(MW_DEFAULT_STRLEN);
+
+  /* Allocate space for description string */
+  lString[RTCLIST_NB_COLUMNS - 1] = (char*) g_malloc(MW_LONG_STRLEN);
+
+  /* If no event was supplied, start at the beginning */
+  if(pmEvent == NULL)
+    lEvent = pmTraceDB->FirstEvent;
+  else
+    lEvent = *pmEvent;
+
+  /* Freeze and clear clist */
+  gtk_clist_freeze(GTK_CLIST(pmList));
+  gtk_clist_clear(GTK_CLIST(pmList));
+
+  /* Reset index */
+  i = 0;
+
+  /* Go through the event list */
+  do
+    {
+    /* Get the event description */
+    DBEventDescription(pmTraceDB, &lEvent, TRUE, &lEventDesc);
+
+    /* Get the event's process */
+    pProcess = DBEventProcess(pmTraceDB, &lEvent, pmSystem, FALSE);
+
+#if SUPP_RTAI
+    /* Does this trace contain RTAI information */
+    if(pmTraceDB->SystemType == TRACE_SYS_TYPE_RTAI_LINUX)
+      /* Get the RTAI task to which this event belongs */
+      pTask = RTAIDBEventTask(pmTraceDB, &lEvent, pmSystem, FALSE);
+#endif /* SUPP_RTAI */
+
+    /* Set the event's entry in the list of raw events displayed */
+    sRawEventsDisplayed[i] = lEvent;
+
+    /* Add text describing the event */
+    /*  The CPU ID */
+    if(pmTraceDB->LogCPUID == TRUE)
+      snprintf(lString[0], MW_DEFAULT_STRLEN, "%d", lEventDesc.CPUID);
+    else
+      snprintf(lString[0], MW_DEFAULT_STRLEN, "0");
+
+    /*  The event ID */
+    snprintf(lString[1], MW_DEFAULT_STRLEN, "%s", pmTraceDB->EventString(pmTraceDB, lEventDesc.ID, &lEvent));
+
+    /*  The event's time of occurence */
+    DBFormatTimeInReadableString(lTimeStr,
+                                lEventDesc.Time.tv_sec,
+                                lEventDesc.Time.tv_usec);    
+    snprintf(lString[2], MW_DEFAULT_STRLEN, "%s", lTimeStr);
+
+    /* Is this an RT event */
+    if(lEventDesc.ID <= TRACE_MAX)
+      {
+      /*  The PID of the process to which the event belongs */
+      if(pProcess != NULL)
+       snprintf(lString[3], MW_DEFAULT_STRLEN, "%d", pProcess->PID);
+      else
+       snprintf(lString[3], MW_DEFAULT_STRLEN, "N/A");
+      }
+#if SUPP_RTAI
+    else
+      {
+      /*  The TID of the task to which the event belongs */
+      if(pTask != NULL)
+       snprintf(lString[3], MW_DEFAULT_STRLEN, "RT:%d", pTask->TID);
+      else
+       snprintf(lString[3], MW_DEFAULT_STRLEN, "RT:N/A");
+      }
+#endif /* SUPP_RTAI */
+
+    /*  The size of the entry */
+    snprintf(lString[4], MW_DEFAULT_STRLEN, "%d", lEventDesc.Size);
+
+    /*  The string describing the event */
+    snprintf(lString[5], MW_LONG_STRLEN, "%s", lEventDesc.String);
+
+    /* Insert the entry into the list */
+    gtk_clist_append(GTK_CLIST(pmList), lString);
+
+    /* Set the row's data to point to the current event */
+    WDI_gtk_clist_set_last_row_data_full(GTK_CLIST(pmList), (gpointer) &(sRawEventsDisplayed[i]), NULL);
+
+    /* Was this the last selected event */
+    if(DBEventsEqual(lEvent, (*pmSelectedEvent)))
+      gtk_clist_select_row(GTK_CLIST(pmList), i, 0);
+
+    /* Go to next row */
+    i++;
+    } while((DBEventNext(pmTraceDB, &lEvent) == TRUE) && (i < RTCLIST_NB_ROWS));
+
+  /* Resize the list's length */
+  gtk_widget_queue_resize(pmList);
+
+  /* Thaw the clist */
+  gtk_clist_thaw(GTK_CLIST(pmList));
+}
+
+
+
 
 /*\@}*/
This page took 0.042709 seconds and 4 git commands to generate.