Temporary fix for large IRQ tables
authorMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Tue, 15 Dec 2009 18:50:40 +0000 (13:50 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Tue, 15 Dec 2009 18:50:40 +0000 (13:50 -0500)
IRQ tables, trap tables and softirq tables can grow. The copy mechanism for
these is not correct when saving/restoring state, because it uses always the
name table size (which grows) to copy the saved/restored state snapshots.

We should change the g_new allocations for g_arrays, and use the array length as
boundary for the copy rather than the name table len.

TODO / FIXME !

I currently increased the initial irq name table size to 512 to deal correctly
with ARM. This is a dumb temporary fix.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
lttv/lttv/state.c
lttv/lttv/state.h

index 595a777e1634ea147b03e5c70afee7e33fad0744..27adae2c1abdd1a22322621c79bcee799411e286 100644 (file)
@@ -2057,10 +2057,12 @@ create_name_tables(LttvTraceState *tcs)
       name_tables->irq_names[i] = g_quark_from_string(ltt_enum_string_get(t, i));
     }
     */
+    /* FIXME: LttvIRQState *irq_states should become a g_array */
+    /* temp fix: increase from 256 to 512 default size */
 
-    name_tables->nb_irqs = 256;
-    name_tables->irq_names = g_new(GQuark, 256);
-    for(i = 0 ; i < 256 ; i++) {
+    name_tables->nb_irqs = 512;
+    name_tables->irq_names = g_new(GQuark, 512);
+    for(i = 0 ; i < 512 ; i++) {
       g_string_printf(fe_name, "irq %d", i);
       name_tables->irq_names[i] = g_quark_from_string(fe_name->str);
     }
index a66318e52f25852d0de9dcb202b66f729d0bf731..25d5a0623477297f4ba554ed63d159630d20d51d 100644 (file)
@@ -393,8 +393,11 @@ struct _LttvTraceState {
   LttvProcessState **running_process;
   gboolean has_precomputed_states;
   LttvCPUState *cpu_states; /* state of each cpu */
+  /* FIXME should be a g_array to deal with resize and copy. */
   LttvIRQState *irq_states; /* state of each irq handler */
+  /* FIXME should be a g_array to deal with resize and copy. */
   LttvSoftIRQState *soft_irq_states; /* state of each softirq */
+  /* FIXME should be a g_array to deal with resize and copy. */
   LttvTrapState *trap_states; /* state of each trap */
   GHashTable *bdev_states; /* state of the block devices */
 };
This page took 0.027213 seconds and 4 git commands to generate.