From 6b1f0e27f35150ee49c5d18fa5e5a0e298d24369 Mon Sep 17 00:00:00 2001 From: Francis Giraldeau Date: Tue, 25 Jan 2011 20:00:29 -0500 Subject: [PATCH] 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 --- lttv/lttv/state.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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); -- 2.34.1