lkml.org 
[lkml]   [2011]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/5] ptrace: implement TRAP_NOTIFY and use it for group stop events
On 06/14, Tejun Heo wrote:
>
> When group stop state of a seized tracee changes, JOBCTL_TRAP_NOTIFY
> is set,

I already applied this series. But somehow I have the fuzzy feeling we
can simplify JOBCTL_TRAP_NOTIFY/JOBCTL_TRAP_STOP logic later. No, I can't
explain what I mean ;)

One question,

> @@ -1797,8 +1824,10 @@ static void ptrace_stop(int exit_code, int why, int clear_code, siginfo_t *info)
> if (why == CLD_STOPPED && (current->jobctl & JOBCTL_STOP_PENDING))
> gstop_done = task_participate_group_stop(current);
>
> - /* any trap clears pending STOP trap */
> + /* any trap clears pending STOP trap, STOP trap clears NOTIFY */
> task_clear_jobctl_pending(current, JOBCTL_TRAP_STOP);
> + if (info && info->si_code >> 8 == PTRACE_EVENT_STOP)
> + task_clear_jobctl_pending(current, JOBCTL_TRAP_NOTIFY);

OK, but can't we check why == CLD_STOPPED instead of PTRACE_EVENT_STOP?

In fact, can't we move all code above under 'if (why == CLD_STOPPED)' ?
JOBCTL_TRAP_STOP can't be set otherwise, no? I am almost sure I missed
something though.

Oleg.



\
 
 \ /
  Last update: 2011-06-16 21:57    [W:0.068 / U:2.332 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site