fine tune per architecture facilities
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Sun, 18 Dec 2005 06:49:50 +0000 (06:49 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Sun, 18 Dec 2005 06:49:50 +0000 (06:49 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1439 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/facilities/Makefile.am
ltt/branches/poly/ltt/ltt.h
ltt/branches/poly/ltt/parser.c
ltt/branches/poly/ltt/parser.h
ltt/branches/poly/ltt/tracefile.c
ltt/branches/poly/lttv/lttv/state.c
ltt/branches/poly/lttv/lttv/state.h
ltt/branches/poly/lttv/lttv/stats.c
ltt/branches/poly/lttv/modules/gui/controlflow/drawing.c

index 36521458452402c3213243ec99639d547ad6541e..3a878f1d0838ca972e28629452ce295d5a0646cd 100644 (file)
@@ -3,8 +3,8 @@ EXTRA_DIST =  \
 core.xml \
 fs.xml \
 ipc.xml \
-asm_i386_kernel.xml \
 kernel.xml \
+kernel_arch_i386.xml \
 memory.xml \
 network.xml \
 process.xml \
@@ -16,8 +16,8 @@ facilities_DATA = \
 core.xml \
 fs.xml \
 ipc.xml \
-asm_i386_kernel.xml \
 kernel.xml \
+kernel_arch_i386.xml \
 memory.xml \
 network.xml \
 process.xml \
index e0c7a731e0ed1d4a20f46fe88afecba004d52d8e..ad1d42e957d11fb90888d31b918cb3e0782b0689 100644 (file)
@@ -155,5 +155,21 @@ typedef enum _LttTypeEnum
   LTT_UNION,
   LTT_NONE
 } LttTypeEnum;
-  
+
+/* Architecture types */
+#define LTT_ARCH_TYPE_I386          1
+#define LTT_ARCH_TYPE_PPC           2
+#define LTT_ARCH_TYPE_SH            3
+#define LTT_ARCH_TYPE_S390          4
+#define LTT_ARCH_TYPE_MIPS          5
+#define LTT_ARCH_TYPE_ARM           6
+#define LTT_ARCH_TYPE_PPC64         7
+#define LTT_ARCH_TYPE_X86_64        8
+
+/* Standard definitions for variants */
+#define LTT_ARCH_VARIANT_NONE       0  /* Main architecture implementation */
+
+
+
 #endif // LTT_H
index b8f2a6a2fc03d924847d5dda9d045c8f0c873f2b..6dbf402d76fd4f008f8d8c5cce17378df0617b15 100644 (file)
@@ -267,6 +267,7 @@ void getFacilityAttributes(parse_file_t *in, facility_t *fac)
   char car;
   
   fac->name = NULL;
+  fac->arch = NULL;
 
   while(1) {
     token = getToken(in); 
@@ -281,7 +282,12 @@ void getFacilityAttributes(parse_file_t *in, facility_t *fac)
       if(car == EOF) in->error(in,"name was expected");
       else if(car == '\"') fac->name = allocAndCopy(getQuotedString(in));
       else fac->name = allocAndCopy(getName(in));
-    }
+    } else if(!strcmp("arch", token)) {
+      getEqual(in);
+      car = seekNextChar(in);
+      if(car == '\"') fac->name = allocAndCopy(getQuotedString(in));
+                       else fac->arch = allocAndCopy(getName(in));
+               }
   }
 }
 
@@ -420,7 +426,7 @@ void parseFacility(parse_file_t *in, facility_t * fac)
   
   getFacilityAttributes(in, fac);
   if(fac->name == NULL) in->error(in, "Attribute not named");
-
+       
   fac->capname = allocAndCopy(fac->name);
        strupper(fac->capname);
   getRAnglebracket(in);    
@@ -1551,5 +1557,3 @@ char *appendString(char *s, char *suffix)
   strcat(tmp,suffix);  
   return tmp;
 }
-
-
index 21884fb6d0b82d35f44bd4cc12ee19e5f3e7a799..4215f286cd82077ad90b90df4a49ed305d88c345 100644 (file)
@@ -137,6 +137,7 @@ typedef struct _event {
 typedef struct _facility {
   char * name;
        char * capname;
+       char * arch;
   char * description;
   sequence_t events;
   sequence_t unnamed_types; //FIXME : remove
index 5fbf53cb32fc2d1842b291787ef115d4068da5a8..e7e213dc9d843b2dfd28d7f2ce9c57d30ee4d7a9 100644 (file)
@@ -858,6 +858,8 @@ static int ltt_get_facility_description(LttFacility *f,
   const gchar *text;
   guint textlen;
   gint err;
+       gint arch_spec;
+       gint fac_name_len;
 
   text = g_quark_to_string(t->pathname);
   textlen = strlen(text);
@@ -871,9 +873,21 @@ static int ltt_get_facility_description(LttFacility *f,
   strcat(desc_file_name, text);
   
   text = g_quark_to_string(f->name);
-  textlen+=strlen(text);
+       fac_name_len = strlen(text);
+  textlen+=fac_name_len;
   if(textlen >= PATH_MAX) goto name_error;
   strcat(desc_file_name, text);
+
+       /* arch specific facilities are named like this : name_arch */
+       if(fac_name_len+1 < sizeof("_arch"))
+               arch_spec = 0;
+       else {
+               if(!strcmp(&text[fac_name_len+1-sizeof("_arch")], "_arch"))
+                       arch_spec = 1;
+               else
+                       arch_spec = 0;
+       }
+
 #if 0
   text = "_";
   textlen+=strlen(text);
@@ -887,6 +901,39 @@ static int ltt_get_facility_description(LttFacility *f,
   textlen=strlen(desc_file_name);
   
 #endif //0
+       
+       if(arch_spec) {
+               switch(t->arch_type) {
+                       case LTT_ARCH_TYPE_I386:
+                               text = "_i386";
+                               break;
+                       case LTT_ARCH_TYPE_PPC:
+                               text = "_ppc";
+                               break;
+                       case LTT_ARCH_TYPE_SH:
+                               text = "_sh";
+                               break;
+                       case LTT_ARCH_TYPE_S390:
+                               text = "_s390";
+                               break;
+                       case LTT_ARCH_TYPE_MIPS:
+                               text = "_mips";
+                               break;
+                       case LTT_ARCH_TYPE_ARM:
+                               text = "_arm";
+                       case LTT_ARCH_TYPE_PPC64:
+                               text = "_ppc64";
+                       case LTT_ARCH_TYPE_X86_64:
+                               text = "_x86_64";
+                               break;
+                       default:
+                               g_error("Trace from unsupported architecture.");
+               }
+               textlen+=strlen(text);
+               if(textlen >= PATH_MAX) goto name_error;
+               strcat(desc_file_name, text);
+       }
+       
   text = ".xml";
   textlen+=strlen(text);
   if(textlen >= PATH_MAX) goto name_error;
index d3879f76a8635144761d47688b1c635e81ecc4cb..18d21fde159688115236bc06360ee53a645a2ff4 100644 (file)
@@ -35,7 +35,7 @@
 
 GQuark
     LTT_FACILITY_KERNEL,
-    LTT_FACILITY_ASM_I386_KERNEL,
+    LTT_FACILITY_KERNEL_ARCH,
     LTT_FACILITY_PROCESS,
     LTT_FACILITY_FS;
 
@@ -769,7 +769,7 @@ create_name_tables(LttvTraceState *tcs)
   }
 #endif //0
   if(lttv_trace_find_hook(tcs->parent.t,
-      LTT_FACILITY_ASM_I386_KERNEL, LTT_EVENT_SYSCALL_ENTRY,
+      LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_SYSCALL_ENTRY,
       LTT_FIELD_SYSCALL_ID, 0, 0,
       NULL, NULL, &h))
     return;
@@ -1435,13 +1435,13 @@ void lttv_state_add_event_hooks(LttvTracesetState *self)
     hooks = g_array_set_size(hooks, 11);
 
     ret = lttv_trace_find_hook(ts->parent.t,
-        LTT_FACILITY_ASM_I386_KERNEL, LTT_EVENT_SYSCALL_ENTRY,
+        LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_SYSCALL_ENTRY,
         LTT_FIELD_SYSCALL_ID, 0, 0,
         syscall_entry, NULL, &g_array_index(hooks, LttvTraceHook, 0));
     g_assert(!ret);
 
     ret = lttv_trace_find_hook(ts->parent.t,
-        LTT_FACILITY_ASM_I386_KERNEL, LTT_EVENT_SYSCALL_EXIT,
+        LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_SYSCALL_EXIT,
         0, 0, 0,
         syscall_exit, NULL, &g_array_index(hooks, LttvTraceHook, 1));
     g_assert(!ret);
@@ -2153,7 +2153,7 @@ static void module_init()
 
   
   LTT_FACILITY_KERNEL     = g_quark_from_string("kernel");
-  LTT_FACILITY_ASM_I386_KERNEL     = g_quark_from_string("asm_i386_kernel");
+  LTT_FACILITY_KERNEL_ARCH = g_quark_from_string("kernel_arch");
   LTT_FACILITY_PROCESS    = g_quark_from_string("process");
   LTT_FACILITY_FS    = g_quark_from_string("fs");
 
index c6a373ab87cd51804c9de38f078decd419e58954..de8d36b8a8557669290e9bf4bb90ee89a7b018f6 100644 (file)
@@ -57,7 +57,7 @@
 
 extern GQuark
     LTT_FACILITY_KERNEL,
-    LTT_FACILITY_ASM_I386_KERNEL,
+    LTT_FACILITY_KERNEL_ARCH,
     LTT_FACILITY_PROCESS,
     LTT_FACILITY_FS;
 
index d4321bce7ed80c4b955b3e442c68993e355195a0..23a9cca8481b0848f17bc0855fdc068d4be3aa73 100644 (file)
@@ -808,14 +808,14 @@ void lttv_stats_add_event_hooks(LttvTracesetStats *self)
     g_array_set_size(hooks, 7);
 
     ret = lttv_trace_find_hook(ts->parent.parent.t,
-        LTT_FACILITY_ASM_I386_KERNEL, LTT_EVENT_SYSCALL_ENTRY,
+        LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_SYSCALL_ENTRY,
         LTT_FIELD_SYSCALL_ID, 0, 0,
         before_syscall_entry, NULL, 
         &g_array_index(hooks, LttvTraceHook, 0));
     g_assert(!ret);
 
     ret = lttv_trace_find_hook(ts->parent.parent.t,
-        LTT_FACILITY_ASM_I386_KERNEL, LTT_EVENT_SYSCALL_EXIT,
+        LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_SYSCALL_EXIT,
         0, 0, 0,
         before_syscall_exit, NULL, 
         &g_array_index(hooks, LttvTraceHook, 1));
@@ -862,14 +862,14 @@ void lttv_stats_add_event_hooks(LttvTracesetStats *self)
     g_array_set_size(hooks, 9);
 
     ret = lttv_trace_find_hook(ts->parent.parent.t,
-        LTT_FACILITY_ASM_I386_KERNEL, LTT_EVENT_SYSCALL_ENTRY,
+        LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_SYSCALL_ENTRY,
         LTT_FIELD_SYSCALL_ID, 0, 0,
         after_syscall_entry, NULL, 
         &g_array_index(hooks, LttvTraceHook, 0));
     g_assert(!ret);
 
     ret = lttv_trace_find_hook(ts->parent.parent.t,
-        LTT_FACILITY_ASM_I386_KERNEL, LTT_EVENT_SYSCALL_EXIT,
+        LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_SYSCALL_EXIT,
         0, 0, 0,
         after_syscall_exit, NULL, 
         &g_array_index(hooks, LttvTraceHook, 1));
index b22931d69a8cd5e7de9fe7560d979ef965fd42b9..b461e8a46c22b077cd2a5ff4a87a4568dacd39db 100644 (file)
@@ -224,7 +224,7 @@ void drawing_data_request(Drawing_t *drawing,
       /* before hooks */
       
       ret = lttv_trace_find_hook(ts->parent.t,
-          LTT_FACILITY_ASM_I386_KERNEL, LTT_EVENT_SYSCALL_ENTRY,
+          LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_SYSCALL_ENTRY,
           LTT_FIELD_SYSCALL_ID, 0, 0,
           before_execmode_hook,
           events_request,
@@ -232,7 +232,7 @@ void drawing_data_request(Drawing_t *drawing,
       g_assert(!ret);
 
       ret = lttv_trace_find_hook(ts->parent.t,
-          LTT_FACILITY_ASM_I386_KERNEL, LTT_EVENT_SYSCALL_EXIT,
+          LTT_FACILITY_KERNEL_ARCH, LTT_EVENT_SYSCALL_EXIT,
           0, 0, 0,
           before_execmode_hook,
           events_request,
This page took 0.029595 seconds and 4 git commands to generate.