use enums arch specific for syscall names
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Sat, 17 Dec 2005 23:52:24 +0000 (23:52 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Sat, 17 Dec 2005 23:52:24 +0000 (23:52 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1429 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/ltt/type.c
ltt/branches/poly/lttv/lttv/state.c

index 0961eb141d32b8dd244e0f00738a46c708c69446..97a9593aad5a0a8bd3c36a0882b8dd1911f4d0bc 100644 (file)
@@ -213,23 +213,22 @@ LttType *ltt_type_element_type(LttType *t)
 
 /*****************************************************************************
  *Function name
- *    ltt_type_element_number : obtain the number of elements for arrays 
+ *    ltt_type_element_number : obtain the number of elements for enums
  *Input params
- *    t                       : a type   
+ *    t                       : a type
  *Return value
  *    unsigned                : the number of elements for arrays
  ****************************************************************************/
-#if 0
 unsigned ltt_type_element_number(LttType *t)
 {
   unsigned ret = 0;
 
-  if(likely(t->type_class == LTT_ARRAY))
-    ret = t->element_number;
+  if(likely(t->type_class == LTT_ENUM))
+    ret = g_hash_table_size(t->enum_map);
 
   return ret;
 }
-#endif //0
+
 /*****************************************************************************
  *Function name
  *    ltt_type_member_number : obtain the number of data members for structure 
index 0721f7c9ba92eceb2b8166c0f65b95e237dd6ca0..d3879f76a8635144761d47688b1c635e81ecc4cb 100644 (file)
@@ -777,24 +777,21 @@ create_name_tables(LttvTraceState *tcs)
   thf = lttv_trace_hook_get_first(&h);
   
   t = ltt_field_type(thf->f1);
-  //nb = ltt_type_element_number(t);
+  nb = ltt_type_element_number(t);
   
   lttv_trace_hook_destroy(&h);
 
-  /* CHECK syscalls should be an enum but currently are not!  
   name_tables->syscall_names = g_new(GQuark, nb);
 
   for(i = 0 ; i < nb ; i++) {
-    name_tables->syscall_names[i] = g_quark_from_string(
-        ltt_enum_string_get(t, i));
+    name_tables->syscall_names[i] = ltt_enum_string_get(t, i);
   }
-  */
 
-  name_tables->syscall_names = g_new(GQuark, 256);
-  for(i = 0 ; i < 256 ; i++) {
-    g_string_printf(fe_name, "syscall %d", i);
-    name_tables->syscall_names[i] = g_quark_from_string(fe_name->str);
-  }
+  //name_tables->syscall_names = g_new(GQuark, 256);
+  //for(i = 0 ; i < 256 ; i++) {
+  //  g_string_printf(fe_name, "syscall %d", i);
+  //  name_tables->syscall_names[i] = g_quark_from_string(fe_name->str);
+  //}
 
   if(lttv_trace_find_hook(tcs->parent.t, LTT_FACILITY_KERNEL,
         LTT_EVENT_TRAP_ENTRY,
This page took 0.02685 seconds and 4 git commands to generate.