[ltt-dev] [PATCH] Wakeup change state only if proc not running (v2)

Mathieu Desnoyers compudj at krystal.dyndns.org
Tue Jan 25 19:59:52 EST 2011


* Francis Giraldeau (francis.giraldeau at usherbrooke.ca) wrote:
> 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

merged, thanks!

Mathieu

> ---
>  lttv/lttv/state.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/lttv/lttv/state.c b/lttv/lttv/state.c
> index bd3f64d..938f23e 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);
>  
> -- 
> 1.7.1
> 
> 
> _______________________________________________
> ltt-dev mailing list
> ltt-dev at lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
> 

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com




More information about the lttng-dev mailing list