change find_field
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Fri, 16 Dec 2005 19:26:06 +0000 (19:26 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Fri, 16 Dec 2005 19:26:06 +0000 (19:26 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1401 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/lttv/lttv/print.c
ltt/branches/poly/lttv/lttv/tracecontext.c

index b0f1d58845df7ff87d3e6d3848a493259cb86e9e..085216f619f9bf3fb72b410523f529bd2afe556a 100644 (file)
@@ -185,10 +185,11 @@ void lttv_event_to_string(LttEvent *e, GString *s,
                    process->ppid,
                    g_quark_to_string(process->state->t));
   }
+  event_type = ltt_event_eventtype(e);
   
-  num_fields = ltt_event_num_fields(e);
+  num_fields = ltt_eventtype_num_fields(event_type);
   for(i=0; i<num_fields; i++) {
-    field = ltt_event_field(e, i);
+    field = ltt_event_field(event_type, i);
     lttv_print_field(e, field, s, field_names);
   }
 } 
index 657664b721e93e9381085493b420312e4825ecd3..37147f8c32b35b45e5f97e11282e181c846c19e8 100644 (file)
@@ -953,27 +953,11 @@ gboolean lttv_process_traceset_seek_position(LttvTracesetContext *self,
 static LttField *
 find_field(LttEventType *et, const GQuark field)
 {
-  LttType *t;
-
-  LttField *f;
-
-  guint i, nb;
-
   GQuark name;
 
-  /* Field is unset */
   if(field == 0) return NULL;
   
-  f = ltt_eventtype_field(et);
-  t = ltt_eventtype_type(et);
-  g_assert(ltt_type_class(t) == LTT_STRUCT);
-  nb = ltt_type_member_number(t);
-  for(i = 0 ; i < nb ; i++) {
-    ltt_type_member_type(t, i, &name);
-    if(name == field) break;
-  }
-  g_assert(i < nb);
-  return ltt_field_member(f, i);
+  return ltt_eventtype_field_by_name(et, field);
 }
 
 LttvTraceHookByFacility *lttv_trace_hook_get_fac(LttvTraceHook *th, 
This page took 0.024937 seconds and 4 git commands to generate.