[PATCH 5/8] dovetail/kevents: dovetail: implement handle_ptrace_cont

Philippe Gerum rpm at xenomai.org
Sat Jan 16 13:31:16 CET 2021


hongzha1 via Xenomai <xenomai at xenomai.org> writes:

> Signed-off-by: hongzha1 <hongzhan.chen at intel.com>
>
> diff --git a/kernel/cobalt/dovetail/kevents.c b/kernel/cobalt/dovetail/kevents.c
> index b5dc50ea7..378017bea 100644
> --- a/kernel/cobalt/dovetail/kevents.c
> +++ b/kernel/cobalt/dovetail/kevents.c
> @@ -473,7 +473,7 @@ int handle_ptrace_resume(struct task_struct *tracee)
>  	return KEVENT_PROPAGATE;
>  }
>  
> -static void handle_ptrace_cont(void)
> +static void handle_ptrace_cont(struct task_struct *next_task)
>  {

Dovetail does not pass any argument to the client core along with
INBAND_TASK_PTCONT, because "current" may always be assumed. So
handle_ptrace_cont() receives no argument, and next_task is actually
"current" in this case.

The reason was that the I-pipe gave us no way to observe ptraced tasks
waking up from a stopped state, so we resorted to observing context
switches, figuring out when/if the incoming task was about to resume
from a ptrace-induced stopped state. Since Dovetail can send us such
event directly from the context of the resuming task, next_task ==
current in this context.

-- 
Philippe.



More information about the Xenomai mailing list