From: Francis Giraldeau Date: Wed, 26 Jan 2011 01:00:29 +0000 (-0500) Subject: Wakeup change state only if proc not running (v2) X-Git-Tag: v0.12.37~10 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=6b1f0e27f35150ee49c5d18fa5e5a0e298d24369;p=lttv.git Wakeup change state only if proc not running (v2) The event kernel.sched_try_wakeup can occur for process already running (in kernel/sched.c:try_to_wake_up). Hence, in this condition, this event must not change the state of the process to LTTV_STATE_WAIT_CPU. This patch supports SMP Signed-off-by: Francis Giraldeau Signed-off-by: Mathieu Desnoyers --- diff --git a/lttv/lttv/state.c b/lttv/lttv/state.c index bd3f64d6..938f23e4 100644 --- a/lttv/lttv/state.c +++ b/lttv/lttv/state.c @@ -2954,8 +2954,12 @@ static gboolean sched_try_wakeup(void *hook_data, void *call_data) (LttvTraceState*)s->parent.t_context, woken_cpu, woken_pid, &s->parent.timestamp); - process->state->s = LTTV_STATE_WAIT_CPU; - process->state->change = s->parent.timestamp; + + if (process->state->s == LTTV_STATE_WAIT || process->state->s == LTTV_STATE_WAIT_FORK) + { + process->state->s = LTTV_STATE_WAIT_CPU; + process->state->change = s->parent.timestamp; + } g_debug("Wakeup: process %d on CPU %u\n", woken_pid, woken_cpu);