tracecontext modified to reflect new strict boundary architecture
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Wed, 26 May 2004 02:40:54 +0000 (02:40 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Wed, 26 May 2004 02:40:54 +0000 (02:40 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@548 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/ltt/event.c
ltt/branches/poly/ltt/event.h

index 3b28f57616ed5baa6eb0ff74c3fc2fffdbfc6584..bd9a8fbe9eeaded3edb9e8f218c1b0cde8d8df02 100644 (file)
@@ -260,6 +260,66 @@ void ltt_event_position_set(LttEventPosition *ep,
   ep->event_num = index_in_block;  
 }
 
+/*****************************************************************************
+ * Function name
+ *    ltt_event_position_compare : compare two positions
+ * Input params
+ *    ep1                    : a pointer to event's position structure
+ *    ep2                    : a pointer to event's position structure
+ * Return
+ *    -1 is ep1 < ep2
+ *    1 if ep1 > ep2
+ *    0 if ep1 == ep2
+ ****************************************************************************/
+
+
+gint ltt_event_position_compare(const LttEventPosition *ep1,
+                                const LttEventPosition *ep2)
+{
+  if(ep1->tf != ep2->tf)
+    g_error("ltt_event_position_compare on different tracefiles makes no sense");
+  if(ep1->block_num < ep2->block_num)
+    return -1;
+  if(ep1->block_num > ep2->block_num)
+    return 1;
+  if(ep1->event_num < ep2->event_num)
+    return -1;
+  if(ep1->event_num > ep2->event_num)
+    return 1;
+  return 0;
+}
+
+/*****************************************************************************
+ * Function name
+ *    ltt_event_event_position_compare : compare two positions, one in event,
+ *    other in position opaque structure.
+ * Input params
+ *    event                  : a pointer to event structure
+ *    ep                     : a pointer to event's position structure
+ * Return
+ *    -1 is event < ep
+ *    1 if event > ep
+ *    0 if event == ep
+ ****************************************************************************/
+
+gint ltt_event_event_position_compare(const LttEvent *event,
+                                      const LttEventPosition *ep)
+{
+  if(event->tf != ep->tf)
+    g_error("ltt_event_position_compare on different tracefiles makes no sense");
+  if(e->which_block < ep->block_num)
+    return -1;
+  if(e->which_block > ep->block_num)
+    return 1;
+  if(e->which_event < ep->event_num)
+    return -1;
+  if(e->which_event > ep->event_num)
+    return 1;
+  return 0;
+}
+
+
+
 /*****************************************************************************
  *Function name
  *    ltt_event_cpu_i: get the cpu id where the event happens
index 4cee97133a0106767817540f0b8791657c6c83e5..88c036249e9328bf280046d6804b87a3ffdad616 100644 (file)
@@ -69,7 +69,11 @@ void ltt_event_position_get(LttEventPosition *ep,
 void ltt_event_position_set(LttEventPosition *ep,
     unsigned block_number, unsigned index_in_block);
 
+gint ltt_event_position_compare(const LttEventPosition *ep1,
+                                const LttEventPosition *ep2);
 
+gint ltt_event_event_position_compare(const LttEvent *event,
+                                      const LttEventPosition *ep);
 /* CPU id of the event */
 
 unsigned ltt_event_cpu_id(LttEvent *e);
This page took 0.026305 seconds and 4 git commands to generate.