X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Flttv%2Fstate.c;h=1be0ce21e270888206265d9c39bac94e54407b5e;hb=89f8741a6717b08fe5b9116660d5833e20d6dfda;hp=92d5af7267f6c15f52189f2e7aa9fe621717cbaf;hpb=d3670e3d5ce02f94aa811b450538d8d3922566c5;p=lttv.git diff --git a/ltt/branches/poly/lttv/lttv/state.c b/ltt/branches/poly/lttv/lttv/state.c index 92d5af72..1be0ce21 100644 --- a/ltt/branches/poly/lttv/lttv/state.c +++ b/ltt/branches/poly/lttv/lttv/state.c @@ -2257,7 +2257,8 @@ static gboolean process_fork(void *hook_data, void *call_data) return FALSE; } -/* We stamp a newly created process as kernel_thread */ +/* We stamp a newly created process as kernel_thread. + * The thread should not be running yet. */ static gboolean process_kernel_thread(void *hook_data, void *call_data) { LttvTracefileState *s = (LttvTracefileState *)call_data; @@ -2274,7 +2275,10 @@ static gboolean process_kernel_thread(void *hook_data, void *call_data) s->parent.target_pid = pid; process = lttv_state_find_process(ts, ANY_CPU, pid); - es = &g_array_index(process->execution_stack, LttvExecutionState, 0); + process->execution_stack = + g_array_set_size(process->execution_stack, 1); + es = process->state = + &g_array_index(process->execution_stack, LttvExecutionState, 0); es->t = LTTV_STATE_SYSCALL; process->type = LTTV_STATE_KERNEL_THREAD; @@ -2427,7 +2431,9 @@ static void fix_process(gpointer key, gpointer value, es->s = LTTV_STATE_RUN; if(process->execution_stack->len == 1) { - /* Still in user mode, means never scheduled */ + /* Still in bottom unknown mode, means never did a system call + * May be either in user mode, syscall mode, running or waiting.*/ + /* FIXME : we may be tagging syscall mode when being user mode */ process->execution_stack = g_array_set_size(process->execution_stack, 2); es = process->state = &g_array_index(process->execution_stack, @@ -2438,7 +2444,7 @@ static void fix_process(gpointer key, gpointer value, //g_assert(timestamp->tv_sec != 0); es->change = *timestamp; es->cum_cpu_time = ltt_time_zero; - es->s = LTTV_STATE_WAIT; + //es->s = LTTV_STATE_WAIT; } } }