From: Pedro Alves <pedro@codesourcery.com>
To: Denys Vlasenko <vda.linux@googlemail.com>
Cc: "Indan Zupancic" <indan@nul.nu>,
"Oleg Nesterov" <oleg@redhat.com>, "Tejun Heo" <tj@kernel.org>,
"Denys Vlasenko" <dvlasenk@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: Why I want PTRACE_O_TRACESTOP option
Date: Sat, 10 Sep 2011 12:20:54 +0100 [thread overview]
Message-ID: <201109101220.54577.pedro@codesourcery.com> (raw)
In-Reply-To: <201109100317.03979.vda.linux@googlemail.com>
On Saturday 10 September 2011 02:17:03, Denys Vlasenko wrote:
> On Saturday 10 September 2011 01:09, Indan Zupancic wrote:
> > On Fri, September 9, 2011 18:26, Oleg Nesterov wrote:
> > > On 09/09, Indan Zupancic wrote:
> > >>
> > >> It is very useful to set options atomically at SEIZE time.
> > >
> > > Nobody argues with this.
> > >
> > >> Another important reason to make PTRACE_O_TRACESTOP an option is
> > >> because not everyone uses SEIZE: Users using PTRACE_TRACEME can't
> > >> set this option at all.
> > >
> > > Yes. This was already discussed, PTRACE_TRACEME obviously doesn't
> > > work if you need the new features. So far it was decided TRACEME
> > > should be avoided,
> >
> > How do you want to attach/seize a just forked child without races
> > in a less ugly way than with TRACEME?
>
> I needed to do it when I was adding usage of SEIZE to strace.
> It goes like this:
>
> - fork
> - child: raise(SIGSTOP)
> - parent: waits until it sees child stopping
> - parent: seizes the child
> - parent: kill(child, SIGCONT)
You can do without SIGSTOP/signals:
- pipe
- fork
- child: block reading pipe
- parent: seizes the child
- parent: whatever else needs doing (e.g, interrupt and set options if not already done at seize time)
- parent: close the pipe
- child: notices pipe closed, moves on.
GDB already does something similar for other OSs (darwin/OSX, ttrace/HP-UX).
--
Pedro Alves
next prev parent reply other threads:[~2011-09-10 11:21 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-08 16:50 Why I want PTRACE_O_TRACESTOP option Denys Vlasenko
2011-09-09 0:18 ` Tejun Heo
2011-09-09 5:45 ` Denys Vlasenko
2011-09-09 16:00 ` Oleg Nesterov
2011-09-10 23:43 ` Tejun Heo
2011-09-09 5:54 ` Denys Vlasenko
2011-09-09 12:26 ` Indan Zupancic
2011-09-09 13:01 ` Indan Zupancic
2011-09-09 16:46 ` Denys Vlasenko
2011-09-09 16:26 ` Oleg Nesterov
2011-09-09 23:09 ` Indan Zupancic
2011-09-10 1:17 ` Denys Vlasenko
2011-09-10 11:20 ` Pedro Alves [this message]
2011-09-11 0:58 ` Tejun Heo
2011-09-09 16:14 ` Oleg Nesterov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201109101220.54577.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=dvlasenk@redhat.com \
--cc=indan@nul.nu \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@redhat.com \
--cc=tj@kernel.org \
--cc=vda.linux@googlemail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.