fix irq list > 256
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 12 Oct 2006 21:11:52 +0000 (21:11 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 12 Oct 2006 21:11:52 +0000 (21:11 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@2200 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/configure.in
ltt/branches/poly/lttv/lttv/state.c
ltt/branches/poly/lttv/lttv/state.h

index 32b45c2c2b68d323a448c3e303da3f1c27c2e8c3..ab528342621d94e2ffaa6a4b1e3f99b3858d1343 100644 (file)
@@ -23,7 +23,7 @@
 AC_PREREQ(2.57)
 AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS)
 #AC_WITH_LTDL  # not needed ?
-AM_INIT_AUTOMAKE(LinuxTraceToolkitViewer,0.8.65-11102006)
+AM_INIT_AUTOMAKE(LinuxTraceToolkitViewer,0.8.66-12102006)
 AM_CONFIG_HEADER(config.h)
 AM_PROG_LIBTOOL
 
index 712fa0f700d58961916300e86de04ac5ed7ee8e4..e88db8cded15b83fbb62febe77b72124e42f36ac 100644 (file)
@@ -1355,7 +1355,9 @@ typedef struct _LttvNameTables {
   GQuark *trap_names;
   guint nb_traps;
   GQuark *irq_names;
+  guint nb_irqs;
   GQuark *soft_irq_names;
+  guint nb_softirqs;
 } LttvNameTables;
 
 
@@ -1474,12 +1476,14 @@ create_name_tables(LttvTraceState *tcs)
     }
     */
 
+    name_tables->nb_irqs = 256;
     name_tables->irq_names = g_new(GQuark, 256);
     for(i = 0 ; i < 256 ; i++) {
       g_string_printf(fe_name, "irq %d", i);
       name_tables->irq_names[i] = g_quark_from_string(fe_name->str);
     }
   } else {
+    name_tables->nb_irqs = 0;
     name_tables->irq_names = NULL;
   }
   /*
@@ -1489,6 +1493,7 @@ create_name_tables(LttvTraceState *tcs)
   }
   */
 
+  name_tables->nb_softirqs = 256;
   name_tables->soft_irq_names = g_new(GQuark, 256);
   for(i = 0 ; i < 256 ; i++) {
     g_string_printf(fe_name, "softirq %d", i);
@@ -1518,6 +1523,8 @@ get_name_tables(LttvTraceState *tcs)
   tcs->nb_traps = name_tables->nb_traps;
   tcs->irq_names = name_tables->irq_names;
   tcs->soft_irq_names = name_tables->soft_irq_names;
+  tcs->nb_irqs = name_tables->nb_irqs;
+  tcs->nb_softirqs = name_tables->nb_softirqs;
 }
 
 
@@ -1943,9 +1950,19 @@ static gboolean irq_entry(void *hook_data, void *call_data)
   LttField *f = thf->f1;
 
   LttvExecutionSubmode submode;
+  guint64 irq = ltt_event_get_unsigned(e, f);
+  guint64 nb_irqs = ((LttvTraceState *)(s->parent.t_context))->nb_irqs;
+  GString *string;
 
-  submode = ((LttvTraceState *)(s->parent.t_context))->irq_names[
-      ltt_event_get_unsigned(e, f)];
+  if(irq < nb_irqs) {
+    submode = ((LttvTraceState *)(s->parent.t_context))->irq_names[irq];
+  } else {
+    /* Fixup an incomplete irq table */
+    GString *string = g_string_new("");
+    g_string_printf(string, "irq %llu", irq);
+    submode = g_quark_from_string(string->str);
+    g_string_free(string, TRUE);
+  }
 
   /* Do something with the info about being in user or system mode when int? */
   push_state(s, LTTV_STATE_IRQ, submode);
@@ -1983,9 +2000,19 @@ static gboolean soft_irq_entry(void *hook_data, void *call_data)
   LttField *f = thf->f1;
 
   LttvExecutionSubmode submode;
+  guint64 softirq = ltt_event_get_unsigned(e, f);
+  guint64 nb_softirqs = ((LttvTraceState *)(s->parent.t_context))->nb_softirqs;
+  GString *string;
 
-  submode = ((LttvTraceState *)(s->parent.t_context))->soft_irq_names[
-      ltt_event_get_long_unsigned(e, f)];
+  if(softirq < nb_softirqs) {
+    submode = ((LttvTraceState *)(s->parent.t_context))->soft_irq_names[softirq];
+  } else {
+    /* Fixup an incomplete irq table */
+    GString *string = g_string_new("");
+    g_string_printf(string, "softirq %llu", softirq);
+    submode = g_quark_from_string(string->str);
+    g_string_free(string, TRUE);
+  }
 
   /* Do something with the info about being in user or system mode when int? */
   push_state(s, LTTV_STATE_SOFT_IRQ, submode);
index 0b471bd4056dea3b30cd714dc1c1040d91dfbf69..6cb216723a2e8aa11dd47a75d84b426283e4513d 100644 (file)
@@ -290,6 +290,8 @@ struct _LttvTraceState {
   guint  nb_syscalls;
   GQuark *trap_names;
   guint  nb_traps;
+  guint  nb_irqs;
+  guint  nb_softirqs;
   GQuark *irq_names;
   GQuark *soft_irq_names;
   LttTime *max_time_state_recomputed_in_seek;
This page took 0.028224 seconds and 4 git commands to generate.