Wakeup change state only if proc not running (v2)
authorFrancis Giraldeau <francis.giraldeau@usherbrooke.ca>
Wed, 26 Jan 2011 01:00:29 +0000 (20:00 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Wed, 26 Jan 2011 01:00:29 +0000 (20:00 -0500)
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 <francis.giraldeau@usherbrooke.ca>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lttv/lttv/state.c

index bd3f64d6cd08473ece9108b784c4c6add5c815c7..938f23e4cd911ae52fc4f87d13f06f63d457a384 100644 (file)
@@ -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);
 
This page took 0.025225 seconds and 4 git commands to generate.