From 7f58442b15c9dcfa63a1e88a666cadbbc2e7f8d9 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Tue, 15 Dec 2009 13:50:40 -0500 Subject: [PATCH] Temporary fix for large IRQ tables 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 --- lttv/lttv/state.c | 8 +++++--- lttv/lttv/state.h | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lttv/lttv/state.c b/lttv/lttv/state.c index 595a777e..27adae2c 100644 --- a/lttv/lttv/state.c +++ b/lttv/lttv/state.c @@ -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); } diff --git a/lttv/lttv/state.h b/lttv/lttv/state.h index a66318e5..25d5a062 100644 --- a/lttv/lttv/state.h +++ b/lttv/lttv/state.h @@ -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 */ }; -- 2.34.1