From cab321cf1e9fd164618942560cfb27f5561d21be Mon Sep 17 00:00:00 2001 From: compudj Date: Tue, 12 Sep 2006 21:27:11 +0000 Subject: [PATCH] temp debug git-svn-id: http://ltt.polymtl.ca/svn@2092 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/lttv/lttv/state.c | 39 +++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/ltt/branches/poly/lttv/lttv/state.c b/ltt/branches/poly/lttv/lttv/state.c index ba27099d..0a48ada6 100644 --- a/ltt/branches/poly/lttv/lttv/state.c +++ b/ltt/branches/poly/lttv/lttv/state.c @@ -1632,12 +1632,26 @@ static void pop_state(LttvTracefileState *tfs, LttvExecutionMode t) g_quark_to_string(process->name), g_quark_to_string(process->brand), g_quark_to_string(process->state->s)); + g_printf("MATD1 Different execution mode type (%lu.%09lu): ignore it\n", + tfs->parent.timestamp.tv_sec, tfs->parent.timestamp.tv_nsec); + g_printf("MATD1 process state has %s when pop_int is %s\n", + g_quark_to_string(process->state->t), + g_quark_to_string(t)); + g_printf("MATD1 { %u, %u, %s, %s, %s }\n", + process->pid, + process->ppid, + g_quark_to_string(process->name), + g_quark_to_string(process->brand), + g_quark_to_string(process->state->s)); + return; } if(depth == 1){ g_info("Trying to pop last state on stack (%lu.%09lu): ignore it\n", tfs->parent.timestamp.tv_sec, tfs->parent.timestamp.tv_nsec); + g_printf("MATD1 Trying to pop last state on stack (%lu.%09lu): ignore it\n", + tfs->parent.timestamp.tv_sec, tfs->parent.timestamp.tv_nsec); return; } @@ -2413,7 +2427,13 @@ static gboolean enum_process_state(void *hook_data, void *call_data) /* Keep the stack bottom : a running user mode */ /* Disabled because of inconsistencies in the current statedump states. */ if(type == LTTV_STATE_KERNEL_THREAD) { - /* Only keep the bottom */ + /* Only keep the bottom + * FIXME Kernel thread : can be in syscall or interrupt or trap. */ + /* Will cause expected trap when in fact being syscall (even after end of + * statedump event) + * Will cause expected interrupt when being syscall. (only before end of + * statedump event) */ + // This will cause a "popping last state on stack, ignoring it." process->execution_stack = g_array_set_size(process->execution_stack, 1); es = process->state = &g_array_index(process->execution_stack, LttvExecutionState, 0); @@ -2421,12 +2441,27 @@ static gboolean enum_process_state(void *hook_data, void *call_data) es->s = status; es->n = submode; } else { - /* On top of it : */ + /* User space process : + * bottom : user mode + * either currently running or scheduled out. + * can be scheduled out because interrupted in (user mode or in syscall) + * or because of an explicit call to the scheduler in syscall. Note that + * the scheduler call comes after the irq_exit, so never in interrupt + * context. */ + // temp workaround : set size to 1 : only have user mode bottom of stack. + // will cause g_info message of expected syscall mode when in fact being + // in user mode. Can also cause expected trap when in fact being user + // mode in the event of a page fault reenabling interrupts in the handler. + // Expected syscall and trap can also happen after the end of statedump + // This will cause a "popping last state on stack, ignoring it." + process->execution_stack = g_array_set_size(process->execution_stack, 1); +#if 0 es = process->state = &g_array_index(process->execution_stack, LttvExecutionState, 1); es->t = LTTV_STATE_USER_MODE; es->s = status; es->n = submode; +#endif //0 } #if 0 /* UNKNOWN STATE */ -- 2.34.1